- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2018 09:44 AM
Hello all,
I am creating a catalog item and the first question is "Are you opening this request on behalf of someone else?" if they select No then I want the catalog client scripts to trigger because it'll prepopulate the other fields with first name, last name, employee id, etc. If they select Yes I do not want the client scripts to trigger because the user should fill out those fields manually.
Are conditions on catalog client scripts possible or would anyone recommend another best practice for this scenario?
Thanks in advance,
Grace
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2018 03:21 PM
Can you try this if your issue not solved yet.
I assume OPENED_BY field is there on catalog item and it already have the current user's record
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var request_behalf = g_form.getValue('request_behalf');
if(request_behalf == 'request_no'){
g_form.setValue('first_name', g_user.firstName);
g_form.setValue('last_name', g_user.lastName);
var emp = g_form.getReference('opened_by', setEmpID);
}
else
return;
}
function setEmpID(emp){
g_form.setValue('empid', emp.employee_number);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2018 09:54 AM
if (<reply>=="No")
return false;
That should work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2018 10:21 AM
Is this in addition to what Kumar suggested above?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2018 10:29 AM
That is correct, in addition to what is suggested above.