Skip to main content

Notifications

Community site session details

Community site session details

Session Id : JeYVNeXFxiw2D9YNhrmVc4
Power Apps - Microsoft Dataverse
Answered

Real world usage of Prevalidation plugin

Like (0) ShareShare
ReportReport
Posted on 18 Jan 2022 15:51:00 by 971

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

Categories:
  • Verified answer
    Bipin D365 Profile Picture
    971 on 19 Jan 2022 at 12:09:35
    Re: Real world usage of Prevalidation plugin

    Hello,

     

    I have registered my plugin on Pre-validation stage and I was able to retrieve child records and perform calculations.

     

    Thanks,

    Bipin

  • Bipin D365 Profile Picture
    971 on 19 Jan 2022 at 08:53:00
    Re: Real world usage of Prevalidation plugin

    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

  • Verified answer
    Ram Prakash Profile Picture
    5,166 Super User 2025 Season 1 on 19 Jan 2022 at 05:30:57
    Re: Real world usage of Prevalidation plugin

    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

     

    Subscribehttps://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA

    Blog : https://microsoftcrmtechie.blogspot.com

  • Bipin D365 Profile Picture
    971 on 19 Jan 2022 at 03:54:41
    Re: Real world usage of Prevalidation plugin

    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

  • Ram Prakash Profile Picture
    5,166 Super User 2025 Season 1 on 18 Jan 2022 at 16:15:10
    Re: Real world usage of Prevalidation plugin

    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

     

    Subscribehttps://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA

    Blog : https://microsoftcrmtechie.blogspot.com

  • Bipin D365 Profile Picture
    971 on 18 Jan 2022 at 16:09:32
    Re: Real world usage of Prevalidation plugin

    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

  • Ram Prakash Profile Picture
    5,166 Super User 2025 Season 1 on 18 Jan 2022 at 15:59:55
    Re: Real world usage of Prevalidation plugin

    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

     

    Subscribehttps://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA

    Blog : https://microsoftcrmtechie.blogspot.com

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Microsoft Dataverse

Overall leaderboard

Featured topics