method i fire, let say in form.psCore_User.
var vTableName = foundset.getTableName();
var vPKNames = [“securitycapability_id”, “user_id”];
var query = globals.gCore_m_getQueryString(vTableName, vPKNames);
var vSQLParams = new Array()
vSQLParams[0] = securitycapability_id;
vSQLParams[1] = fUserID;
forms.psCore_UserSetupFormRightsDialogs.foundset.loadRecords(query, vSQLParams);
forms.psCore_UserSetupFormRightsDialogs.doEdit();
application.showFormInDialog(forms.psCore_UserSetupFormRightsDialogs, -1, -1, -1, -1, “User Rights”, false, false, “UserRights”, true);
forms.psCore_UserSetupFormRightsDialogs.doEdit();
application.setStatusText(“Loading data for valuelist …”);
var vListName = elements.fld_action_rights_target.getValueListName();
var vListNameLevel = elements.fld_action_rights_level.getValueListName();
// predefined array name
var vListNameSource = globals.gCore_m_UserRights(true, securitycapability_id, “mTarget”,
new Array(vListNameLevel, action_rights_level))
var dataset = application.getValueListItems(vListNameSource);
var vDisplayArray = new Array();
var vRealArray = new Array();
vDisplayArray[0] = “(All)”;
vRealArray[0] = “(All)”;
vDisplayArray[1] = “-”;
vRealArray[1] = “-”;
var vRealValue = foundset.getDataProviderValue(elements.fld_action_rights_target.getDataProviderID());
var vGotData = false;
var vLength = dataset.getMaxRowIndex();
if (vLength > 0)
{
var i = 0, j = 0;
if (vLength > 200)
application.updateUI();
for (i = 1, j = 2; i <= vLength; i++, j++)
{
vDisplayArray[j] = dataset.getValue(i, 1).toString();
vRealArray[j] = dataset.getValue(i, 2).toString();
if (vRealArray[j] == vRealValue)
vGotData = true;
}
}
if (!vGotData)
vRealValue = vRealArray[0];
if (application.getValueListDisplayValue(vListName, vRealValue) != null)
foundset.setDataProviderValue(elements.fld_action_rights_target.getDataProviderID(), vRealValue);
application.setValueListItems(vListName, vDisplayArray, vRealArray);
The above method cause input validation fail when the valuelist data length longer than 24.