Bookshelf Home | Contents | Index | PDF |
Product Administration Guide > Customizable Product Scripts > GetCPInstance MethodThis method returns the entire structure of a customizable product as a property set. SyntaxGetCPInstance() as property set ItemsReturnsReturns the structure of the customizable product as a property set. Depending on the structure of the customizable product, the property set can be complex. To learn how to access the property set, use the following JavaScript code to dump the property set to a file. You can then study the property set structure to determine how to access it using a script. Use the PropertySetToFile(PropSet, fileName, title) API in your script. Note that fileName must be double slashed, as demonstrated in the example below: PropertySetToFile(InputsPS, "..\\temp\\testPSexport.txt", Inputs into " + MethodName); This will write the property set to a text file in the Siebel temp directory. function PropertySetToFile (PropSet, fileName, title) var file = Clib.fopen(fileName, "at"); LogData(("\n---------------------------------------------------"), file); LogData(("Start Process " + Clib.asctime(Clib.gmtime(Clib.time()))), file); LogData("PROVIDED PROPERTY SET", file); WritePropertySet(PropSet, file, 0); function WritePropertySet(PropSet, file, Level) if ((Level == "") || (typeof(Level) == "undefined")){ for (var x = 0; x < Level; x++){ var psType = PropSet.GetType(); var psValue = PropSet.GetValue(); LogData((indent + "Type: " + psType + " Value: " + psValue), file); var propName = PropSet.GetFirstProperty(); var propValue = PropSet.GetProperty(propName); LogData((indent + propName + " = " + propValue), file); propName = PropSet.GetNextProperty(); var children = PropSet.GetChildCount(); for (var x = 0; x < children; x++){ LogData(( indent + "CHILD PROPERTY SET " + x), file); WritePropertySet(PropSet.GetChild(x), file, (Level + 1)); function LogData(DataString, file) |
Product Administration Guide |