Re: Calling script.execute from formatctrl (183 Views)
Reply
Regular Advisor
Blue_1
Posts: 147
Registered: ‎12-01-2010
Message 1 of 6 (250 Views)
Accepted Solution

Calling script.execute from formatctrl

I am calling script.execute from formatctrl ("rootcause")

 

in the script i am assigning a thread variable to the description with the timestamp and full name of the operator

 

$deschist=str(tod())+" ("+$lo.ufname+"):";description in $script=insert(denull(description in $script), 1, 1, $description.txt);description in $script=insert(description in $script, 1, 1, $deschist))

 

the problem here is, when i click add to create a Problem record, i can see the description field having the correct value, but after problem is created if i click Cancel and back out of screen and come back again the description field is empty

 

I found out that the Problem is actually getting saved before the script is executed from rootcause formatctrl. Is there a way to change the sequence ? Is it how this always works ?

Please use plain text.
Honored Contributor
John Stagaman
Posts: 3,103
Registered: ‎07-13-2007
Message 2 of 6 (238 Views)

Re: Calling script.execute from formatctrl

In the subroutine line where you call script.execute, make sure the Before property is set to true. (If not true, the subroutine will execute after record save)

----------------------------------------------------
Kudos - what, where, how, and why
Want Good Answers? Ask Good Questions...
Please use plain text.
Regular Advisor
Blue_1
Posts: 147
Registered: ‎12-01-2010
Message 3 of 6 (211 Views)

Re: Calling script.execute from formatctrl

So what is the difference in making the Save First option as true against the Save action in the State record as against making the before as tru in subroutine ?

Please use plain text.
Honored Contributor
John Stagaman
Posts: 3,103
Registered: ‎07-13-2007
Message 4 of 6 (206 Views)

Re: Calling script.execute from formatctrl

Did you adjust the value of the "Before" condition? did it work?

----------------------------------------------------
Kudos - what, where, how, and why
Want Good Answers? Ask Good Questions...
Please use plain text.
Regular Advisor
Blue_1
Posts: 147
Registered: ‎12-01-2010
Message 5 of 6 (201 Views)

Re: Calling script.execute from formatctrl

Yes it worked , when i made the subroutine, Before condition as true

But it also worked when i made the Save First as true, against the action Save in the State record

 

Just curios to understand what the difference is what the adv/dis adv are

Please use plain text.
Honored Contributor
John Stagaman
Posts: 3,103
Registered: ‎07-13-2007
Message 6 of 6 (183 Views)

Re: Calling script.execute from formatctrl

Well, format control pre-dates the existence of the document engine (and state level processing), so prior to all modules being migrated to the doc engine (in versions 4, 5, and 5.1) the format control option was primary. 

 

It appears that the document engine state "save first" will perform a similar function, but iI don't really know exactly how the state level "save first" interacts with format control. You'd have to run a RAD trace to get the complete flow or map through the RAD stack to be sure. 

 

----------------------------------------------------
Kudos - what, where, how, and why
Want Good Answers? Ask Good Questions...
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation