Highlighted
Absent Member.. Absent Member..
Absent Member..
295 views

passing a Java script variable into a field in service manager

Hi All,

 

We have a variable value as "Test 1" which displays the value as 50 through Java script , i need to pass this value of Test 1 into an field in service manager, Kindly let me know how to pass the value .

tried the below code and it doesnt work.

record.test1 = field 1

0 Likes
4 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: passing a Java script variable into a field in service manager

where exactly do you want to use this script ?

triggers, ioaction, function in SL (if you write word - "RECORD" - looks like this is a triggers).

0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: passing a Java script variable into a field in service manager

hello,

Also obviously you do understand that in your example test1 should be a real field in the table and not the variable in the script.

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: passing a Java script variable into a field in service manager

Hi Vadim,

 

I have the field test1 created already in the table , Below is my script ..

 

Below is the script :

 

function calculate(record){
var test1= 0;

test1 = (record['field1"]==='Yes') ? test1+ 100 : test1+ 0; 

 

So the value for field 1 is displayed as "100" according to the value selected in the ticket.

 

In triggers i have tried to query as follows by creating a new field in the table .

 

record.test1= lib.script.calculate(record);

 

But it doesnt trigger any value.. please suggest.

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: passing a Java script variable into a field in service manager

may be trigger must be:

record.test1 = (record.field1==='Yes') ? record.test1+ 100 : record.test1+ 0;

 

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.