- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2019 02:59 AM
Hi,
I have two forms as mentioned below
1. SIM
2.Company phone
I have return the below client script to populate assigned to information from company phone table in SIM form, when phone number field is populated and it is working fine.
I want the help for little additional thing, that is this client script should work only when both SIM and Company phone number is active.
The field is Active (u_active). How do i do it?
Client script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
var lp = new GlideAjax('Displaysimassignedto');
lp.addParam('sysparm_name','simassignee');
lp.addParam('sysparm_simdetails',g_form.getValue('u_associated_phone_number'));
lp.getXML(assignees);
function assignees(response)
{
var answer = response.responseXML.documentElement.getAttribute("answer");
g_form.setValue("u_assign", answer);
}
}
Solved! Go to Solution.
- Labels:
-
flow designer
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2019 03:39 AM
I just noticed that in the last script i gave you i wrote if(g_form.getValue('u_active')=='false') while it should be if(g_form.getValue('u_active')==true)
Can you check if you used true or false in the if condition?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2019 05:05 AM
USe this
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
alert(g_form.getValue('u_active'));
if(g_form.getValue('u_active'))
{
var lp = new GlideAjax('Displaysimassignedto');
lp.addParam('sysparm_name','simassignee');
lp.addParam('sysparm_simdetails',g_form.getValue('u_associated_phone_number'));
lp.getXML(assignees);
}
}
function assignees(response)
{
var answer = response.responseXML.documentElement.getAttribute("answer");
g_form.setValue("u_assign", answer);
}
}
I have added an alert, check its value also when you run this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2019 05:37 AM
no sir it don't check the condition of active and inactive, it populates on every record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2019 05:09 AM
add the alert as i suggested and then check it. Script i gave above has the alert in it. did you run it?
And call me Anurag 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2019 11:35 PM
Yes Anurag, i did all the possibilities still it populates the information even if the record is inactive.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2019 02:13 AM
What do you get when you use this on the form?
alert(g_form.getValue('u_active'));