Most of us must have come across the requirement in Siebel to avoid Duplicates in a Business Component for a particular field. Every time when we get such requirement, without thinking on configuration we go for Scripting in Pre_Write Record of Business component. Here is an approach using configuration and it really helps.
Scenario: There is a BC as a child of an Account Profile BC; child BC contains a field - Stop Type. This field is having LOV with 4 values, it should not allow duplicate Stop Type. Without any solution the data looks like –
Before going for the actual solution, let’s see what all possible solutions do we have:
1. Scripting: The easiest and most commonly followed solution is to write Script in an event to create a new instance of current BC. Search for records by giving using ‘active’ Stop Type. Use count Records and then throw Error via Raise Error. Hence cancelling operation.
2. Index: Even this is commonly followed i.e. to create an Index on table level but if you have multiple BCs based on same table you might screw up other BC as well. As in my case the table is S_ORG_EXT_XM which is used by many other Business components. Also sometimes the requirement is to have unique values in multiple fields. It becomes a tough choice. Moreover, the Error which will be thrown on UI would be from Database hence losing control over Error String
3. Use an Out of Box User Key Column like ‘Name’ which allows only unique values. But again you can’t have enough columns.
4. The Best Solution is to use below simple configuration in Child BC :-
Go to Child BC and create a Calculated Field with below Value.
Step 1: BCHasRows("Account", "SNI Account Service Profile","[SNI Profile Id]='"+[SNI Profile Id]+"'"+" AND [SNI Stop Type]='"+[SNI Stop Type]+"'","All")
As we know that BCHasRows returns Y or N whether records exist in BC or NOT based on Search Spec.
Syntax: BCHasRows(BO,BC,searchspec,Visibility)
Here are the details:
i. Account is BO
ii. SNI Account Service Profile is BC in which I want to search. It’s the current BC as well
iii. Explanation of Search Spec (This is the trickiest part)
SNI Profile Id is the Field in Child which contains Id of Parent. This field is always in the link as Destination Field
SNI Stop Type is the field which I want to avoid duplicates
The search spec says search in SNI Account Service Profile BC on field SNI Profile Id which matches current record’s profile Id and field SNI Stop Type which matches current record’s Stop Type.
iv. All is the visibility used for search
v. On Stop Type field add below validation and validation Message
NOTE: Calculated Field will contain ‘Y’ when a Stop Type just added already exists in BC.The field on which you want to avoid duplicates. Add NOT of calculated field created in step 1. Because Validation Message will fire only when its value becomes False. If BC has existing records then Calculated Field will be Y. At that Time validation will go N and Message will pop.
Siebel
To Avoid Duplicate Field Values In A Field Of Business Component |
Drill down from a control in Form Applet Scenario: Field Name IDC Join S_ORG_EXT_X Column ATTRIB_09 (take any column for this) Name IDC Method Invoked Drilldown HTML Type Link Caption – String Override IDC Field IDC Name Drilldown Value TRUE Name IDC Hyperlink Field IDC View Account Detail - Contacts View |
Drill down from a control in Form Applet Scenario: Field Name IDC Join S_ORG_EXT_X Column ATTRIB_09 (take any column for this) Name IDC Method Invoked Drilldown HTML Type Link Caption – String Override IDC Field IDC Name Drilldown Value TRUE Name IDC Hyperlink Field IDC View Account Detail - Contacts View |
EIM Tuning to improve performance Through EIM process we load bulk amount of data from an external system to Siebel base tables. The performance of these EIM |
Disable the button to prevent the double click in Siebel Requirement: We have scenario like where we have payment interface which has been triggered by Payment button on Payment applet. Now customer want to make sure this button would be pressed only once till the request is not get processed successfully.
|
How to display Confirmation Popup Message without Scripting in Siebel Here is the solution to implement the Confirmation popup applet (OK/Cancel) without Script in Siebel. This solution is applicable for both type of application (Standard and High Interactive application)
For displaying and invoking this custom button follow the basic configuration steps. After implementing this solution onbutton click system would popup 'Are you sure you want to delete this facility record along with all child details?' message with OK and Cancel option. |
Using XSLT and Siebel builting methods to remove the null tag from Siebel Message A lot has been said and written about removing null tags in xml messages. Any integration ace will always suggest to go for XSLT to transform XML while an siebel eScript enthusiast will defend stating business service will be ideal way to achieve this. But a laggard like me is always in search of solution which is easier to implement and flexible enough to handle frequent changes. After peppering siebel forums one of my friend came up with devilicious idea of using the data mappers itself to remove the null tags. As per siebel booskshelf: "The Integration Component Fields list displays the list of fields for that component. Note the system fields Conflict Id, Created, Id, Mod Id, Updated, operation, and searchspec in the list. This setting prevents the EAI Siebel Adapter Query and QueryPage method from outputting these fields." It says that system fields are not the part of output XML. Any integration field of type "System" is not included in the ouput siebel message of EAI Siebel Adapter. So key here is, if the tag is null we can replace it in datamapper with any system field. Consider a scenario if description is blank in Service Request then we don't want Description Tag send to external system in the outbound message. In order to remove the null tag we can use following expression in the DataMap: IIF([Description] IS NULL,[Created],[Description]) In this Description and Created are integration fields of IC. Created is of type System, so if description is coming as null then we are passing Created. Here as Created is system field it will not come up in the ouput message after conversion. Now one may say how to remove entire instance if all the tags are null. Siebel also has solution to that. Try out Source Search Expression for this scenario. Other Approach: XSLT to remove the null tag from Siebel Message <!-- <?xml version="1.0" encoding="UTF-8" ?> --> |
Browser Scripting in Standard Interactivity I have never been fan of SI applications because of the unpredicatble limitations it offers. But however recently one of my friend cum life saver,Vinay Jain aka Vivacious,asked me a trivia and i was forced to jump into the ocean. Browser scripting incapabilities in SI mode is wastly documented but it is not mentioned how a well written server side code can compensate for the browser scripting.The reason that the browser script code doesn't run in standard interactivity client is because of unavailability of Siebel objects and methods.However Siebel is generous enough to provide some DOM events which could be effectively used to carry out desired task.Sometimes it is necessary to fetch field values in the browser code or to click button that navigate user to different link. Lets try to explore these scenarios in this post. Problem Statement: Need to open a url on click of button on SR detail applet which requires SR number to be appended as argument. Solution: The very first challenge here is to get the value of SR#. As the buscomp methods are not supported we have to go to traditional java script to fetch the value of SR#. For this we need to find the HTML attribute id of the control SR# displayed on the applet. This could be accomplished in two ways: 1 - Populate the HTML Attribute property in the Control to "id=SRNumber" in the form applet for the Control SR#. 2 - Right click the applet and View Source. Determine the SR# control and check out for Siebel generated html attribute. This will somewhat look like "span id='s_5_1_23_0'". Now next step is to open the Browser Script for the "CUT Service Request Detail Applet (eService)" and navigate to the On click event of the button "VJ". Add following piece of code. Compile and confirm. function Edit__0__Control__VJ__onclick (applet, id) So far so good. But the words "Luck" and "Siebel eService" have not always sat comfortably together for me. Trouble starts when the field under equation is not displayed on the applet or is read only. In either of scenarios it is not possible to fetch the value by using getElementById function. Another fascinating approach as suggested by support web is to generate HTML on the server side only for the control. In this approach we can get value from any field or any profile attribute. 1 - Write a dummy code on the On click event function Edit__0__Control__VJ__onclick (applet, id) 2 - Open the server side script and go to "WebApplet_ShowControl" event. The main idea here is to re-generate the HTML for the button. if ((ControlName == "VJ") && (Property == "FormattedHtml")) var a = HTML.indexOf("onclick"); Happy Scripting!! |
Activate Multiple Workflows with Search String in Siebel Sometime during Siebel deployment from one environment to another environment or for vanilla functionality like Siebel Order management we need to activate set of workflows one by one. This process might take huge time and could bring human errors like Admin people might forget to activate one or more workflow unknowingly.
How to Use:
|
Pre-Deploying ActiveX Controls for Secure Environments Pre-Deploying ActiveX Controls for Secure Environments
NOTE: You should have one object tag entry for each ActiveX control you are predeploying. Delete or comment out lines for any object tags you do not need (that is, those representing controls you are not predeploying). Text in the HTML file can be commented out using this notation: <!--CONTENT TO BE COMMENTED OUT-->.
|