How to filter in-basket base on service responce
var data= {};data = {
"queueName":"ONL_DVKD",
"inbasketName":"DVKD",
"hideFilterUI":false,
"queryFilter":"(ONL_Pos_cd like :A)",
"queryFields":[
{
"name":"ONL_Pos_cd",
"type":"xs:string",
"value":"*"
}
],
"hideLockedByOther":"true"
};
require(
[ "icm/base/Constants",
"icm/model/properties/controller/ControllerManager",
"ecm/model/Request" ],
function(Constants, ControllerManager, Request)
{
var params = {};
params.repositoryId = "icmcmtos";
params.repositoryType = "p8";
params.queryType = "CM_UserInfo";
params.CM_UserName = ecm.model.desktop.userId;
Request
.invokePluginService
(
"ICMCustomPlugin",
"QueryDocumentService",
{
requestParams : params,
requestCompleteCallback : function(
response)
{
console
.log(
"response: ",
response);
userPoscode = response.CM_Poscode;
console
.log(
"userPoscode: ",
userPoscode[0]
);
tmpposcode=userPoscode[0];
if (tmpposcode==="110000" || tmpposcode === undefined ||tmpposcode === "")
{
console
.log(
"hoi so: ",tmpposcode
);
data.queryFields[0].value = "%";
}
else
{
if (tmpposcode.substr(4,6)==="00")
{
console
.log(
"chi nhanh: ",tmpposcode.substr(0,4)
);
data.queryFields[0].value = tmpposcode.substr(0,4) + "%";
}
else
{
console
.log(
"pgd: ",tmpposcode
);
data.queryFields[0].value = tmpposcode;
}
}
}
}
);
}
);
var model = icm.model.InbasketDynamicFilter.fromJSON(data);
var modelArray = [];
modelArray.push(model);
console
.log(
"model_bug: ",
model
);
return {"dynamicFilters":modelArray};
Không có nhận xét nào:
Đăng nhận xét