[progress Communities] [progress Openedge Abl] Forum Post: Re: [4.2] - Rbf_selectquery2...

  • Thread starter Thread starter Santosh Patel
  • Start date Start date
Status
Not open for further replies.
S

Santosh Patel

Guest
You could cache your picklist data on client-side in browser session storage and resolve picklist codes using that. if (!sessionStorage.getItem('DPickListField')) { rbf_getPicklist('RBObjWithAllFields', 'DPickListField', -1, function(data) { if (data && data.length>0) { var pickListFieldData = {}; for (var i=0; i<data.length; i++) { pickListFieldData[data.id] = data.name; } sessionStorage.setItem('DPickListField', JSON.stringify(pickListFieldData)); } }); } function resolveDPickListField(id) { var data = JSON.parse(sessionStorage.getItem('DPickListField')); return data[id]; } DPickListField - integration name of your picklist field RBObjWithAllFields - integration name of your object Use resolveDPickListField method to resolve the pick item names without having to make an API call. Storing of data would be a single call per user session. The only caveat is around change to the picklist field definition. You can handle that in resolve method. When a resolution fails make the getPicklist call again to fetch fresh data once and if it still does not resolve then it is an invalid id.

Continue reading...
 
Status
Not open for further replies.
Back
Top