CreateObjectUsingCreateRule
You can use this function for Optiva workflows.
Purpose
This function creates a new object using Create Rule.
Syntax
Dim saveStatus as long = CreateObjectUsingCreateRule (symbol, CreateRule, CopyMethod, Segments, newKey)
          Arguments
| Part | Description | 
|---|---|
| Symbol | The symbol of target object. | 
| CreateRule | The create rule associated with the object. | 
| CopyMethod | The copyMethod that is associated with the create rule value. | 
| CodeSegments | The hashtable containing the code segment names with the create rule value. | 
Description
CreateObjectUsingCreateRule creates a new object with the help of Create Rule internally by calling the Create Data using Create Rule API.
Example
In this example, a new Trade Item object is created using Create Rule.
Dim newKey As String = ""
Dim sItemDescription As String = ""
Dim htCodeSegments As Hashtable = new Hashtable()
htCodeSegments.Add("Company Prefix","000002")
htCodeSegments.Add("GTIN Type","GTIN-12")
htCodeSegments.Add("GTIN Template","FOOD")
Dim saveStatus as long = 0
saveStatus = CreateObjectUsingCreateRule("TRADEITEM","NEW TRADE ITEM","NEW TRADE ITEM",htCodeSegments,newKey)