Vlocity Facts #32 || Edit Block for Default Actions in OmniScript
An Edit Block element in Omniscript allows the user to create, edit, and delete multiple records. To accomplish this, the edit blocks are repeatable blocks by default. We can configure Edit Block in 3 Ways
- Adding Default Actions
- Adding Custom Actions
- Adding Global Actions
Adding Default Actions Let us see an example to use an Edit Block in Omniscript to handle multiple records.
In our example, we will use an Edit Block to display the existing Cases linked to an Account and Contact also edit cases directly from the Edit Block.
‘Edit’ Remote Action: This updates an existing record from the Edit Block.
Name: Cases-Edit
Remote Class: DefaultOmniscriptEditBlock
Remote Method: edit. This points to the ‘edit’ method in the ‘DefaultOmniscriptEditBlock’ apex class to update an existing record from the Edit Block.
Now click ‘Add SObject Field Mapping’ and map the edit block elements to the corresponding field in the SObject.
OutPut:
Same way we can configure other 2 actions New and delete.
For New Action follow these steps.Drag one more Remote Action into edit block and name it according to your requirement.Name: Cases-New
Field Label: New
Remote Class: DefaultOmniscriptNewBlock
Remote Method: new. This points to the ‘new’ method in the ‘DefaultOmniscriptNewBlock’ apex class to update an existing record from the Edit Block.
Name: Cases-New
Field Label: New
Remote Class: DefaultOmniscriptNewBlock
Remote Method: new. This points to the ‘new’ method in the ‘DefaultOmniscriptNewBlock’ apex class to update an existing record from the Edit Block.
For Delete Action follow these steps.Drag one more Remote Action into edit block and name it according to your requirement.Name: Cases-Delete
Field Label: Delete
Remote Class: DefaultOmniscriptDeleteBlock
Remote Method: delete. This points to the ‘delete’ method in the ‘DefaultOmniscripDeleteBlock’ apex class to update an existing record from the Edit Block.
Name: Cases-Delete
Field Label: Delete
Remote Class: DefaultOmniscriptDeleteBlock
Remote Method: delete. This points to the ‘delete’ method in the ‘DefaultOmniscripDeleteBlock’ apex class to update an existing record from the Edit Block.
Comments
Post a Comment