Highlighted
Absent Member.. Absent Member..
Absent Member..
410 views

Request Fulfillment Additional Property Validation Of Another Additional Property

Hello, We are currently converting services from Request Management to Request Fulfillment. In Request Fulfillment > Configuration > Request Models, search for desired model, Task Information > Edit > Additional Properties, I have 2 configured, CostCenter and NewCostCenter. Id CostCenter has a label of a question with a dropdown of values of Yes or No. NewCostCenter is a String. In the validation of NewCostCenter, I want to put in a validation on closure, that if CostCenter == "Yes", NewCostCenter must have a value. Here is the JS we have in place:

if (vars.$L_file.current_phase=="Closure"){
if (value==null||value==""){
if(vars.$L_file.CostCenter=="Yes"){
  result.setValue(1);
  message.setValue("Please Enter a  New Cost Center");
  print(message.getValue());
}
}
}

This is not working. If I remove the line vars.$L_file.CostCenter and it's associated close brace, the script works. When I test the variables in the client with RAD Debugger, "d CostCenter in $L.file", get value is null. Same with NewCostCenter. I pull up the record and do a ctrl-H to see the name of the fields, $tempOutput and same if I open properties, and click either field, the input is var/tempOutput. If I do "d $tempOutput", I get this:

<form><select id="CostCenter" inputtype="3" label="Mobile Device Cost Center Update?" style="combo">Yes<option label="No">No</option><option label="Yes">Yes</option></select><text id="NewCostCenter" inputtype="3" label="New Cost Center">asdf</text></form>

This tells me the data is present, I am hoping that I can access CostCenter from NewCostCenter in the validation script and decision from there.  Can anyone help me write this line?

0 Likes
1 Reply
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Request Fulfillment Additional Property Validation Of Another Additional Property

I believe the problem is that CostCenter and NewCostCenter - even they are additional properties - they are not added to requestTask table. They're virtual fields - pretty much same than Catalog's User Selections are. Basically XML.

Therefore you can't validate those by referring to table's fields like $L.file. Some code is needed to retrieve the values from XML, but there are some builtin functions available.

Please see table svcCatInterface (Open New Request) and it's Expressions page to see how the values are extracted from the XML.

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