Skip to main content

Dear All,

 

I need to populate some specific selected global code values in a drop down fields in web client.  

Lets say in Global code I have code values like

Code_Value1,

Code_Value2,

Code_Value3,

Code_Value4

 

Some time I need to display  Code_Value1, Code_Value2  and some time Code_Value2, Code_Value3,Code_Value4. 

 

Can anybody help me on this to achieve the same. 

In Mobile there is a populatelistQuery  function . Same Functionality we need to achieve in Web client. 

 

Thanks & Regards

Rajat

Hi @TatRajatM ,

Good day to you!

You could achieve this by configuring a custom screen when Lookup XML for the drop down field is correctly specified. Follow the below steps. For an example, I have taken ‘Task’ screen.

1. Go to UI Designer in Smart client & open ‘Task’ screen

  1. Click on the dropdown field you wish to configure
  2. On the top left corner of the screen, edit the lookup XML as per your need
    1. Select the correct Primary table & click on Add Data Constraints.
    2. Specify the column, constraint & value
      1. Save the screen & ‘Refresh cache(full).
      2. Assign the screen to a Role & then the Role to the person record
      3. Relogin & see for the desired values to popup in the dropdown field

        ​​​​​​​Hope this helps. Thank you very much! :)

Hi @Charith Fernando, Hi @TatRajatM,

 

I had a similar requirement so i set up my custom screen. It seems that it works well in smart client but, in web client, my drop-down fields doesn’t take into account the data constraints..

 

It’s working for you @TatRajatM ?

 

Best regards,


Dear All,

 

I need to populate some specific selected global code values in a drop down fields in web client.  

Lets say in Global code I have code values like

Code_Value1,

Code_Value2,

Code_Value3,

Code_Value4

 

Some time I need to display  Code_Value1, Code_Value2  and some time Code_Value2, Code_Value3,Code_Value4. 

 

Can anybody help me on this to achieve the same. 

In Mobile there is a populatelistQuery  function . Same Functionality we need to achieve in Web client. 

 

Thanks & Regards

Rajat

Hi @TatRajatM 

Please see if below conversation helps you. I have given an example client script to filter a dropdown.

/Sanjeewa


Hi @SanjeewaJ,

 

since the link you shared is not accessible for customer, could you please post the information in this thread?  

 

Thanks in advance,

~Juni


@JuniSihombing 

 

Please see if you are looking for something like this. I just created an example with REQUEST entity. Which I am populating request statuses, based on request type.

Note that, this works only for web client. Since screen events are not working in smart client.

  1. Client script Example - SAJGLK_DYNAMIC_STATUS_DROPDOWN

showProgressIndicator();
var reqType = getControlValue('request','req_type');

var emptyOptions = t];
var options = createCodeTableOption('','');
arrayPush(emptyOptions, options);
setControlOptions('request', 'req_status', emptyOptions);

if(reqType == 'FIX') {
    var opt1 = ];
    arrayPush(opt1, createCodeTableOption('INVESTIGATE','Investigate'));
    arrayPush(opt1, createCodeTableOption('HOLD','Hold'));
    setControlOptions('request', 'req_status', opt1);
} else {
    var opt2 = }];
    arrayPush(opt2, createCodeTableOption('CANCELED','Canceled'));
    arrayPush(opt2, createCodeTableOption('CLOSED','Closed'));
    setControlOptions('request', 'req_status', opt2);
}
hideProgressIndicator();

  1. Attach the client script to screen.

UI Designer → Screen Events

 

  1. Test in WEB Client

 

 

 

Few points,

  • You can populate options from code tables using client script sql, rather hard coding
  • You have to handle the “Create New” record also in the script. Otherwise it will show only few options at creation as well.

Thanks a lot, @Shneor Cheshin!

 

~Juni


Reply