Saturday, April 10, 2010

Named Method n - Alternative to Scripting

Named method is a very good alternative to the Scripting if you have custom method to invoke. It can be used both at applet level as well as at BC level. You need to specify a user property Named Method n.

It can be used to do some of  following things:-
  1. Set the field values with or without conditional expression, 
  2. To invoke OOTB methods.
  3. To invoke Business Service/Workflow.
I have used this user property with On Field Update Set and On Field Update Invoke user properties.I really found them very handy to use. I have to use the customize method because in our project Client was very demanding and was very much focused on usability of buttons to perform actions.

Some of the examples I have used of the above user properties are like:-

User Property Value
Named Method 1 "DeclineCase", "SET", "Position Name", "IIF([Case Decline Reason]='Incorrect SM', [Parent Position Name], IIF([Case Decline Reason]='Incorrect Entity', '', [Position Name]))"
Named Method 2 "DeclineCase", "INVOKE", "HLS Case", "WriteRecord"
Named Method 3 "DeclineCase", "INVOKESVC", "HLS Case", "Workflow Process Manager", "RunProcess", "ProcessName", "Case Assignment Email Notification"
Named Method 4 "DeclineCase", "INVOKE", "HLS Case", "RefreshBusComp"

For more details, Please refer the bookshelf.

Sharing is the power

Tuesday, April 6, 2010

Using Email Templates for Automatic triggering of Emails

This is the extended post of my previous posts how to create and use email template on F9, Send Email OOTB functionality. Supplementary to this, I have also posted creating Recipient Group.

In this post, I will tell the rest of the things:-
  1. Creating the New Recipient Source.
  2. Creating the Non-Joined Recipient Group.
  3. Creation of Email template.
  4. Substituting the Fields in the Email text.
  5. Adding HTML templates.
  6. Testing the Outbound Communication Request.
  7. Calling the BS to send the emails.
Let's take a scenario where the Bus Comp is not there listed in the Object for the field Substitutions.

Step1: Query with LOV Type as 'COMM_RECIP_SRC' and Parent LIC as null.
Copy the record and put the Display value and LIC as your Bus Object name.

Step2: Query with the LOV type as 'COMM_RECIP_SRC' and Parent LIC as not null.
Copy the record and put the Display value and LIC as your Child Buscomp which is the Recipient Group BusComp(like Contacts or Employee). Here you may get the unique record error. You may need to update from back end. You can also create Joined Recipient Source.

Step3 and Step4: Creation of Email template

Step5: To add the HTML templates go to Template Items View. There, you need to add the HTML file. In the HTML code, add the fields name inside square brackets for example [Full Name]. Check the Substitute values if you have used substitute fields and message body if you want to add the HTML into message body of the email.

Step6: To Test the Recipient Source, Recipient Group and Email Template, you can create a Outbound Communication Request from Administration-Communication Screen.
  • Go to Outbound Request Overview View, 
  • Create a new record, 
  • Put the Recipient Group. 
The below applets will be based on the Recipient Source and Recipient Group. Like if you Recipient Source is Account, the New button on Recipient Source will be a Associate Applet of Account BC and the Recipient Source will get auto-populated based on the relation of Recipient Source and Recipient Group.

Make sure that Communication Outbound Manager component is up and running and you have selected the Communication Profile at Email template level.

Step7: Now you have created the Recipient Source, Recipient Group and Email templates.
To triggering the email you need to call the 'Outbound Communications Manager' BS and its method CreateRequest. The arguments you need to pass to this method are follows:
  • PackageNameList: Name of the Email Template
  • ProcessMode: Remote for Dedicated Client, Local for Web Client
  • RecipientGroup: Recipient Group Name like Contact
  • SourceIdList: Row Id of the Recipient Source BC like Account
You can call this Business from any triggering point where you want to send the Email.

The best thing about using the Email templates and CreateRequest of Outbound Communications Manager is the flexibility of changing the Email Body while this is not possible if you are using SendMessage of Outbound Communication Manager.

Sharing is the power.

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.