Configure SmartObject Methods
To be able to perform the steps below, ensure that a Service Object has been created. This is considered an advanced topic, and existing K2 designer for Visual Studio skill is assumed. Not all steps are shown, and may just be referred to for ease of explanation.
Step 1:
From the Solution explorer, add a new K2 SmartObject and name it myEmployee for example.
Step 2:
Switch to Advanced mode and Remove All existing Methods.
Step 3:
- Click Add to add a Custom Smart Object Method.
- Once the Wizard Loads, provide the Method with a name example Get Employee List.
- Provide a description.
- Select type as List.
Step 4
Configure Method: SAP Methods requires at least 2 parameters when running a BAPI query against an SAP namely DATE0, InputParameter. A parameter for each of these three items must be created.
- Click Add.
- When the Add Parameter Dialog displays enter the Parameter Name, Description (optional)and Type "Text" (default)
- Repeat the steps above to create a parameter for InputParameter.
- Click Next to step to the next page in the wizard.
Step 5:
To create a Service Object Method, Click Add, and the Add Service Object Method page opens.
- Click on the Context Browser button to open the browser.
- Expand the Service Object Servers to expose the Connect Service [Name] > [Service Object] > [Method].
- Select it and all the return properties for the Service Method will be displayed.
- Select an Input Parameter (created previously).
- Click assign.
- From the Map Service Method Parameter, click on the Map To drop down and select SmartObject Method Parameter.
- From the SmartObject Parameter Name, select the parameter that corresponds to the Input Parameter selected
- Click OK to complete.
- Select a Return Parameter (created when the service object was originally created prior to being published).
- Click assign.
- When the Map Service Property Dialog loads, the Map To drop down stays as is.
- Click Create. The SmartObject Property Name from the Maps Service Property dialog can be changed, otherwise click OK.
- Click OK again.
- Repeat the steps above for all the Return Properties. Once done, review the Return Properties to ensure that they map correctly.
- Click OK to complete.
- Click Finish, and the user will return to the SmartObject Editor.
Step 6:
the Smart Object by deploying it. When the message Deploy Succeeded appears, then the Smart Object has been deployed correctly.