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 = "";
Sirisha · 810 weeks ago
Can you please provide me more information on this requirement. Where and which event can you write this code in? Also is it possible to hide a control on the configurator UI based on the conditions?
Thanks
Sirisha
Tejeshwer 34p · 810 weeks ago
To make it work, you would have to set an profile attribute on Customize button click, that you can do with runtime events or scripts.
And yes it is possible to hide the controls conditionally for this you would have to do lots of coding in the js file, but before that you must have good knowledge of HTML and JS.
roshini · 805 weeks ago
canu you please let me know if we can expose custom columns in the Product configurator .
Thanks,
Roshini
Tejeshwer 34p · 805 weeks ago
roshini · 805 weeks ago
Thanks for ur reply.
Actually we are trying to find if there is any way to display Asset number in the Product configurator during the change order process?
Thanks,
Roshini
Tejeshwer 34p · 805 weeks ago
1. Set profile attribute with the asset number on configurator load and then set an attribute using the configurator intialize script and show this attribute on UI.
2. Set profile attr as above and in configuator templates show it wherever you want. message area,header, footer etc...
If i would have to chose then i would go for the second solution as it won't require to create additional attirbute.
please share if this works for you!
Amitabh Misro · 768 weeks ago
To make the configurator session read only means to not allow user to save any chnaged configuration back.
In our implementation, we have used Inline attributes along with regular attributes view and as per your provided approach, all text boxes will be disabled as per profile attribute.
How will this stop user from adding new product instances by clicking on Add Item control??
Can we not use the Profile attribute to simply disable the Done Button by making chnages in the eCfgTopLevelButtonsJS.swt file.
Since we are using ABO, Save button as such doesnt work and we have disabled all buttons except Done and Cancel.
Please let me know your thoughts.
Thansk and Regards,
Amitabh Misro
Tejeshwer 34p · 768 weeks ago
Products usually shown in drop down thus you need to edit showCombo method for this.
you can also disable the done button but then user wont be able to go back to his quote or order. Choose solution that suits you best.
Amitabh Misro · 768 weeks ago
I tried this approach but the section in eCfgTopLevelButtonsJS.swt where we can enable/disable buttons dont seem to handle if else conditions.
After making changes, i see the if else statement also in configurator UI.
I will the approach provided by you and test the solution.
I really appreciate your quick response on my queries, not only for this issue but also one other on restricting attribute length in configurator.
Thanks and Regards,
Amitabh Misro
Tejeshwer 34p · 768 weeks ago
and i have already replied and updated the post on restricting the attribute length.
Hope it helps.
Amitabh Misro · 768 weeks ago
Need some help from you.
The statement to fetch the profile attribute is not working.
The statements in js file in ShowtextBox function are not executed after adding this specific statement.
Otherwise, by having a variable harcoded to Y , i have been able to make the entire configurator read only.
Please suggest.
Thanks and Regards,
Amitabh Misro