I need to delete some records related to the current record when it is deactivated. I can get the the event when the record is deactivated but I have looked around for some time on Google and this site for the code to delete records in javascript but I can’t find any, though I know there must be some out there.
Can anyone help?
Thanks
You can register a plugin on the
SetStateandSetStateDynamicmessages (recommend the Pre event in your scenario). Each of these messages will pass anEntityMonikerin theInputParametersproperty bag which refers to the record that is being deactivated.In your code you will need to:
EntityMonikerfromIPluginExecutionContext.InputParametersSetStatetransaction to complete