On deleting row from MRV run catalog client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 04:33 AM
Hi,
While adding row in MRV or deleting by using 'x' or 'Remove All' I want to execute MRV catalog client and make the variable in the catalog item mandatory/non mandatory.
scenario:
1. if value entered in MRV matches criteria and the variable in catalog is made mandatory, then on removing this particular MRV value should non mandate the variable.
2. if value entered in MRV does not match criteria then make catalog variable non mandate. and on adding valid mrv value should mandate the catalog variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 05:05 AM
Hello @sravanip ,
Please check out this link which will help you.
Thank you,
Omkar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 08:32 AM
Hey there @sravanip
Write a catalog client script that will be triggered when adding or removing a row in the MRV.
Define the criteria that determine whether the variable should be mandatory or non-mandatory based on the value entered in the MRV.
In the catalog client script, implement the logic to check the value entered in the MRV against the defined criteria. If the criteria are met, make the variable mandatory; otherwise, make it non-mandatory.
Bind the catalog client script to the MRV field events such as onAddRow and onRemoveRow.
update the state of the variable in the catalog item to reflect whether it should be mandatory or non-mandatory.
sample catalog client script below
function onAddRow() {
if (valueMatchesCriteria) {
g_form.setMandatory('variable_name', true);
} else {
g_form.setMandatory('variable_name', false);
}
}
function onRemoveRow() {
}
If this helps kindly accept the res[ponse thanks much.
Kind Regards,
Mohamed Azarudeen Z
Developer @ KPMG
Microsoft MVP (AI Services), India
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 01:09 AM
I already have code in place when we add row through 'Add' button. but the issue is how to detect delete row using 'x'. This action is not calling the client script I wrote in the MRV.