Dear SAP Experts,
I have a requirement wherein I need a condition ( the Master agreement should have a collborataor with role Endorser) to be validated before I can close or cancel my MA in sourcing, I have tried writing scripts to achieve this fuctionality on different context and targets.
I have written script on Context Document Lifecycle Event and target Pre Publish To SRM , it validates my condition when I click on publish to SRM option from Actions tab but it doesnt validate the condition when I try to cancel or close the documnet (though the changes are' cancel or close' automatically gets publishe to SRM.)
I have written script on context Document Lifecycle Event and target Validated, It also works same way, while I try to publish the MA or cancel MA , it does vaidate the condition but the MA gets canceled at the backend( SRM side).
Can anyone please help me to achieve this functionality of validating a condition before MA is canceled or closed Sourcing ( before it gets closed or canceled in SRM)
I have attached the script code, the code is same for both the scripts.
regards,
Vishal