
In a previous post I talked about how to add conditions to the Product Lookup in the SLX Live Grid used for the Opportunity and Sales order product tabs in SLX 7.5.4. The code for this really should be changed slightly, like so (non standard code shown in red):
function () {
var sCondition = ”;
var showError = function (msg) {
var msgService = Sage.Services.getService(“WebClientMessageService”);
if (msgService != null && typeof msgService !== “undefined”) {
msgService.showClientError(msg);
}
else {
alert(msg);
}
}
var service = Sage.Services.getService(“IntegrationContractService”);
if (service != null && typeof service !== “undefined”) {
if (service.isIntegrationEnabled) {
var bFoundOperatingCompany = false;
var bFoundSlxPriceList = false;
var clientContextService = Sage.Services.getService(“ClientContextService”);
if (clientContextService != null && typeof clientContextService !== “undefined”) {
if (clientContextService.containsKey(“OperatingCompany”)) {
var sOperatingCompanyId = clientContextService.getValue(“OperatingCompany”);
bFoundOperatingCompany = (dojo.isString(sOperatingCompanyId) && String(sOperatingCompanyId).length == 12);
if (bFoundOperatingCompany) {
sCondition = ‘AppId eq “‘ + sOperatingCompanyId + ‘” ‘ + “ActiveFlag eq true”;
}
}
var sError = “”;
if (!bFoundOperatingCompany) {
sError = “The Operating Company could not be determined.”;
showError(sError);
throw new Error(sError);
}
}
else {
sError = “The ClientContextService is unavailable.”;
showError(sError);
throw new Error(sError);
}
}
}
if (sCondition == “”) sCondition = “Status eq ‘Available'”;
return sCondition;
}
Subscribe To Our Newsletter
Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!
You have Successfully Subscribed!