PreDefault Value Vs PostDefault Value Vs Scripting
In this article I will show you how the values are populated on the Siebel UI when we have predefault as well as post default value set on a field with scripting on Buscomp_NewRecord Event. ( In this example we are using the field “Description” on the Activities Screen)
Say we have field properties set as :
1. PreDefault Value = Pre
2. PostDefault Value = Post
we also have written a script on the BC_NewRecord called “Action” which sets the Field Description to a value called as “Script”
Sample screenshots are below:
Now let us try and create a new record on the Siebel UI.
1. When I press a New button on the Siebel UI, I see Description set as value of “Script”. It means that Setting a value in the Script overrides the PreDefault value set at Field Property Level.
2. If I remove this value and set it as blank and save the record, PostDefault Value is fired as shown below:
3. Now when a value “Post” is populated on the Description field, I set this value to Blank and again save this record. The Blank value is saved in the Database.
In the DB value is shown as (null)
4. Let’s say I create a NewRecord again, “Script” Value is set on the UI (as in point 1). Now I try overwrite the value with “(null)” and save the record. “(null)” is saved in the UI and as well as at the database.
5. Let’s say I create a NewRecord again, “Script” Value is set on the UI (as in point 1). Now I try overwrite the value by pressing Space button on the keyboard five times as shown below.
When I save the record, PostDefault Value is fired as shown below
Now I again overwrite the value “Post” with 5 Space characters on the UI in the Description Field, I see the Description Field set as Blank.
1. BusComp_NewRecord – this event will be triggered when the record is first created, similar to the functionality of the PreDefault value.
2. BusComp_PreWriteRecord – Works similar to the functionality of the Post Default value but be sure that you check if the field is null before assigning a new value through script.