Custom form in menu


#1

In the tutorial there is an example of creating shortcut with “showList” command. I want to create custom list form. How should I register this form? What should I write in the shortcut code to open my custom form?


#2

Short answer:

{
     cmdType: 'showForm',
     entity: 'cdn_currency',
     formCode: 'myForm',
     instanceID: result.resultData.data[0][0]
}

Long answer:

Actually a shortcut command is evaluated (so you can pass a self-executed function there) and result is passed to a UBApp.doCommand method.
showForm command can accept a optional instanceID parameter - in this case adminUI open a form for this instance, if not passed - for will be opened for adding a new record.

Optional parameter formCode can contain a ubm_form.code form code. If missed - adminUI can try to found a default form for a entity.

Any additional parameters, passed in config are acceptable inside the form handlers from this.commandConfig.


#3

To quickly add a command to shortcut press a Ctrl+Q inside a command window and select a template: