![]() bug('Successfully locked opportunity with ID: ' + lr.getId()) įor(Database.Error err : lr. Operation was successful, so get the ID of the record that was processed Opportunity opty = Īpproval.LockResult lrList = Approval.lock(opty, false) Then, select Enable record locking and unlocking in Apex. After enabling development mode, all Visualforce pages display with the development mode footer at the bottom of the browser: Click the tab with the name of the page to open the page editor to view and edit the associated Visualforce markup without having to return to the Setup area. Admin need to enable this feature, from Setup | Create | Workflow & Approvals | Process Automation Settings. Since Winter '16, Salesforce introduce lock() and unlock() methods in the System.Approval namespace. User will get error when save opportunity has been marked as Closed Won previously. But, often this solution will not work well, because the original record owner changed and it is important for reporting, although you can create custom user field to store it.īy using function PRIORVALUE() and ISCHANGED() to detect any changes happened in Closed Won record. This will work well when the OWD sharing setting is Public Read-Only. This will work by change the record owner to a system user in highest role hierarchy. In short, when the opportunity reach Closed Won, with Workflow, change the record type to new record type and assign the new record type with page layout with read-only fields. I cam across some JQuery code that is supposed to allow this to occur. This would be one of the most famous solution without code, but this will make the system more difficult to maintain as the object will have additional record type set and additional page layouts. I am trying to set up my Visualforce page to allow a user to sort any of the pageblockTable columns. Next, drag the Visualforce page from the Visualforce Pages menu under the Data Sources. Options: there are multiple solutions for this, from simple to advance with code: A small amount of data for Visualforce to do housekeeping. This information is then used to build the drop-down menu. The idea is to group Accounts according to industries and then pass this information to the Visualforce page. Use case: make opportunity become read-only when opportunity reach stage Closed Won. To demonstrate how you would use Visualforce, jQuery Minimalect and Apex to build a simple, powerful and user friendly drop-down menu, we will use the standard Account object. For example, to edit the Account from the Contact page, add the custom button or link in Contact: URLFOR() determines your base URL, and the $Action determines what view of a record to go to (the view page, edit page, etc.). Some objects support other additional actions, see all valid actions here. The $Action global variable provides methods such as View, Clone, Edit, and Delete. ![]() ![]() jar file) in a static resource, URLFOR() is a must as a second parameter.Īdmin can make use of URLFOR() function with $Action global variable in custom Button or Link. But when you use the resource in an archive file (such as a. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |