AppBuilder Function: Create New Form

The AppBuilder Function "Create New Form" enables Users launch the Create new Form page from within an existing Form View.  

 

 The InfoPath AppBuilder Form xsn design needs to incorporate the function. Take an example that user needs to call an Request for Print Order (ROF) form from view of an existing Invitation to Bid (ITB) form.

 

1. Add a Button (E.g. Order Plans ?)  to the Parent form (Source form).

 

2. Create a Data Source  in the Parent Form and Destination (Target form)

 

 

Parent Form Data Source                                                                          Destination Form Data Source

                                                          

 

 

3. Double click on the Button  -> Rules

 

4. Click on Add to add a Rule to the Button.

 

5. Enter the Rule Name "InfoJetSoft.Rules.HtmlOnChange" as shown in the Image.

 

6. Set a Condition as below so that rule executes when the condition is fulfilled

 

 

7.  Click on OK

 

8.  Click on Add Action to add the Java script function.

 

 

       The Java script function example to be written is:

-------------------------------------

function(sender, args){

    prePopulatemapping = new Object();

prePopulatemapping['TOTALMAPPING'] = '4';

prePopulatemapping['SRC1'] = '/my:myFields/my:FORM_CUSTOM_FIELDS/my:Bid_Opportunity/my:ORI_FORMTITLE';

prePopulatemapping['TG1'] = 'ORI_FORMTITLE';

prePopulatemapping['SRC2'] = '/my:myFields/my:FORM_CUSTOM_FIELDS/my:Bid_Opportunity/my:ORI_USERREF';

prePopulatemapping['TG2'] = 'ORI_USERREF';

prePopulatemapping['SRC3'] = '/my:myFields/my:FORM_CUSTOM_FIELDS/my:Bid_Opportunity/my:Bid_Administrator';

prePopulatemapping['TG3'] = 'ITB_ORIG_Data';

prePopulatemapping['SRC4'] = '/my:myFields/my:FORM_CUSTOM_FIELDS/my:Bid_Opportunity/my:Project _Name';

prePopulatemapping['TG4'] = 'Project _Name';

launchCreateForm("ROF");

return false;

}

 -----------------------------------

 

Where

'TOTALMAPPING' is the count of target fields.

'SRC' is the source field xpath,

'TG' is the destination field name,

launchCreateForm("ROF"); where ROF is the Destination AppBuilder Form ID Code

 

9.  Click on OK and save the Rule on the Button.

 

 

Useful Links:

About Custom Forms

Accessing API functions from AppBuilder forms

Manage Form Setting within Project

Create Form