Launch Other Forms

LaunchOtherForms.nitro_s

Sometimes you may want to launch another form from within your form.  I have created an example that demonstrates how to do this.  You can either hard-code the link, or you can make it dynamic.  The format of the link is:

http://<server:port>/forms/landing/org/app/<app id>/launch/index.html?form=<form id>

or a specific record:

http://<server:port>/forms/landing/org/app/<app id>/launch/index.html?form=<form id>&id=<rec_id>



The app id can be found on the manage panel
The form id can be found on the advanced tab of the form properties.

The record id can be pulled by javascript:

BO.getDataId();

 When you import the application, make sure you choose "Deploy" and "Import Data" so that the application will continue to work as it was posted.

 The code for the dynamic links looks like:

if(item.getSelection() !== null) {
  item.getPage().F_StaticWebLink2.setLinkValue(BO.F_ServerURL.getValue() + '/forms/secure/1/app/b5806ef1-b784-4c85-8844-653cd4064201/launch/index.html?form=F_FormA&id=' + item.getSelection().F_SingleLine.getValue());
  item.getPage().F_StaticWebLink2.setDisplayValue(item.getSelection().F_SingleLine.getValue());
}

and is located in the onClick of the table and the onItemChange of the dropdown.  If you breakdown what we are doing...we are building the URL from the server field, and the form id that the user selected (either in the table or in the dropdown).


Portal

Let's say you are using the Leap Portlet, well you can also cause the portlet to launch a new form, from within another form!  We can do this using Wires.  I have updated this example to contain a button for loading the form within the portlet.  There are a few things you have to do before you can test this behavior.

Create Portal Wire

1. Login to portal
2. Select Administration...Portal User Interface...Manage Pages
3. Click the Edit Page Layout button for the page the contains the Leap portlet.
4. Click the Wires tab.
5. Select "Consider semantic types...

6. Select the following options

7. Click the "+" Button to add the wire.

Once the wire is setup you can load the form in the portlet and click the button to open a new form.  The button itself just uses a variation of the above that looks like:

form.sendData(BO.F_ServerURL.getValue() + "/forms/secure/org/app/b5806ef1-b784-4c85-8844-653cd4064201/launch/index.html?form=F_FormA");


This will trigger a portal event and it sends the URL of the form I want to open.  All Form URLs follow the same format:

/forms/secure/org/app/<appID>/launch/index.html?form=<formID>