Captain Captain
Captain
313 views

Table Component Row Update through RuleUtil.setField

We all know that request fields can be updated with JS rules through JS function like -

RuleUtil.setField("REQD.P.REQUEST_FIELD",'value','value');

above rules works fine when it comes to updating field on the request form.

I am trying to update a first row of a table component though the same method and it doesn't work.

RuleUtil.setField("REQD.T.TABLE.TE=\"1\".P.TABLE_COLUMN", 'value','value');

I don't want to call any procedure or move away from workflow step. I am trying to call JS function before transition and this doesn't work.

Summary - Request Form fields gets updated however table component row/column fields don't.? Any clues how to do it?

 

 

Labels (1)
0 Likes
3 Replies
Micro Focus Expert
Micro Focus Expert

Hi,

Your expression looks correct according to https://admhelp.microfocus.com/ppm/en/latest/Help/Content/RG/CmdTokVal/102200_CmdTokVal_4UseToken.htm ; I assume you can read the TC column field alright, but cannot set it, is it correct?

I'm not sure whether setField( ) works when setting table component fields. 

Does the first row of the TC already exists when you're trying to set the value, or do you have an empty TC when the rule is fired?

0 Likes
Captain Captain
Captain

You are correct. I can't set it.

Does the first row of the TC already exists when you're trying to set the value, or do you have an empty TC when the rule is fired? - [ I have First row exist and saved on the form]

 

0 Likes
Cadet 1st Class
Cadet 1st Class

I cannot help with Table Component question - more research is needed. But in regards to setting Parameter and Visible Parameter using RuleUtil.setField there are two things to keep in mind:

1. If your validation is TEXT, then both parameter and visible parameters will be set to the same value (like in regular PPM operation).

2. If your validation has code and meaning, then all you need is to pass CODE, the meaning will be derived automatically. For example: If my validation has the following values:

code: IN_PROGRESS

meaning: OPEN

Then use: RuleUtil.setField('[TOKEN]', 'IN_PROGRESS', '');

The results will be: parameter will be set to IN_PROGRESS, and visible parameter will be set to OPEN.

 

Hope this helps.

 

Share Knowledge
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.