Showing posts with label Product Configurator. Show all posts
Showing posts with label Product Configurator. Show all posts

Get Attribute Value - Product Configurator

There is no method out of the box available in Siebel Product Configurator that can be used to get attribute value. For this one of my team member have written this code which traverses the product structure and return the attribute value as string.

Debugging Siebel eScript - Write Property Set to file

This is one of the tricks that i use to debug Siebel scripts. It is really useful if you are working on the product configurator. As most of the events in configurator have property set as argument to it, and there is no debug window to see runtime property values for the events.


How to restrict length of an attribute - Part 2

In Continuation of my earlier post, for constraining the length of attribute, in this post i am explaining what other solution is available in out of the box Siebel application for this problem.
Attribute selected is an event which gets triggered before any attribute's value is updated, this events sends the information of the attribute and the value as property set argument.
XML representation of property set would look something like :
*from bookshelf

Now if this property set is available as argument then i think writing script to constrain its value is not a big task.

I have created this snippet, it worked in my case hope it works for others also.

function Cfg_AttributeSelected (SelectedAttribute)
{
 var temp = SelectedAttribute.GetChild(0);
 var sStr =  temp.GetProperty("NewVal");
 TheApplication().RaiseErrorText("Error");
}

Siebel Product Configurator: How to restrict attribute length?

Requirement
We have one requirement in our project, that we need to restrict the value of one attribute to five characters only.

In Siebel vanilla application we tried to implement this without doing scripting, but failed.

Solution we used:
This requirement can be achieved in two ways:

1. By Scripting in Attribute Selected event. update or 
2. Creating Custom User Properties for product configurator.

I will be discussing the second solution in this post. It will involve editing of cfgui.js . For more info my older posts 

1. Find the following code in cfgui file.


try to find text: function showtextbox.
Updated Section:
2. Replace the code with :


3. Create user property on the root product like:



and you are done!

Now clear cache of browser and restart the client.

Attribute on which you have defined the property will automatically be constrained by the number of characters that you have provided in property.


Hope its is understandable.

For more info how it worked, look at the maxlength property here.

Read only Siebel Product Configurator.

Requirement:
Requirement is to make the Configurator session read only conditionally, so that user should not be able to edit the product configuration but he should be able to view the configuration inside the configurator.

Solution
This requirement can be implemented by editing vanilla/custom JavaScript libraries of the Product Configurator. The most of the work in showing the UI is done by cfgui.jsfile.

Cfgui.js is a javascript library that converts the swe tags to the HTML tags that shows up as UI in siebel application.

For Example:

Here is one code in the swe template :
< id="swe:IncPAId+853" cfgfieldname="AttValue" cfghtmltype="CfgTextBox" forcerefresh="Y" cfgjsshow="showTextBox" cfgjsupdateselection="updateSelectionInfoForAttribute" >


now in cfgui this swe code is converted in to HTML like this:

innerHTML = " < input type=\"teext\" " + "value=\"" + displayValue + "\" " + "id=\"GRPITEM" + _pipe + grpItemId + _underscore + "ATTTYPE" + _pipe + "TEXT" +"\"" + " onchange='processInput(\"GRPITEM" + _pipe + grpItemId + _underscore + "ATTTYPE" + _pipe + "TEXT" +"\", \"\", \"text\")' />";

now when you closely go through the code, you will create the following string at the output:

< type="”text”" value="”Somevalue" id="”generated" onchange="”processInput(“Some arguments") >


and that looks like very basic html snipet, which can be edited to make control read only by adding disabled=true in the js code tag.

To make it work conditionally, we can check for the some profile attribute inside the js file like this:

var readonly = top.theApplication().GetProfileAttr("ReadOnly");
top.theApplication().SetProfileAttr("ReadOnly","N");

if (readOnly == "Y")
innerHTML = "";

else
innerHTML = "";

Editing conflict page of Siebel Product Configurator


Rquirement:To remove proceed button from the conflict page of Siebel Product Configurator.

Background 
Siebel Product Configurator throws and error page commonly known as Conflict page(see below) to the user when user tries to select wrong configuration inside the configurator.


In conflict page user have uption to undo his last action or proceed by removing the object that was constraining his last selection.


Some times objects are added by configurator scripts, and it is required that user should not be able to delete the products or attributes that are added from scripts. 


Solution
This problem can be solved by editing the cfgui.js javascript file .

This file constains javascript code that renders the whole UI of product configurator.The script in the file contains methods that convert the swe tags of the templates file to the HTML tags that shows up as UI.  You can find this file in the public\lang_code\siebel_bulid_number\SCRIPTS directory of siebel web client installation.

On the siebel server these files can be located in the SWSE\PUBLIC\lag_code\siebel_build_number\ SCRIPTS folder

To remove the Proceed button you need to edit the showConflict funtion in this file, to set the display property of proceed button to none.

from script:

switch (conflictType)
   {
      case "Conflict":   
         buttonObj = document.getElementById ("RemoveFailedRequests");
         if (buttonObj)
            buttonObj.style.display = "";

to :

   switch (conflictType)
   {
      case "Conflict":   
         buttonObj = document.getElementById ("RemoveFailedRequests");
         if (buttonObj)
buttonObj.style.display = "none"; 

After these changes, clear the cache of internet explorer and restart the client. Now on proceed button will not visible on the conflict page of the configurattor(see below).


Removing vanilla buttons from the Product Configurator UI

Requirement:
Remove vanilla buttons from the configurstor UI.






Solution:
Solution doesn't involve any configuration in Siebel tools or compilation, it requires editing of the confgirator vanilla template files directly.

Buttons like Done , verify, reprice etc are displayed on confgurator UI as a part of  eCfgTopLevelButtonsJS.swt  template file. 

Buttons in this file are displayed inside the table cells and luckily there not much of css style attached on them.  

So to remove the buttons we can define a style property for each cell that we want to remove. style="display:none"


For Example to remove the Save button from the UI, you need to change the code from :

<td nowrap>
<swe:control id="swe:Cancel" CfgUIControl="Cancel" CfgHtmlType="MiniButton" InvokeMethod="PrevView"/>
</td>
to:

<td nowrap style="display:none">
<swe:control id="swe:Save" CfgUIControl="Save" CfgHtmlType="MiniButton" InvokeMethod="SyncInstance"/>
</td>


Structure of Siebel Products

Before starting with the creation of siebel products , one should be familiar with the strucutre of products.


I have tried to depict it as a diagram. A product modelled in siebel is composed of Attributes (which are inherited from the product classes) and child products that have thier own set of attrbutes and can have their grand child products also.

This whole structure is created using products relationships and classes. Scripts and Constraints control the way the user can select the product and order it.

At first look it seems to be very simple. But it needs lots of configuration to show a product inside the configurator and enforce all the business rules in it.

I will take an example of an a dummy product and show how to configure it from modelling to Displaying it on UI in my coming posts.

Exploring Siebel Product Configurator

Siebel with version 7.x drastically changed Order Management and product Configurator by introducing a new GUI based Product Configurator and catalog management processes.

For those who are completely unaware of this new terminology should look at Neel’s Blog for a beautiful explanation. It is basically a tool that is built inside the Siebel that allows users to configure the product using graphical interface. It enables user to configure the products based on business rules and moreover the product compatibity rules.

For Example If a product is visible to a partner and hidden from other then it’s a business rule. But there are some rules specific to the products. For example if user is configuring a notebook computer then he must buy power supply compatible to the model selected, or if user have selected Windows Vista then computer must have at least 2 GB memory in it.

Product Configurator is closely coupled Siebel Pricing engine. It helps to show the price of the product inside the Configurator immediately on selection of any product in the Configurator.

Before going in to detail of configuration one can refer Neel’s blog part 2 on product configurator.

Few words of caution for new Product designers:
1. As divisions in Siebel, product are once created can’t be deleted in the Siebel although they can be made hidden in the application.
2. They are completely built inside the Siebel Client, not in Siebel tools.
3. They are migrated from one environment to other using Workspace import export utility.
4. To make any product visible in the system (visible in the pick applets), designer must release product once and end date of release should be valid.
5. There are several ways to make product hidden in the system, one of them being the orderable flag. If it is unchecked product won't be visible in the pick applet across the applications.



Next Post: How to create and configure products in Siebel?

Other Siebel Blogs

siebel-admin-l @ IT - toolbox

siebel-dev-l @ IT - toolbox