Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 needs to be a PrimarySDO link from the container to the businessEntity and a Data DISPLAY link from the businessEntity to the form.

The toolbar 'toolbarGo' attribute value should needs to 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 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

  1. Add Dialog using actionType "RUN"

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')'

      2. Add Dialog using actionType "LUNCH"

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

...