Highlighted
Respected Contributor.
Respected Contributor.
529 views

How to list values in combo box, based on priority field increasing order.

Hi Experts,

Currently I have two Combo box called Area and SubArea. Second combo box’s list value changes based on the value selected in ‘Area’ combo box. Below is the value given in subarea’s property window.

Value list Condition :  select( "subarea", "tablename", "area", [AreaID], "activestatus", true)

But the value in the subarea is listing in alphabetic order.

My requirement is to display the values based on a field called ‘priority’, this field contains numbers starting from 1 to 5. So values in subarea should be listed based on priority increasing order.

Any suggestions are appreciated.

Thanks & Regards,

Jithisha

0 Likes
10 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: How to list values in combo box, based on priority field increasing order.

What is relation between priority and subarea (or another words what order must be in sbarea for each of priority) ?

If that is what you want.

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: How to list values in combo box, based on priority field increasing order.

Hi Alarmus,

Thanks for the reply 🙂

For example: Consider the below table.

Capture.JPG

Below is the value given in subarea’s property window:

Value list Condition:  select( "subarea", "tablename", "area", [AreaID], "activestatus", true)

When I select car, subarea combo box value appears as

t1.JPG

It appears in alphabetic order.

But my requirement is to show subarea based on priority. I mean, Subarea with priority 1 should appear first.

 t2.JPG
Could you please suggest a way to achieve this.

Thanks & Regards,

Jithisha

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: How to list values in combo box, based on priority field increasing order.

Can you display your "tablename" where you select the data ?

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: How to list values in combo box, based on priority field increasing order.

Hi Alarmus,

Table name:  wpcausecomponent

 

Thanks & Regards,

Jithisha

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: How to list values in combo box, based on priority field increasing order.

Is the table wpcausecomponent shown in your first screenshot ?

 

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: How to list values in combo box, based on priority field increasing order.

Yes.. 

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: How to list values in combo box, based on priority field increasing order.

 While I propose this solution (the first thing that came to mind):

1) In FC for your form in Calculation (Initial true) set $wp.subarea.list=jscall("YourLIB.YourFunc", $file)

2) In your script define what GL must be returned from function (use IF with condition to know what GL must be returned)

3) So as you see you need set GL for all of your lists and in GL you can set what field to use for sorting

and almost forgot

4) set for subarea in form - $wp.subarea.list

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: How to list values in combo box, based on priority field increasing order.

Hi Alarmus,

Thanks for the reply.

Since we need to set GL for all of the list .. it will be tough for us as we have many list..

Could you please suggest an easy way to achieve this requirement.

Thanks & Regards,

Jithisha

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: How to list values in combo box, based on priority field increasing order.

Not so much, just make one GLlike this:

 


GL_01.jpg

And just change marked value and add new one...

 

 

although this is a static event in FC and you perhaps not suited.

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: How to list values in combo box, based on priority field increasing order.

Hi Alarmus,

Thanks for the reply.

We have 22 area's. So in that case we need to create GL for 22 list right?

This will be tough for us to mainatain. 

Could you please suggest some other way to achieve this requirement.

Thanks & Regards,

Jithisha

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.