Sunday, February 28, 2010

Scripting alternative –Data Validation Manager

Many times, system requires us to put validations; we generally end up with scripting in Pre Events like PreSetFieldValue or PreWriteRecord.

Recently, I worked on Data Validation Manager which is a quite useful tool to do validations in the application itself without changing the srf. With the combination of Run Time Events, I really found DVM competitive to avoid scripting and from maintenance perspective also.

We can use conditional expression to check the validation and invoke a RTE and DVM.
I will run through the End to End process of creating a RTE and DVM Rule. I will also show you validation getting fired in the application.

Let’s take an example, I want to put a validation that a contact record must have an email address or a Mobile Phone number or a Work Phone number.

To work this validation out, I will do the following steps:- 
  1. Create a DVM Validation Message.
  2. Create a DVM Rule.
  3. Call Data Validation Manager BS using the Action Set.
  4. In the Business Service Context, Provide the DVM Rule name.
  5. Create a RTE.
  6. Reload the RTE and activate the DVM Rule.
  7. Creating a new Contact Record and test the DVM.

I need to create RTE and DVM. It will be a mandatory check for email address or a Mobile Phone number or a Work Phone number. This RTE will be on PreWriteRecord of Contact BC.

Step1: Go to Administration - Data Validation and Create the DVM Message

Step 2: Create DVM Rule for contact validation.

Step 3 and Step 4: Create an Action Set for RTE
Business Service:  Data Validation Manager
Business Service Method:  Validate
Business Service Context:  "Rule Set Name", "Contact Details", "Enable Log", "Y".

Step 5: Create a Run Time Event on PreWriteRecord on Contact BusComp and Call the Action Set created in Step 3 and 4.

Step 6: Reload Run Time Event and Activate DVM Rule.

Step 7: Create a Contact Record and test DVM.
The Limitation of the DVM is that field should be visible on the UI.

Sharing is the Power.

Saturday, February 20, 2010

SetNamedSearch - Cannot be modified through UI

Have you come across a requirement where after reaching a view. You don't want user to do a new query and get all the records. You only want to show those records which user saw first time on reaching to this view.
Though you want to give him a query option to search in the given records first time.

Yes, this can be achieved using SetNamedSearch BusComp Method. 

Let me explain you with the help of a example.
Using a Drilldown, user reached to a All Activities List View where I don't want him to see Confidential Activities. I captured the method Drilldown and the Field name using SWEField property, in the drill down only I put code like

BusComp.SetNamedSearch(searchName, searchSpec)

SetNamedSearch("NotConfidential", "[Confidential] != 'Y'")
GotoView(ViewName, BO instance)

Now even after reaching to the DrillDown View, if user do a null query. He will not be able to see the confidential activities.

It is a search criterion that is not cleared by the ClearToQuery; for example, a predefined query or business component search specification.It can only be modified through script; it cannot be modified through the UI. 

You can retrieve this search specification, use GetNamedSearch metho.

Note: that when a new instance of the BusComp is created, the named search specification is cleared.

Friday, February 19, 2010

MVG Set Primary Restricted: Position

Have you ever seen that you are not able to change the primary in a MVG applet based on position. you are not able to figure it out how this Primary Field becomes editable. The Primary flag is read only.
You checked the No Update Property if it is set. You have checked if any Buscomp Read Only User Property for the primary Record. If still you are not able to find the reason why you are not able to change the Primary.

The reason may be Position Protection mechanism. Position Protection is a mechanism that protects against unauthorized changes within a MVG applet based on Positions. If Position Protection is active then changes can only be done by privileged persons or within certain views.

In Siebel previous version before 7.x, Position Protection mode can be disable but to a limited extent.
In Siebel version 7.x and above, this does not apply. Disabling Position Protection is handled by setting the 'MVG Set Primary Restricted: visibility_mvlink_name' user property to 'FALSE'.

Position Protection is active when:
  • the view's Property Admin Mode is set to FALSE
  • the multi-value field's (MVF) business component is set up with Position Team Ownership
The following business component Properties must be set:
  • Visibility Emp MVField
  • Visibility MVLink
The MVLink must point to the Position business component.
  • The Multi Value Field is based on Positions.
NOTE: Position Protection is not active within Siebel VB / eScript, regardless of above settings.

View Links

We must have seen the Links on the Screen Homepages. But I was never known that these are just links to the View which can have default PDQs. It just works like a Drilldown on a field. I always thought that these are configured at Applet Level and its a SRF Change.

Recently, there was a requirement I came across to configure those links. We can configure those link from Application itself. As we know that PDQs can be Private and Public. Similarly, these links as well can be Private and Public.
Private View Links: Visible only to the Creator.
Public View Links: Visible to everyone using the application.
If User wants to configure these links, they can do so using User Preferences->View Links.These links from User preference can be only Private for that user only.

You can specify the Default Query, which can be configured using Application Administration -> Predefined Queries.
The Public and Private View Links can also be configured from Application Administration -> View Links in the same way as you do in User Preference.
To configure the View Links in Screen Homepages, you should know Screen Name, View Name.
If you want to specify Default Query then a pre-default query will be created by System Admin.
Let me show my customized View Links 

There are some BCs which may not have Screen Homapages, you need to add a User Property VlinkScreen::  value as 'Y' in the 'SRF Vlink Screen' Business Component.

Saturday, February 6, 2010

Calculating Business Hours

I had one requirement where I need to calculate the time, user has taken, to complete a certain task.
The task time taken should not include the Holidays. It should only consider Working Hours to calculate the time taken.
First, we need to know where we can feed in the working hours, holidays in Siebel.

Question: Do we have something OOTB?
Answer: Yes, we have got a View based on Shift BC using view Administration Service->Schedules

Question: Where can we put the Holidays?
Answer: Administration Service -> Schedules -> Exception Hours

Question: Do we need a customize BS to calculate the Time difference considering working hours only?
Answer: Yes we have got a OOTB BS 'FS Holiday API Service', that gives output as Elapsed Time using input as Start Time, End Time, Time Unit, Calender Id(Schedule Id)

FS Holiday API Service BS provides 3 methods:
  1. GetElapsedBusinessTime
  2. GetResponseTime
  3. IsHoliday
I simulated this BS using method GetElapsedBusinessTime to calculate the Elapsed Time.

You can provide input argument as below:
  • Calender Id : Id of the New Schedule
  • End Time: 02/06/2009 12:54:28
  • Schedule Time Zone:
  • Start Time: 04/06/2009 10:54:28
  • Time Unit: Hours
It will give the Business Hours based on the Service Calender used.

Sharing is the Power.