Client script dosn't work on workspace ITAM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hello;
Hello i want to auto populate fields on asset form for the assigned to field ; but I have probléme on ITAM Workspace; My client script works on back office normaly but it dosn't working on ITAM Workspace!
Have anyone an idea about this problem please!
Thank you for answering me .
- Client script : on change
- function onChange(control, oldValue, newValue, isLoading, isTemplate) {
- if (isLoading || newValue === '') {
- return;
- }
- var ga1 = new GlideAjax('snowCsdmUtils');
- ga1.addParam('sysparm_name', 'getServiceFromUser');
- ga1.addParam('sysparm_userId', newValue);
- ga1.getXMLAnswer(function(response) {
- var result = response;
- g_form.setValue('u_service', result);
- });
- //----------
- var ga2 = new GlideAjax('snowCsdmUtils');
- ga2.addParam('sysparm_name', 'getDirectionFromUser');
- ga2.addParam('sysparm_userId', newValue);
- ga2.getXMLAnswer(function(response) {
- var result = response;
- g_form.setValue('u_direction', result);
- });
- //---------
- var ga3 = new GlideAjax('snowCsdmUtils');
- ga3.addParam('sysparm_name', 'getSirFromUser');
- ga3.addParam('sysparm_userId', newValue);
- ga3.getXMLAnswer(function(response) {
- var result = response;
- g_form.setValue('u_sir', result);
- });
- }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hello @ahmed-24 ,
Create one more function in the Script Include, which will call internally three functions getServiceFromUser, getDirectionFromUser, getSirFromUser and store this in an array.
From the Client script, call this new function and get the array of these three values.
So, only one GlideAjax.
If the above information helps you, Kindly mark this as Helpful and Accept the solution.
Regards,
Najmuddin