How to make location in Alphabetical order

Akshaya14
Tera Contributor

Hi Team,

I have one requirement where in location need to visible in alphabetical order while making reservation in WSD. Please help where need to check in widget coding. PFB Like this I want to display but for me it is not in alphabetical order. 

Akshaya14_0-1690971992330.png

@Luke Ghamloush @jdesouz @rcard11 

3 REPLIES 3

Peter F
Tera Contributor

I believe the WSD Reservation widget will default to sort using the "Order" values in each step of the hierarchy from the tables for WSD Region, WSD Site, WSD Campus, and WSD Building. And then if the "Order" values are empty, the I believe default sort order is supposed to be alphabetical by Name (or possibly by Title).

Hi Peter,

 

Thanks for the reply, Actually  in my current project they modified the OOB widget. Since I'm new to widget configurations want to know where need to check.

this is part of my widget server script here I could see order by 

function getIndoorMapCampusIdArr(){
        var mapCampusExternalIdToBuildings = {};
        var buildingGr = new GlideRecord(BUILDING_TABLE);
        buildingGr.addActiveQuery();
        buildingGr.addQuery('wsd_source',sn_wsd_core.WPConstants.WSD_SOURCE.INDOOR_MAPS);
        buildingGr.addNotNullQuery('external_id');
        buildingGr.addQuery('is_reservable',true);
        buildingGr.orderBy('order');
        buildingGr.orderBy('name');
        buildingGr.query();
        while(buildingGr.next() && buildingGr.campus.external_id){
            if(!mapCampusExternalIdToBuildings.hasOwnProperty(buildingGr.campus.external_id))
                mapCampusExternalIdToBuildings[buildingGr.campus.external_id] = [];
            mapCampusExternalIdToBuildings[buildingGr.campus.external_id].push({
                sys_id : buildingGr.getUniqueValue(),
                externalId : buildingGr.getValue('external_id'),
                displayValue : buildingGr.getDisplayValue()
            }); 
        }
        return mapCampusExternalIdToBuildings;
    }
    But still having issues. Please help me on this.

Hi Peter F, Please let me know where I need to check this. which script.