how to fetch or get removed value from list collector variable in catalog client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2023 10:32 AM
Hi All,
i am trying to fetch the removed value from a list collector in catalog client script
Tried with on change client script oldValue but its showing always empty.
Is there any other way to fetch the details please provide the solution.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2023 10:42 AM - edited 08-15-2023 10:43 AM
Hi @srikriti ,
OldValue Would not help here, as it store the value of the field which Is at the time of loading of the form.
Can you exactly tell, what are you trying to fetch, is it the temporary last selection made in the field(Not saved/submitted) or something else?
Thanks and Regards,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2023 10:49 AM - edited 08-15-2023 10:51 AM
yes the temporary last selection made in the field(Not saved/submitted) value
because
on catalog form i want to use removed value
some dependency on old value is there
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2023 11:52 AM
Hi @srikriti
Got it,
You can create a variable previousValue and everytime, save a last value in that variable.
Refer the script below:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading) {
return;
}
var previousValue;
if (g_scratchpad.previousValue == undefined){
previousValue = oldValue;
}
else{
previousValue = g_scratchpad.previousValue;
}
g_scratchpad.previousValue = newValue;
}
Hope this might solve your problem!
Thanks and Regards,
Rahul