Hello experts,
I am looking for a real world use case of using Pre-validation plugin.
I know below things about pre-validation plugin from docs page but I would like to know more about this plugin usage -
1. Runs outside the database transaction
2. Executes before security role check
3. First stage in the plugin execution pipeline.
Thanks,
Bipin
Hello,
I have registered my plugin on Pre-validation stage and I was able to retrieve child records and perform calculations.
Thanks,
Bipin
Hi @rampprakash ,
Thanks for your reply.
I can not use Restrict Delete in my case. I want my child records to be deleted from teh system when parent record is deleted. But I would also like to perform some logic to deduct values from another field from child records.
How can we achieve this?
I tried registering plugin on Pre-operation but when we retrieve child records from plugin it returns zero record.
I will try registering in Pre-validation stage and let you know my findings.
Thanks,
Bipin
Hello @bipinshan,
But this is not a Real time use case, its a Reference in the Relationship. Not sure what you are expecting dude. Because the Initial Question is - What is the Use of PREVALIDATION Plugin.
To Answer your Question, If you want to Perform such Kind of Operation, USE RESTRICT DELETE if CHILD RECORDS available, user can manually reassign the records and proceed further.
Please mark as Answer if it is helpful and provide Kudos
Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Hi @rampprakash ,
I found below interesting article which talks about usage of Pre-validation plugin
https://nishantrana.me/2018/11/05/plugin-on-pre-validation-stage-in-dynamics-365-ce/
Question - If I delete account record and requirement is to perform some logic based on related child records of account which has relationship behaviour set to cascade All, where do I need to register my plugin ?
I know post operation plugin will not have any details of related record, those will already be deleted from the system.
I want to know if I can register on Pre-operation?
Thanks,
Bipin
Hello @bipinshan,
That depends on the Use Case 🙂 and i didn't tried your scinario 🙂 Lets wait for others comments too
Please mark as Answer if it is helpful and provide Kudos
Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Hi @rampprakash ,
really appreciate your response.
I am looking for a real project use case of adding the code on this stage.
One thing which I know is - When you create any record in this stage and subsequent plugin stages failes the records created in pre-validation stage will not be rolled back and it will still be present in the system.
Thanks,
Bipin
Hello @bipinshan,
PreValidation will only trigger in Stage Number : 10 and It will Run only in SYNC mode.
Please mark as Answer if it is helpful and provide Kudos
Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA