Trigger before launching status-page

Posted by smartsysISV on 05-Dec-2013 02:33

I have a locked record. This record has an active wf-handling. This wf-handling have to unlock the record before launching the status-page, because this status-page have som editable fields. But how can i unlock the record before launcing the status-page? I don't have a trigger "before" this wf-handling.

Posted by sidury on 06-Dec-2013 13:28

Hello,

Locked record is not supposed to have any handling. Please use server-side: set field API to remove lock

Hope this helps.

Posted by cgontla1 on 07-Jan-2014 05:12

We can unlock record before launching status page using browser/client side API.

Steps:

-> Go to Object Definition page and click on Buttons tab and Click on New Button.

-> Provide value for 'Display Label' field and select 'Run client-side JavaScript' radio button.

-> Provide following code to Button Script text area.

rbf_setField("teammember", {!id}, "isLocked", false, false);

-> Select All pages checkbox inorder to show this button in every page and Save it.

-> Goto Status/View page of locked record. The newly created button would be available there. Click on that button.

-> Refresh the page.

Note: setField() method will update the value in backend but it takes time to update the UI presentation.( This point is documented). So, we need refresh here.

-> Observe that record is getting unlocked. Then, we can update fields along with status change.

All Replies

Posted by sidury on 06-Dec-2013 13:28

Hello,

Locked record is not supposed to have any handling. Please use server-side: set field API to remove lock

Hope this helps.

Posted by smartsysISV on 11-Dec-2013 05:12

The server-side API set field is used (in a wf-handling) but I can't find a way to unlock before i start the wf-handling.

I should have been like this in one wf-handling:

- unlock record

- start wf-handling with status-page

I have to use two wf-handling and this give the user the possibility to only start the unlock.

The record will then be in an error-state.

Posted by cgontla1 on 07-Jan-2014 05:12

We can unlock record before launching status page using browser/client side API.

Steps:

-> Go to Object Definition page and click on Buttons tab and Click on New Button.

-> Provide value for 'Display Label' field and select 'Run client-side JavaScript' radio button.

-> Provide following code to Button Script text area.

rbf_setField("teammember", {!id}, "isLocked", false, false);

-> Select All pages checkbox inorder to show this button in every page and Save it.

-> Goto Status/View page of locked record. The newly created button would be available there. Click on that button.

-> Refresh the page.

Note: setField() method will update the value in backend but it takes time to update the UI presentation.( This point is documented). So, we need refresh here.

-> Observe that record is getting unlocked. Then, we can update fields along with status change.

Posted by smartsysISV on 16-Jan-2014 06:23

This is OK, but then the user have to click two times to get one action. Ex:

- Unlock record (Ex. your example)

- Start Workflow-handling with launching a (Status)-page

If we could get a "Trigger before" when defining workflow-actions, we could have this done in one user-handling:

- Start Workflow-handling with this included::

       1) Run "Trigger before" defined - Unlock Record

       2) Lanuch status-page defined

       3) Run "Trigger After" defines --> Ex. Lock record.

We do miss the opportunity to define "Triggers Before", but we have the opportunity to define "Triggers After".

I will put this in the "Ideas"

This thread is closed