Unable to lock the record while record is send for approval process in skuid

Need to do approval process in skuid. I am able to send email on approval process but if record is send for approval i am unable to lock the record. How can i lock the record if record is send for approval process. How can i build locked screen same as salesforce standard functionality in skuid. 

Thanks in advance.

There are a number of ways you can do this.

I’d suggest that you apply conditional rendering to the detail page of your record. You can do that without writing any code…

How to do this?

  1. Create a model that gets the last approval instance, and inclues the status field. In the advanced tab of the model only load 1 record and order by “CreateDate DESC” so that you get the last approval instance record.

  2. Apply conditional rendering to a page title element so that it only shows if that status field is Pending.

In that page title element say somthing like “This is Pending - Do not make changes”

You could also conditionally turn off all the field editors where data can be entered, or replace them with field editors where the data is all in “read only mode”

Just to clarify, Rob’s approach is a way to simulate record locking, however, it is not possible to technically Lock a record using Skuid — Salesforce’s API does not expose the ability to Lock a record the way that they do in their native UI, so it is impossible to recreate this native functionality exactly like salesforce does with any custom development work — not with Visualforce, not with the API. 

So trying to make your Skuid pages behave like the record is Locked, as Rob suggests, is the best idea.

Alternatively you can set the unlock process in setup under approval processes.

Gregg, that is an excellent point! Good call.