- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi all,
iam stuck with the below requirement can anyone please help me out.
There is a custom table named "u_cost_manage" in that table there are three custom fields.
Supplier (reference) field, branch string field, and partner choice box (True/false)
Below is the requirement in a catalog item,
We have a list collector variable named "Branch" list collector, if the branch records are selected then if one of the records has partner as true, then we need to mark the Trusted partner variable select box (True/false) as true else it should be false.
Below is the client script i have tried.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi all,
Thanks all for your responses. i updated the script as shown below and its working as expected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Balaram7
Try this one-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @Balaram7 ,
I will recommend try using g_form.getValue instead of newValue on a List Collector, it returns a string of Sys IDs separated by commas ("sys_id1,sys_id2"). This is exactly what the IN operator in the Script Include needs.
If still doesn't work where are you stuck or what's the issue coming send screenshot..
If my response helped mark as helpful and accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @Balaram7 ,
I can see your script can you please try add alert method
e.g.
alert(answer) : check what it's returning
and instead of using newValue in second parameter use g_form.getValue('your field backendName');
and this one also try to make it in alert('');
// here you can use g_form.getValue('your field backend name');
var a=g_form.getValue('field Name');
alert(a); // check what is coming
// try this
alert(answer);
g_form.setValue('trusted_partner',answer);
If my response helped mark as helpful and accept the solution.
Regards,
Akash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @Balaram7 ,
List collector give value like val1,val2,val3 in comma separated string , and you have to check whether each branch is trusted or not so you can first convert string value into array format using stringVariable.split(',') method and then send each value in your glideAjax using for loop then you can get your required response true or false , once get true then break the for loop and update that trusted partner checkbox as true .
You can refer code suggested by @Tanushree Maiti but just break the loop once response get true .
If this helps you then mark it as helpful and accept as solution.
Regards,
Aditya
