In the present example an SAP material number should be entered in an input field in Nintex Forms and all possible return values for this material number should be listed in a dropdown box. When the desired material is selected in the dropdown box the material long text is supposed to be displayed in another field.
Step 1: Create a SharePoint custom list
The first step is to create a SharePoint custom list, where the form is placed upon. One or two list fields (i.e. Material, Material Number) of type Single line of text can optionally be created.
After creating the list open the Nintex Forms designer for that list.
Step 2: Define the form controls
In our Nintex Form we require three fields with descriptions:
- The first control named Material Number is of type Single Line Textbox. It is the input field for entering the SAP material number. Connect that control to the Material list field created in step one.
- The second control named Suggested Materials is of type Choice. All possible matches for the given material number should be displayed and be selectable here in a dropdown list.
- The third control named Selected Material is of type Single Line Textbox. The material long text for the selected material should be displayed here.
You can create description labels for all three controls.
After that open the settings for the Choice field.
Since this should be only a display field you can also define under Appearance, that the field is only visible but not enabled.
In the JS code, function tEcs.executeXql is called to read the material number and the material long text from SAP table MAKT.
Step 4: Run the Nintex Form
Run the form and enter a material number. The return values are read from SAP table MAKT and displayed in the dropdown list (Suggested Materials).
When you select a material, the material long text should be displayed in the Material field.