Form - How to make fields editable or uneditable based on a condition


Badge +10

I have an edit form based on a SharePoint list. Workflow may send it back to submitter for corrections or edit form can be used by approvers to update only certain fields. Approvers are allowed to update only one field while submitter can change few other fields.

 

I set properties on view but they are applicable to all the users. I am trying to change behavior based on user.

 

My question is.. how can I make fields editable or uneditable based on user on edit form?

 

Thanks


2 replies

Userlevel 2
Badge +9

Hello,


 


You can accomplish this using an 'Advanced Condition' on the form, having a separate state for the form, and also just having two forms, one for each client event.


 


Using the advanced condition you can set something such as this:


12713i6E2F517C1F05F322.png


You can get the current user's display name from the System Values category in the context browser. Click on current user and there are a variety of fields to choose from.


 


Once we have specified that if the user accessing the form is 'Carl Sagan' we can then change which controls can be editable through the 'Specify edit state for View and Form controls' action. 


 


13692i82418C8A4352841A.png


 


I think your best option would be to create a separate state to be used when a submitter is viewing as well as when an approver is viewing the form. You can set the form state in the workflow wizard from a smartforms client event. See below:


 


11313i3B4928B520DF0BED.png


 


Now in K2 Designer for the smartforms you can choose which controls are editable with the 'Specify edit state for View and Form controls' action. Or you can even set some controls to datalabels so they can only be populated with the data instead of being a text box or another form of editable control.


 


Of course you can always make two copies of the form, one to use in the reviewer step and another to use for when the item is with the submitter.


 


Hope that helps!


 


Evan

Badge +10

Thanks Evan! I haven't explored form "state" yet. I will look into it. Thanks again!

Reply