Siebel – Automating Merge Records by script – II
by Nitin JainI call this Part II, as I have already introduced the Merge Records Siebel functionality, and discussed its usage in his post. One of the interesting discussions we had was how such a data could possibly be inserted into the Siebel system, since Siebel has so many mechanisms to prevent Data Corruption. We had also zeroed in on EIM and EAI as the basic culprits which could possibly insert inconsistent data into the Siebel Database.
When such a thing happens on sucha large scale, or when we know the exact pattern whereby we can detect these duplicate records in the system, we may look at options to automate the process of Merging Records. How nice would it be if we could just somehow put it all up in a workflow or script which would achieve the above objective.
Exploring further on the topic, I came to realize that there is an undocumented BC method which we may fire to achieve the objective above. Try looking at the script below:
var Target_Id = “Dummy-001″;
var Source_Id = “Dummy-002″;
var bo_Contact = TheApplication().GetBusObject(“Contact”);
var bc_Contact = bo_Contact.GetBusComp(“Contact”);
bc_Contact.InvokeMethod(“SetAdminMode”, “TRUE”);
bc_Contact.SetViewMode(All);
bc_Contact.ClearToQuery();
bc_Contact.SetSearchSpec(“Id”, Source_Id + ” OR ” + Target_Id );
bc_Contact.ExecuteQuery(ForwardBackward);
if (bc_Contact.FirstRecord())
{
while (bc_Contact.GetFieldValue(“Id”) != Target_Id)
{
bc_Contact.NextRecord()
}
bc_Contact.InvokeMethod(“MergeRecords”, Source_Id);
}
If you notice carefully, we have invoked the method, “MergeRecords” on the Contact BC. The Contact BC has the class, “CSSBCContactSIS” which definitely, thus, supports this method. My guess would be that this method would be supported for all the BCs, where the vanilla Edit -> Merge Records functionality is enabled for the corresponding views. I haven’t actually gone further than this.
If somebody has had any other experience with Merge Records, please do share!
Related posts:
- Siebel – Merge Records – Checklist I call this Part III, and concluding part of a...
- Siebel – Merge Records Functionality How many times have we realized that there are multiple...
- Siebel – Looping multiple records – Update records Hi, We often come across a requirement where we need...
- Siebel – EAI Siebel Adapter – Looping Multiple Records This is a follow-up post on the post, Siebel –...
- Siebel – Looping Multiple Records – III Looping through multiple records is a requirement we come across...
- Siebel – Looping multiple records – Query and Process In my last post, I discussed as to how we...
- Siebel – SIA BC Utility Service – Loop multiple records This is a vanilla business service which provides an extensive...
Good Post Nitin !!!
We can extend the functionality by writing a BS to merge more than 1 record to the source.
MergeRecords method works fine for OOB foreign key references.
How are the Custom foreign key references resolved? How about the Child records associated to the merged victim record? Any ideas?
Apart from above pointers, if Data Management application like UCM is in use, there is a requirement to merge the records with certain attributes of the victim record to be retained on the survivor record.
hmmm.. Nice pointers, Nanpats.
Waiting eagerly for answers to these from you, buddy..
I would respond to one of my comments wherein I pulled out questions on merge when Data Management Application like UCM are in use —
UCM has got inbuilt features DeDuplication and Survivorship Rules which govern / evaluate the matching percentage of 2 given records (DeDuplication) and update of certain attributes on the survivor post merge (Survivorship Rules). However if you have integration of the standardized data back into Siebel, you would be required to maintain the same in Siebel. This is where a custom merge solution comes handy.
To build a custom merge solution the following pointers should be kept in mind:
a. Merge of 2 records (Way to identify the survivor and victim records)
b. Update of attributes / fields from victim onto Survivor record (Survivorship rules)
The solution would be a 3 step process (high level though)
1. Ensure you have ways to identify the Victim and Survivor records based on merge performed in UCM
2. Capture the attributes / fields from the victim record which you would like to update on the survivor record (based on Survivorship rules in UCM)
3. Perform OOB Merge on the records
4. Explicitly update the fields on the survivor record per pointer 2.
I will update the group on other questions in sometime related to Foreign key reference and child record association / disassociation resolution.