Product Configurator – SetUIOption API

This is in continuation with my earlier post about SetUIOption API which can be used to present the dynamic UI in Product Configurator.

In this post I am going to give examples explaining the syntax and the usability of this service.

SetUIOption is a method of a vanilla business service called “Cfg Web UI Service Loader” which is responsible for rendering the UI of Product Configurator. This service can be invoked just like any other business service.

General syntax of invoking the service is as following.

var  inp = TheApplication().NewPropertySet();
var out = TheApplication().NewPropertySet();
var svc = TheApplication().GetService(“Cfg Web UI Service Loader”);
inp.SetProperty(“1-77709”,”UI Name”);
Svc.InvokeMethod(“SetUIOption”,inp,out);

One Important thing  to note here is.

inp.SetProperty(“1-77709”,”UI Name”);

This is what makes the Dynamic UI Work. We need pass an input argument to SetUIOption Method telling it which UI should be displayed. The Syntax of the input argument is

  • Row Id of the Product you have created
  • Name of the UI you have given

To explain this better, these are steps I am going to follow to display the dynamic UI.

  • Create 2 UI in Product Configurator.
  1. Simple UI
  2. Complex UI.
  • Note down the Row Id of the Product.
  • Edit the Configurator Load workflow to include call a Business Service as First Step.
  • Put my logic in business service and call Cfg Web UI Service Loader with appropriate input arguments. Which in this example will be as following

if( val == 1 )
{
   var  inp = TheApplication().NewPropertySet();
var out = TheApplication().NewPropertySet();
var svc = TheApplication().GetService(“Cfg Web UI Service Loader”);
inp.SetProperty(“1-77709”,”Simple UI”);
Svc.InvokeMethod(“SetUIOption”,inp,out);
}
else
{
   var  inp = TheApplication().NewPropertySet();
var out = TheApplication().NewPropertySet();
var svc = TheApplication().GetService(“Cfg Web UI Service Loader”);
inp.SetProperty(“1-77709”,”Complex UI”);
Svc.InvokeMethod(“SetUIOption”,inp,out);
}

Hope this will clear up things.

4 Responses to Product Configurator – SetUIOption API

  1. Hi Neel,

    Thanks for your this post, it helped me a lot in implementation.
    Now i have a requirment, that in the nested customizable product as well i have to set one UI.
    Can you please guide me how can i achive that, through eConfigurator script or some way.
    What i tried is to create the UI in Nested product with the same name as that in main product but that too is not helping.And other way could be to setUI Option again before invoking the nested product,but i was not able to achive it, as i am not familiar with the events inside configurator and also how to write script inside.
    And also if you can guide me to some technote on Script inside econfigurtor.

  2. Hi Neel,

    Thanks for your this post, it helped me a lot in implementation.
    Now i have a requirment, that in the nested customizable product as well i have to set one UI.
    Can you please guide me how can i achive that, through eConfigurator script or some way.
    What i tried is to create the UI in Nested product with the same name as that in main product but that too is not helping.And other way could be to setUI Option again before invoking the nested product,but i was not able to achive it, as i am not familiar with the events inside configurator and also how to write script inside.
    And also if you can guide me to some technote on Script inside econfigurtor.

Leave a Reply

Contribute