Search

Participate

How to implement Create New In Selectors

In this this module there is an example of a selector with a selector with the 'create new' capability (among other things). All the implementation of this selector is in this changeset.

This module implements a selector called "Business Partner (Add New)" in the "Sales Order" window.

Let's review step by step how this selector has been built, focusing in the steps that this project implements.

Create a new "Business Partner" selector. This is the one where the process will be attached. Here it is an example:

Create a new "Business Partner Category Selector". This will be used inside the process. Here it is an example:

Create the "Business Partner Creation" process. This process will be in charge of:

Handle, in case that exists, the current written value in the selector input or in the selector filters in the popup.

Do the creation of the new "Business Partner" record

Add and select the created "Business Partner" in the selector form item

After the creation of this process, in the previously created "Business Partner" selector, this process should be selected in the "Process for Adding Records" combo box.

Inside the "Business Partner Creation" process, the "On Load Function" will be in charge of handling, in case that exists, the current written content in the selector input or in the selector filters in the popup. This content will be shown in the process form in each corresponding field. Here it is an example:

Here with the "params.getString" the entered values in the form are obtained and then set in the "bp" (Business Partner).
After the instance be saved, the "record" is built and returned, with the "id" as "value" and the "identifier" as "map"
There is also some logic to catch errors and show them as a message.