web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

How to make row non-editable with workflow

(0) ShareShare
ReportReport
Posted on by 3,039

Hi,

I have created custom workflow and now I want, when I will submit my workflow request that row should be non-editable. How I can achieve this?

I have the same question (0)
  • Gunjan Bhattachayya Profile Picture
    35,417 on at
    RE: How to make row non-editable with workflow

    Could you please share your code?

  • Pooja Karki Profile Picture
    3,039 on at
    RE: How to make row non-editable with workflow

    i tried this and it is making my whole table as non-editable not a particular row.

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,417 on at
    RE: How to make row non-editable with workflow

    Hi Pooja,

    If you go into the methods called, you can see the logic. To simplify this, you can take a look at editAllowed method in Tables\PurchTable. This method checks if the PurchTable record DocumentState is "In review" and returns false if it is.

    You can try something similar for your table. This is a sample code you can try this the data source active method

    int  active()
    {
        boolean editRecord = true;
    
        if (table1.WorkflowStatus == WorkflowStatus::InReview)
        {
            editRecord = false;
        }
        
        table1_ds.allowEdit(editRecord);
        
        ret = super()
    }

  • Pooja Karki Profile Picture
    3,039 on at
    RE: How to make row non-editable with workflow

    I have also checked this code but not able to understand, if you can provide me any sample code that will be very helpful. Thanks

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,417 on at
    RE: How to make row non-editable with workflow

    Hi Pooja,

    You can achieve this by using the data source > active method. You can check for the state of the workflow (based on the status field) and can set the allowEdit property of the data source based on that.

    You can check PurchTable form as an example. The highlighted method checks if the workflow is in submitted state and sets the record to be non-editable.

    pastedimage1612607998426v1.png

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

Product updates

Dynamics 365 release plans