- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 09:06 PM
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!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 09:56 PM - edited 01-18-2023 09:57 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2023 12:25 AM
@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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 09:12 PM
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 09:39 PM
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();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 09:56 PM - edited 01-18-2023 09:57 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 11:00 PM
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');
}
But the error message is not getting displayed in the form while clicking the UI Action.
Any suggestion from your side?