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

  • 1
  • Question
  • Updated 4 years ago
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.
Photo of Robin

Robin

  • 270 Points 250 badge 2x thumb

Posted 4 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
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" 
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
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.
Photo of Gregg Baxter

Gregg Baxter, Official Rep

  • 3,080 Points 3k badge 2x thumb
Alternatively you can set the unlock process in setup under approval processes.
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Gregg, that is an excellent point! Good call.