Skip to main content
Question

Facing Error after writting the client script while executing it

  • March 23, 2022
  • 1 reply
  • 97 views

Forum|alt.badge.img+1

Hello Everyone,

I have got a requirement for the request screen . The Requirement is When request status is completed --> sub status should only allow approved and other requirement is When request status is approved --> it should only allow billed.

so for the above requirement i tried to write the client script but while running client script I am facing an error so i am going to paste my client script code and error image below

 

Client script code:

showProgressIndicator();
var reqStatus1 = getControlValue('request','REQ_STATUS');

var emptyOptions = [];
var options = createCodeTableOption('','');
arrayPush(emptyOptions, options);
setControlOptions('request', 'req_category', emptyOptions);

if(reqStatus1 == 'COMPLETE') 
{
    var opt1 = [];
    arrayPush(opt1, createCodeTableOption('APPROVED','Approved'));
    setControlOptions('request', 'req_category', opt1);

else 
{
    var opt2 = [];
    arrayPush(opt2, createCodeTableOption('BILLED','Billed'));
    setControlOptions('request', 'req_category', opt2);
}
hideProgressIndicator();

 

This topic has been closed for replies.

1 reply

Atheeq Maharoof
Superhero (Employee)
Forum|alt.badge.img+12

Hi @Shashank ,

As per my understanding, the editor in the client script screen will allow specific set of functions to be executed. 

 

Client script editor

In this scenario, the function in line 1 will be throwing the error since it is not executable in the client script editor but the function in the line 2 will be executed (you can comment each line and observe the behavior). 

Try to add this script to a screen in web client and observe the behavior. Following thread explains the process in a detailed manner.

 

https://community.ifs.com/ifs-field-service-management-fsm-employees-partners-only-103/how-to-hide-values-from-dropdown-15819


Hope this answer helps.

Best Regards,
Atheeq


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings