Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Create workflow to unlock a field

(0) ShareShare
ReportReport
Posted on by 186

How can i create a workflow to unlock a read only field and then lock it again after changes have been done. 

I don't want to go through the process of using form editor unlocking field, publish changes etc

  • Fasil Profile Picture
    Fasil 30 on at
    RE: Create workflow to unlock a field

    Hi,

    Create a Business Rule for the entity and use lock/unlock Components.

    pastedimage1578592236734v1.png

  • Suggested answer
    Paul_Owen Profile Picture
    Paul_Owen 2,027 on at
    RE: Create workflow to unlock a field

    So you want anyone to be able to unlock it who is not admin? If so why have it read only?

    Create a yes/no field called unlock <name of lookup field> and a business rule that if unlock <name of lookup field> = yes unlock ELSE Lock.

    When creating the field enable field level security, add the users who you want to be able to unlock the lookup to the FLS profile (If everyone can theres no need for FLS) then they can just set the field to yes to unlock it and no to lock it, perhaps change the options to Lock/Unlock.

    Regards

    Paul

  • RE: Create workflow to unlock a field

    Again, one cannot affect the client from the server.  You could make a second form where the field is not read only.  To provide this user interaction you are seeking you could develop a button to execute javascript perform your task and reverse it onChange or onSave.

    Of course, if you are allowing folks to edit it, why is it read only in the first place?

  • r4vvm Profile Picture
    r4vvm 186 on at
    RE: Create workflow to unlock a field

    The lookup field is ready only on the form currently and it is blank, i wanted to create a workflow that will make it editable so that i can update it with the correct data and then lock it again. 

    I wanted to create a workflow that non-admin users who do not have access to form view can run to unlock the field populate with the correct data and then lock the field again. 

    hope this makes sense

  • RE: Create workflow to unlock a field

    Paul is correct.  Plugin assemblies and workflows are server-side.  To dynamically affect the user experience you must stay client side.  Use javascript (webresource) or business rule (PowerApp form developer)

    Secondly, a field on a form doesn't need to be unlocked to perform updates.  Form settings only control the human user.  Both client and server-side programming can set/change values on locked fields.  Here's a bad example, create an order.  The order number is a read-only field and yet the value gets autogenerated and filled in on save.

  • erhan.keskin Profile Picture
    erhan.keskin 2,253 on at
    RE: Create workflow to unlock a field

    I think the field is read-only on the form and you want to populate that field with something in WF (maybe dynamic value or static value, no matters), that is why you need to make it editable for a short time.

    If this is the case then,

    - make the field editable on the form

    - go to the WF and do what you need to do with that field

    - and come back to the form and make it read-only again and publish

    Regards,

  • Paul_Owen Profile Picture
    Paul_Owen 2,027 on at
    RE: Create workflow to unlock a field

    Are you saying the field is blank but when it contains data you want to make it uneditible? If so you can lock the field using a business rule.

    Regards

    Paul

  • Suggested answer
    gdas Profile Picture
    gdas 50,089 on at
    RE: Create workflow to unlock a field

    Yes , this is the only way to unlock  from UI only. Please note if a field is read only in UI , you can update , create records with that filed  using SDK method call, plugin , workflow or from other source.

  • r4vvm Profile Picture
    r4vvm 186 on at
    RE: Create workflow to unlock a field

    So they only way to unlock the field is going through form view and un tick as read only then publish? 

  • gdas Profile Picture
    gdas 50,089 on at
    RE: Create workflow to unlock a field

    You don't have to unlock any field while update through workflow . As workflow process run in server side you can able to update field using workflow.  Read-only field mean only you can not update from UI.

    Also could you please share business scenario which you are trying to implement.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,407 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans