Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..
170 views

calling a function or script after 30 seconds from update

Hi Experts,

I need your help please. (SM 9.30)
I want that whenever a change move to phase 4 to perform by itself a save action on that phase. 
I tried to do it from the cm3r format Control - Javascript -

Add: true
javascript: 
if (record.current_phase=="Phase 4"){
        record.doAction("save");

}
it was giving me this message everytime the change moves to phase 4: 
This record has changed since you selected it.

I even tried to do it through Triggers - After update, but still it didn't work.

I need to delay the execution of the script to 30 seconds or 1 min. Can this be done? 

Please let me know.

 

Thanks

0 Likes
1 Reply
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: calling a function or script after 30 seconds from update

In my opinion, I'd create a javascript that adds a new scheduled action to the schedule every time you need to do the "save" operation. You can add a call to that script to the cm3r Format Control, like you did.

Please see a javascript called "activityUpdates" in Script Library. There's a function called "scheduleActivityUpdate". In a similar fashion, you could call a JavaScript to add a schedule that does the saving operation. (In the example, RAD function is called, but use field "javascript" to run JS code.)

Just make sure that when the schedule is run, it's run by the operator (Schedule's 'class' field) that has rights to do the "save" operation.

---
Moving on, this account is no longer active. Best regards, Kelalek
- So Long, and Thanks for All the Fish
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.