Tuesday, April 12, 2011

Business Component - PreWriteRecord Event

Business Requirement: 
Create an Opportunity and step off the record. An error message should be thrown if the Probablity of the Opportunty is 0% and Sales Cycle is blank.
Solution:

Where to put the code:
@ Business Component level we are writing the code proactively,
as this is validation at record level we decided to put the code at Pre event...

function BusComp_PreWriteRecord ()

{

var prob; // declaring the objects

var sales; //declaration again

prob = this.GetFieldValue("Primary Revenue Win Probability");

sales = this.GetFieldValue("Sales Stage");


if(prob == '0' && sales == '' )

{

TheApplication().RaiseErrorText("Percentage should be greater than 0 and Sales Stage should not be blank");

}

}

Compile and test!!!


BusComp_PreWriteRecord Event : Called before a row is written out to the database.
This event can perform any final validation necessary before any internal record-level validation is performed.
 
CAUTION: Take caution when using the Raise Error and RaiseErrorText methods in
BusComp_PreWriteRecord, because they cancel operations. For example, if RaiseErrorText is used in
BusComp_PreWriteRecord, the user or code will not be able to step off the current record until the
condition causing the RaiseErrorText method to be invoked is addressed.

Friday, April 1, 2011

Enter Siebel License Keys

Once I got into a situation where I needed to enter the license key into the siebel tools and the field where we can enter the License keys is disabled.

Trick for such situation:
1. Open Siebel Tools, (Sample)

2. Now Keep pressing the Shift Key.

3. Open Help Menu -> Technical Support.

4. You see the field "License Keys" enabled

Where you can enter the new keys. Hope this helps.



Wednesday, March 16, 2011

A Service Request cannot be closed without filling in comments in the Summary control.

Before I start about the following post, I would like to extend my deep sympathy towards the Japanese people who are stuck by the disaster and am continuously keeping them in my prayers.

 Requirement : A Service Request cannot be closed without filling in comments in the Summary control. An error message should be thrown "Please enter Summary information before closing the Service Request."


Solution:
We solve this problem by using PreWriteRecord event which is called before a row is written to the database.
The event can perform any final validation necessary before any internal record-level validation is performed.

function BusComp_PreWriteRecord ()

{

 var Status=this.GetFieldValue("Status");

var Abstract=this.GetFieldValue("Abstract");

if (Status == 'Closed')

{

if (Abstract=='')

{

TheApplication().RaiseErrorText("If Status is closed then Summery must be entered");

}

}

}

Thursday, March 10, 2011

Named Method

              Sometimes it is necessary to trigger actions in response to data changes, for example when records are created, deleted, or updated. The response can be required to be triggered before or after the date  change has been applied.
             Within the Siebel Application there is standard functionality, including user properties, to allow you to implement automated responses to data changes without the need to use custom scripts.
for which we have,
The Named Method n applet user property can be used to invoke methods in a certain order.

This user property is supported for applets based on the CSSFrameBase and CSSFrameListBase classes.

Business Challenge:  Update a legacy system with new Account records after a new record is created in the
Siebel application.
Solution :
Goto related applet> applet user property
Create a new record as follows with the properties:
Name :     Named Method 2: WriteRecord


Value :     'INVOKE', 'WriteRecord', 'INVOKESVC', 'Workflow Process Manager', 'Run Process',    '"ProcessName"', '"Account - New Order"', '"RowId"','[Id]'

(make the above syntax using the Expression dialog box, which will be popped when u click on ellipses of the value field)

Note : You can create additional instances of this user property as needed. If you have more than one instance of this user property for a business component, each instance is executed sequentially by number (for example, Named Method 1, then Named Method 2, and so on). If there is only one such user property, then no number is required.

Wednesday, March 9, 2011

Auto Login to Siebel tools,client and server.

The following trick is very useful while working on siebel and needed to login and logout for million times.

Right click on the icon, in properties window, you see Target value something like the following,
"C:\Siebel\8.0\Tools\BIN\siebdev.exe" /c "C:\Siebel\8.0\Tools\bin\enu\tools.cfg"

To automate your login to Sample Database.

add the following
"C:\Siebel\8.0\Tools\BIN\siebdev.exe" /c "C:\Siebel\8.0\Tools\bin\enu\tools.cfg" /u sadmin /p sadmin /d sample

 For Local add:
/u MSMITH /p MSMITH /d Local  (your local username and password)

 /d ServerDataSrc to connect to Server.
 


Saturday, March 5, 2011

Validation Property

Requirement : Action end date should always be greater than action start date.

Solution : BC Field level, set to the syntax of the validation property to

                        >=[Action Start Date]

Should throw an error if the field left empty

Requirement : The field "Date Of Birth" shouldn't be left empty by the user.

Solution: On BC level set the "Required" property to TRUE for the field.

Followers

Search This Blog