Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

 


1. How to Design the Screen

Open the Layout Designer and and first create a new SimpleSwatDialog. Then open the newly created dialog in the Layout Designer and add your BusinessEntity, a form and a toolbar for saving.
There should be a PrimarySDO link from the container to the businessEntity and a Data link from the businessEntity to the form.

The toolbar 'toolbarGo' attribute value should be set to '$ crm.saveNewRecord(self);'.
When calling this method(on toolbar check mark button click) the saving of the newly created record
will be performed and if the saving was successful, it will also close the add dialog.
You could also specify the repository object name used for loading/opening the newly created record as the second paramenter to the saveNewRecord method:
'$ crm.saveNewRecord(self, 'openUserDialog');'. This will use the given repository name to open the newly created record in its own screen.

The BusinessEntity from the Add Dialog needs to have the "initialFetch" attribute set to "#none".
This will prevent the businessEntity from fetching the data when loading the Add Dialog screen.


2. How to include the Add Dialog

To open the new Add dialog from a button(eg. fab button), you would need to set up a new MenuStructure with a new MenuFunction.
That MenuFunction can be of type RUN and with the ActionParameter of the MenuFunction set to '$ crm.openNewRecordDialog(self, 'createUserDialog')'

Alternatively you can use the MenuFunction ActionOptions to set the 'autoAdd' option to true. 
if "actionType" is LAUNCH then "actionOptions" can be a string representation of a JSON object,
options that will be parsed when loading the new repository object, for eg.:

MenuFunction will have:

Action Type:
LAUNCH

Action Parameter:
createUserDialog

Action Options:
{ 'autoAdd': true, 'pages': '0,2' }

  • No labels