Preventing duplicate records in Siebel.

To prevent duplicate records in database for any entity such as Service Request, Opportunity or Quote restricting it at table is the best option.
To do that you just need to follow the steps below

  • Go to the Table object in Siebel Tools
  • Select the column which you want to unique
  • Set the Primary Key property for that column to true

And you are done. But this will result in Siebel error message not the message that you want to convey user. If you want to convey a meaningful message to user when he is trying to create a duplicate record then Scripting can give you a solution.

You just need to write a small script at BusComp_PreWrite event and that should solve your problem. Code for that script is given below. Here we are assuming that we want to prevent Oppty with same name and type.


var obj = TheApplication().GetBusObject(“Opportunity”);
var optybc = obj.GetBusComp(“Opportunity”);
With(optybc)
{
ActivateField(“Name”);
ActivateField(“Type”);
SetViewMode(3);
ClearToQuery();
SetSearchSpec(“Name”,this.GetFieldValue(“Name”));
SetSearchSpec(“Type”,this.GetFieldValue(“Type”));
ExecuteQuery(ForwardOnly);
if(FirstRecord())
{
   TheApplication().RaiseErrorText(“Your Message”);
}
}


*Remember that PreWrite event fires everytime you are tyring to save the record. So, you want to include the checks to only fire this code under certain conditions othewise it can result in performance issue while saving your opportunity.

21 Responses to Preventing duplicate records in Siebel.

  1. The real time integration to D&B within Siebel (version 7.5 and greater) allows you to search D&B at account set up and select the desired new account from the D&B database. If the record selected already exists in Siebel (based on the D&B DUNS Number) the user is taken to that record. If not, the new record is downloaded from D&B to the DNB_ORG table and the user can promote to create the new account.

  2. The real time integration to D&B within Siebel (version 7.5 and greater) allows you to search D&B at account set up and select the desired new account from the D&B database. If the record selected already exists in Siebel (based on the D&B DUNS Number) the user is taken to that record. If not, the new record is downloaded from D&B to the DNB_ORG table and the user can promote to create the new account.

  3. Hi All,

    Is there any technote on integration of Siebel with D&B Customer Integration Manager?

    If some body have please post it.

    Thanks & Regards,

    Amzad B.

  4. Hi All,

    Is there any technote on integration of Siebel with D&B Customer Integration Manager?

    If some body have please post it.

    Thanks & Regards,

    Amzad B.

  5. Hi Amzad,
    Did your question wrt D&B CIM get answered? I am a product manager with D&B and work on Integration Manager. Let me know if I can help.

    Thank you.
    Rag

  6. Hi Amzad,
    Did your question wrt D&B CIM get answered? I am a product manager with D&B and work on Integration Manager. Let me know if I can help.

    Thank you.
    Rag

  7. Siebel will not allow to have more than one primary key for a table. Can you please provide any alternate soultion to make another column as unique apart from row_id?

    Thanks

    NR

  8. Siebel will not allow to have more than one primary key for a table. Can you please provide any alternate soultion to make another column as unique apart from row_id?

    Thanks

    NR

  9. I have requirment to restrict duplicate records based on multiple fields. I mean they are 5 fields on specific entity, combination of all 5 fields should be considered to restrict duplictaes. Can any one suggest me

  10. I have requirment to restrict duplicate records based on multiple fields. I mean they are 5 fields on specific entity, combination of all 5 fields should be considered to restrict duplictaes. Can any one suggest me

  11. Use script under BusComp – PreWriteRecord event. And this condition has to execute only for the new records created. For set a profile attribute on BusComp_NewRecord event, get the same in PreWriteRecord event.

    Or you can simply place the script in a Business service and call the Business Service in BC pre write record event instead of writing the script on BC itself.

    Thanks

    NR

  12. Use script under BusComp – PreWriteRecord event. And this condition has to execute only for the new records created. For set a profile attribute on BusComp_NewRecord event, get the same in PreWriteRecord event.

    Or you can simply place the script in a Business service and call the Business Service in BC pre write record event instead of writing the script on BC itself.

    Thanks

    NR

  13. Siebel will not allow to have more than one primary key for a table. Can you please provide any alternate soultion to make another column as unique apart from row_id?

    Thanks

Leave a Reply

Contribute