Conditionally Auto update a Field on a NewRecord
The requirement is to conditionally auto update a field on a new record creation, for e.g. in Activities I create a New Record and as soon as Activity Status field is set to a value as ‘Alerted’, then the Comment field on Activities should be immediately stamped with a value as ‘Alert Sent to User’.
Moreover, comment field should not be set when Activity “Status” field is set to other values such as “Not Started”, “Sent”, “Planned”, “Quoted” and on the existing Activity records.
To implement this requirement, follow the configuration steps as below.
1. In Siebel Tools, go to the Action BC, Edit Server Scripts and in BusComp_NewRecord, write a line of code to declare a profile attribute as below:
2. In the Action BC, Edit Server Scripts and in BusComp_PreSetFieldValue event, write the code as shown below:
3. Go to Action BC, Query for the field called Status and set the Property “Immediate Post Changes” = TRUE as shown below:
4. Compile the Action BC and launch the Siebel Client Application.
Now when you create a NewRecord and as soon as set the Status as “Alerted” on this New record, Comment will be immediately stamped as “Alert Sent to User”
In order to confine step 1 to a particular view, you can also try and use TheApplication().ActiveViewName() vanilla function.