Add more button in form

Hi Guys,
I have created a entitlement form and I want to include add more button to it. so, I have created two next buttons(submit, Add more)in the form. While clicking on add more a step in the workflow has to get trigger and collect the data and again transit to same page.
There are two things I want to know
1.How can we trigger two next buttons differently
2.The Add more button Approach is going to work
Can any one please help me with it.

<Variable input="true" name="entitlementList"/>
<Step icon="default" name="AccumulateEntitlement" posX="28" posY="10" resultVariable="entitlementList">
    <Script>
      <Source>  
	  List list=workflow.get("entitlementList");
	  if(list == null){
	  list=new ArrayList();
	  }
HashMap data = new HashMap();
data.put("entitlementName",);
data.put("entitlementDescription",)
data.put("entitlementowner",);
data.put("entitlementisprivilaged",);
data.put("entitlementl2approver",);
data.put("entitlementCategory",);
data.put("entitlementl3approver",);

list.add(data);
workflow.put("entitlementList",list);

return model;
      </Source>
    </Script>
    <Transition to="Create Entitlement"/>
  </Step>

Hi @Chiru1307 ,

can you please share your workflow and form, show that we could verify your code and suggest accordingly.

For an Custom Action Button:

If you want a button that performs a custom action (without submitting the form), use type="button":


<Field name="customButton" displayName="Click Me" type="button">
  <Attributes>
    <Map>
      <entry key="buttonLabel">
        <value>Click Me</value>
      </entry>
      <entry key="onClick">
        <value>
          <Script>
            <Source>
              // Your custom logic here
            log.debug("Button clicked!");
            </Source>
          </Script>
        </value>
      </entry>
    </Map>
  </Attributes>
</Field>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.