How to link one process model to two record list actions?

Certified Associate Developer

Hi Community Members,

Currently a site page has one button (record list action). The record list action linked to process model "A". "A " will open a form and there is a drop down list in the form and some other fields to complete.

Now a new required feature is users want a new button (record list action) that linked to the same process model (will open the same start form). But this time in the form, the drop down list has a new item and this new item is auto-selected by the new button, then the user just need to fill the rest fields.

To achieve this, I plan to add the new item to the drop down list and add a new button (record list action) linking the same process model, then somehow make the new item auto-selected.

However I noticed for the new button (record list action), when linking the same process model, that process model is not listed in the search list. Is it because the process model can only be linked to one record list action? I didn't see the documentation mentioning this limitation.

How to solve this issue? or any other better ways to achieve the new feature? 

Thanks.

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    Hi,

    It seems that once the process model is used for a record action, then the same cannot be used for another record action. However, it allows you to pick the same one again for the related action.

    Coming back to your scenario, you can handle it within the form (interface) itself. On the click of a new button, update the drop-down's parameters (such as choice labels, choice values, value) with the expected value and even other fields with the help of the 'showWhen' parameter. 

    Refer to the sample UI below for your reference:

    a!localVariables(
      local!showNewfields: false(),
      local!oldFields: { "Option 1", "Option 2", "Option 3" },
      local!newFields: { "Option 4", "Option 5", "Option 6" },
      local!selectedOldField,
      local!selectedNewField: "Option 4",
      {
        a!dropdownField(
          choiceLabels: if(
            local!showNewfields,
            local!newFields,
            local!oldFields
          ),
          choiceValues: if(
            local!showNewfields,
            local!newFields,
            local!oldFields
          ),
          label: "Dropdown",
          labelPosition: "ABOVE",
          placeholder: "--- Select a Value ---",
          saveInto: {},
          searchDisplay: "AUTO",
          validations: {},
          value: if(
            local!showNewfields,
            local!selectedNewField,
            local!selectedOldField
          )
        ),
        a!buttonArrayLayout(
          buttons: {
            a!buttonWidget(
              label: if(
                local!showNewfields,
                "Return to Old Form",
                "New Form"
              ),
              style: "OUTLINE",
              saveInto: {
                a!save(
                  local!showNewfields,
                  not(local!showNewfields)
                )/*Add showWhen conf for other fields*/
                
              }
            )
          },
          align: "START",
          marginBelow: "NONE"
        )
      }
    )

  • 0
    Certified Senior Developer
    in reply to Mathurambika M

    We can't pass Context (Parameters) for Record actions . My suggestion is instead of using record action field in Parent UI, use Start process link and the above interface design Pattern for Start Form.

  • 0
    Certified Lead Developer

    Both options mentioned above will work. (the dynamic form controlled by showWhen or a startProcessLink).

    The advantage of the showWhen is that you can keep the button. The advantage of the startProcessLink is that you don't have to make many changes to your implementation (but it will be a link).