Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..
178 views

Updating a field in another table using JavaScript in a RuleSet

I am using Process Designer in HPSM 9.52.

I want to update a field in requestTask A, that field's value be populated into the parent request and then if that value is not null to open request B.

I've used post.fc in format control to post a value to another table.

Has anyone done anything like this in a ruleset?  I've been able to call another table and pull a value already there but can't seem to make it work so I can push / post a value to another table.

0 Likes
2 Replies
Highlighted
Contributor.
Contributor.

Re: Updating a field in another table using JavaScript in a RuleSet

In the higher versions of Service Manager there is a ruleset that has as property Run Schedule Action on Record. There is also Run Action as a ruleset type.

I dont know of 9.52 has this functionality, but both those ruleset types are really handy to trigger a save on the parent record.

If your version does not have this, you can also use the generic Run Javascript rule and call a self made javascript in a scriptlibrary from the workflow. Benefit of the scriptlibrary is that is is easier to test than making javascript directly in the ruleset itself.

0 Likes
Highlighted
Trusted Contributor.. Trusted Contributor..
Trusted Contributor..

Re: Updating a field in another table using JavaScript in a RuleSet

you can use Javascript in a ruleset

var task=new SCFile( "<yourtablename>");
var rq=task.doSelect(" <select condition> "); this one to select your task, try to use parent.id, if you have many tasks use a while loop
if (rq==RC_SUCCESS){
do your modifications here
}
task.doUpdate(); this for updating the task in the DB
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.