Populate region based on le group

Community Alums
Not applicable

Hi 

I want to populate regions based on selected le group.

If le group  =data privacy,then it must only populate region where le group is data privacy from table

as of now its  showing all regions from table.

3 REPLIES 3

Eshwar Reddy
Kilo Sage

Hi @Community Alums 

First, we need to identify the relationship between the group and the location. Based on this analysis, we can either write code or utilize the AutoPopulate functionality to retrieve the appropriate location.

Thanks
Esh

Community Alums
Not applicable

Region & Le group are from u_core_request.both have variable & field in table & record producer.I need a reference qualifier for this one

Bert_c1
Kilo Patron

sys_user_grmember contains the group users for all groups. sys_user had a reference field named 'cost_center' for the 'cmn_cost_center' table, which has a reference field named 'location' for the 'cmn_location' table. Anyway, I got a Dynamic Filter Option defined for that.

 

Screenshot 2024-10-16 101909.png

for the field's definition, I have the Reference defined as:

Screenshot 2024-10-16 101613.png

And the a script include with logic based on the value of the table's Group field.

Screenshot 2024-10-16 102120.png

 

Script logic will depend on how you get location values from a group value.

 

var groupLocations = Class.create();
groupLocations.prototype = Object.extendsObject(AbstractAjaxProcessor, {

	initialize: function() {
	},

	getGroupLocations: function (curRecord) {
		var groupID = curRecord.u_group;		// 'u_group' is custom reference field for sys_user_group

		var locations = [];
		// Logic to load an array of sys_id value of the desired cmn_location records

		gs.info("getGroupLocations: list = " + locations.toString());
		return 'sys_idIN' + locations.toString();
	},

    type: 'groupLocations'
});