Using Custom Fields

Creating Custom Fields is very easy with IBM® webMethods Integration. Using the Custom Field functionality, you add new custom data fields. A custom data field can be a String, Integer, Float, Double, Long, Boolean, Short, Document, or an Object.

While adding custom data fields as the child of another custom field, the field must be unique among all the children of the parent field. The newly added custom field will then be added to the existing data fields list and, if selected, will be sent to the API while creating a custom operation and will get reflected in the input/output signature along with other selected fields.

Now that we know what custom fields are all about, let us see how to add custom data fields. To do so, follow the steps given below:

  1. Add the Salesforce CRM connector to the canvas.

  2. Once done, configure your Salesforce CRM action by double-clicking the Salesforce icon. From here, you can create a new custom action, or access an existing custom action.

    For demo purposes, let's create a new custom action, query.

  3. Click the + button. The Add Custom Action screen appears.

    From here, you can create a new account, or access an existing account. For demo purposes, let's create a new account create.

  4. In the Add Custom Action configuration form that appears, provide the details as given below:

    • Select Authentication type: Select an authentication type, for example, Credentials.

    • Authorize AccountCreate: Select an account for executing the selected action.

    • Name: Provide a name for the account, for example, create.

    • Description: Enter the description of the account.

  5. Click Next and select an action to be performed, for example, create.

  6. Click Next and select the business object to be associated with the action create. Business Objects and Interactions appear only for certain applications and actions.

  7. Click Next. To add the new custom data fields FirstName and LastName to use for the business object Contact under Account, click Add Data Field.
  8. In the Add Data Field window, add the new custom data fields Firstname and Lastname. Select Required option to indicate whether the field is required.

    Provide the name and type of the data field to define the structure and content of the data fields. In the above example, we have added "ens:Contacts" as the data field and data type as "document" which is of a parent hierarchy.

  9. Click Next. Similarly provide "ens:FirstName" and "ens:LastName" fields and data type as "string" for a child hierarchy.

  10. Click Next. Confirm the action, and then click Done.

    You will be redirected to the main screen. Click Next. You will be redirected to the action configuration window.

  11. In the select field, query the custom data field FirstName and LastName for the business object Contact under Account.

  12. Click Next. You will be redirected to the Test this action window where you see the custom data field FirstName and LastName for the business object Contact under Account.

  13. Click TEST. If you have configured the action correctly, you will see in the output data the added custom data field FirstName and LastName. This will give you an idea of how your action will work when used in a workflow and which keys are returned in the output of the trigger. This output data will then be used to configure the rest of the workflow.

With this, our custom field is successfully set up. Now click on the Save button located at the top-right corner of the canvas to save the workflow. You can now use this account in any workflow created under the same project.