Product Administration Guide > Customizable Product Scripts >

Cfg_AttributeChanged 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 attributes have changed.

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

In the selection pages for a customizable product, this event is called when the user enters or changes an attribute value.

Syntax

Cfg_AttributeChanged (ChangedAttribute as Property Set)

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

<Id ObjName ="objname">

<AttName = "attribute name" OldVal= "old value"
NewVal= "newvalue">

...

</Id>

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

Property
Description
ObjName
String. The item name.
AttName
String. The attribute name.
OldVal
String. The attribute value prior to the request.
NewVal
String. The new baseline attribute value.
Id
String. The object ID of the item whose attribute value has changed.

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 product attributes in the solution and to submit additional requests as needed. For example, you could track the attributes selected for a product and submit requests based on them.

Example

The following example, writes to a file the item name, the old attribute value, and the new attribute value of all the items whose attribute values change in each solution.

{
var item;
var log = Clib.fopen("c:\\attchgd.log", "a");

var id = ChangedAttribute.GetType();
   Clib.fputs(id, log);

   var nCnt = ChangedAttribute.GetChildCount();
   Clib.fputs(nCnt, log);

   for ( var i = 0; i<ChangedAttribute.GetChildCount(); i++ )

{
      item = ChangedAttribute.GetChild(i);
      var attName = item.GetType();
      var oldV = item.GetProperty("OldVal");
      var newV = item.GetProperty("NewVal");
      var s = "AttName = " + attName;
      s = s + "; OldVal = ";
      s = s + oldV;
      s = s + "; NewVal = ";
      s = s + newV;
      Clib.fputs(s, log);
    }
    Clib.fclose(log);
}


 Product Administration Guide 
 Published: 23 June 2003