Product Administration Guide > Customizable Product Scripts >

Cfg_ChildItemChanged Event


After a user request is processed and the eConfigurator engine computes a new solution, this event is called for the product root. The event returns a property set containing all the products whose quantities have changed.

This event is also called if the user changes an item's quantity and the Request Conflict dialog box displays:

This event does not return items for which only attribute values have changed. For example, if the total number of 100 GB disk drives in a solution changes, this event returns a property set containing the 100 GB disk drive because the item quantity changed.

If the user enters or selects 10 feet as the desired value of the length attribute for power supply wiring, the returned property set does not contain power supply wiring since this is an attribute change.

In the selection pages for a customizable product, this event is called when the user selects an item. It is also called when the user increases or decreases the quantity of an item. This event is called before the Cfg_ItemChanged event.

Syntax

Cfg_ChildItemChanged (ChangedItem as Property Set)

The ChangedItem argument is passed as type PropertySet. This is a named XML element:

<ChangedItem ObjName= "objname" OldQty= "oldqty"
NewQty= "newqty"/>

The properties of this XML element are defined in the following table:

Property
Description
ObjName
String. The item name.
OldQty
String. The item quantity prior to the request.
NewQty
String. The new baseline item quantity.

Several Siebel API-related methods are needed to read data from the property set:

Returns

None

Usage

Use this event to determine what changes have been made to products in the solution and to submit additional requests as needed. For example, you could track the memory requirements for software the user selects and submit requests to add the correct amount of RAM to a computer configuration.

When you submit a request that changes item quantities, the submission causes the event to be called and the script runs again. Be sure to insert logic in the script that prevents an infinite loop of request submissions.

Example

The following Siebel Visual Basic example writes to a file the item name, the old quantity, and the new quantity of all the items whose quantities change in each solution.

Sub Cfg_ChildItemChanged (ChangedItem As PropertySet)

dim psItem as PropertySet

dim n as Integer

dim nCnt as Integer

dim sObjName as String

dim sOldQty as String

dim sNewQty as String

dim sMsg as String

dim hndl as Long

hndl = Freefile

REM use a relative path to open cfgtest.log

Open "..\cfgtest.log" for append as #hndl

nCnt = ChangedItem.GetChildCount()

For n = 0 to (nCnt -1)

set psItem = ChangedItem.GetChild(n)

With psItem

sObjName = .GetProperty("ObjName")

sOldQty = .GetProperty("OldQty")

sNewQty = .GetProperty("NewQty")

End With

sMsg = "ObjName = " & sObjName

sMsg = sMsg & "; OldQty = " & sOldQty

sMsg = sMsg & "; NewQty = " & sNewQty

Write #hndl, sMsg

set psItem = Nothing

Next

Close #hndl

End Sub


 Product Administration Guide, Version 7.5 
 Published: 18 April 2003