Calling a function in UI Action from Script Inlcude without making the SI client callable

charutha
Tera Contributor

Hi ,

How can i call a function in UI Action defined on Script include  without making the script include client callable?

 

I have a script Include which defines one function . And I need to call this function in UI Action.But the requirment is
the Script Incude should not be Client callble and the UI action 'Client' field should be false.

 

From Screen Shot: I need to call 'checkTaskCompletion' function in my UI Action.

 

Also I am aware of the fact that we can use Glide Ajax method to call the function in UI Action, if the Script Include is client callable!


Any help is much appreciated !!Thank you!!

2 ACCEPTED SOLUTIONS

@charutha 

 

Just store the answer in a variable
var response = new demoscriptinclude().checkTaskCompletion() ;
gs.info(response); // check system logs what is the output coming in the variable


Use "response" variable as per your requirement.

Please mark my answer helpful, if it resolved your query.

View solution in original post

@charutha 
As you are using Server side UI action:

var response = new demoscriptinclude().checkTaskCompletion();
gs.info(response);
if (response != '') {
gs.addErrorMessage(response);

}
else {
gs.addErrorMessage('No task are opened');
}

Please use "gs" library, use gs.addErrorMessage OR gs.addInfoMessage

Please mark my answer helpful, if it works for you

View solution in original post

7 REPLIES 7

Prince Arora
Tera Sage
Tera Sage

@charutha 

As mentioned by you the UI action is based on the Server side
You can directly call the function as below:
new Script_Include_Name().Function_Name();

As per our case:

new demoscriptinclude().checkTaskCompletion() will work;

Please let me know if you have any doubts.

Thanks for your response!!

 

But how can get the output of checkTaskCompletion() function in UI Action ?

 

checkTaskCompletion: function() {

return this.supplierManualTaskCompleted() + ',' + this.systemTaskCompleted() + ',' + this.WorkflowTaskCompleted();
}

@charutha 

 

Just store the answer in a variable
var response = new demoscriptinclude().checkTaskCompletion() ;
gs.info(response); // check system logs what is the output coming in the variable


Use "response" variable as per your requirement.

Please mark my answer helpful, if it resolved your query.

The Output is getting reflected on the log .

 

var response = new demoscriptinclude().checkTaskCompletion();
gs.info(response);
if (response != '') {
g_form.addErrorMessage(response);

}
else {

alert('No task are opened');
}

 

charutha_0-1674111600098.png

 

But the error message is not getting displayed in the form while clicking the UI Action.

 

Any suggestion from your side?