Thursday, Oct. 19, 2017

Sorting on the fields predefaulted using RowIdToRowIdNum function

Written By:

|

January 5, 2013

|

Posted In:

Requirement:
The requirement is to sort the field called SR Number. In the standard version, the “SR Number” field is pre-defaulted to <Expr: ‘RowIdToRowIdNum ([Id])’>, this prevents from sorting using the number order.
Say for example,
We have three existing Service Requests which when sorted by field called “Created” shows the below results:

SR Number                   Created
1-12345                       24/04/2004
1-123456                     17/01/2005
1-98765432                  25/05/2005

But if sorting is done on “SR Number” then below results are shown:
SR Number                    Created
1-123456                      17/01/2005
1-12345                        24/04/2004
1-98765432                   25/05/2005

Solution:
Follow the below steps to implement the numeric sorting on a field called “SR Number”
1. In Siebel Tools create a new custom Business Service called “CustomSRNumber” with method as “CreateSRNum”.
Business Service as shown below:

sorting1

Business Service method as shown below:

sorting

Create 3 new Business Serice Method arguments for the above method as below

sorting

Add the following lines of code in BusinessService – “Service_PreCanInvokeMethod” and “Service_PreInvokeMethod” event

sorting

sorting

The business logic to implement the sorting on SR Number field is to make use of its field length(32 in our case). Build all the SR Numbers with length as 20 with leading 0’s as new SR’s will now look like 1-00000000098765432,1-00000000000012345,1-00000000000123456

2. In Siebel Tools, query the Service Request BC and modify the PreDefault value of the field called “SR Number” as shown below:

sorting

3. Compile the objects modified above.

4. Launch the Siebel Client application and click on New Button on the Servvice Request List Applet. The New SR will be created as

sorting

5. If on clicking New record in the Service Request List Applet an error such as SBL-DAT-00610 is encountered as shown below

sorting

Just make the following change in your CFG file as shown below

sorting

Just add a new parameter called BusinessServiceQueryAccessList in your client CFG file under [Siebel] section. Set this parameter to a value of your custom Business Service name which is “CustomSRNumber” here.

Happy Learning!!



Share This Article

About Author

Gurdeep

Hi, I am sharing my experience to alleviate beginners with open UI and HI version of Siebel CRM. I work in Sun Life Financials and can be reached via IT Tool box as well. Thanks.

  • Rahul

    Hi
    if any one have idea to implement below change, please let me know
    Requirement is to define the sorting on the column,

    Normally in UI we have a columns as STATUS which can have values Green—
    Red—Yellow

    In UI if you click on column header. It will sort with either Green—Red —yellow or yellow—red—green which is ascending or descending order.

    We need a change which need like this
    Green—yellow— Red or Red –Yellow-Green..can this be done?