(we have to check the details given by the user in textbox is existing ,if it is so we want to populate our text boxes from the same table which we are checking .if it is not there in the table then we have to check with other table, if the contents are no there in the second table also then we have to simply leave ..)
function generateupperlowerlimit()
{
if((expense_category1.getValue()!="")&&(expense_subcategory.getValue()!="")&&(employee_id1.getValue()!=""))
{
var req = GetAppaUserLevelAuthforUpperLowerObjectModel.getMethodRequest();
cordys.setTextContent(cordys.selectXMLNode(req,".//*[local-name()='EMPLOYEE_ID']"),employee_id1.getValue());
cordys.setTextContent(cordys.selectXMLNode(req,".//*[local-name()='EXPENSE_CATEGORY_CODE']"),expense_category1.getValue());
cordys.setTextContent(cordys.selectXMLNode(req,".//*[local-name()='EXPENSE_SUBCATEGORY_CODE']"),expense_subcategory.getValue());
GetAppaUserLevelAuthforUpperLowerObjectModel.setMethodRequest(req);
GetAppaUserLevelAuthforUpperLowerObjectModel.reset();
if((cordys.selectXMLNodes(GetAppaUserLevelAuthforUpperLowerObjectModel.getData(),".//*[local-name()='tuple']").length>0)&&(user_auth_matrix_id1.getValue()==""))
{
var upper1=cordys.getNodeText(GetAppaUserLevelAuthforUpperLowerObjectModel.getData(),".//*[local-name()='UPPER_LIMIT']","","");
var lower1=cordys.getNodeText(GetAppaUserLevelAuthforUpperLowerObjectModel.getData(),".//*[local-name()='LOWER_LIMIT']","","");
upper_limit1.setValue(upper1);
lower_limit1.setValue(lower1);
application.notify("User Authorization already defined for this combination");
}
else
{
var req2 = GetAppaExpenseAuthMatrixUpperLowerObjectModel.getMethodRequest();
cordys.setTextContent(cordys.selectXMLNode(req2,".//*[local-name()='DEPT_LONGNAME']"),dept_longname.getValue());
cordys.setTextContent(cordys.selectXMLNode(req2,".//*[local-name()='DESG_NAME']"),desg_name.getValue());
cordys.setTextContent(cordys.selectXMLNode(req2,".//*[local-name()='EXPENSE_CATEGORY']"),expense_category1.getValue());
cordys.setTextContent(cordys.selectXMLNode(req2,".//*[local-name()='EXPENSE_SUB_CATEGORY']"),expense_subcategory.getValue());
cordys.setTextContent(cordys.selectXMLNode(req2,".//*[local-name()='ACTIVE']"),"Y");
cordys.setTextContent(cordys.selectXMLNode(req2,".//*[local-name()='STATUS']"),"Approved");
GetAppaExpenseAuthMatrixUpperLowerObjectModel.setMethodRequest(req2);
GetAppaExpenseAuthMatrixUpperLowerObjectModel.reset();
if(cordys.selectXMLNodes(GetAppaExpenseAuthMatrixUpperLowerObjectModel.getData(),".//*[local-name()='tuple']").length>0)
{
var upper=cordys.getNodeText(GetAppaExpenseAuthMatrixUpperLowerObjectModel.getData(),".//*[local-name()='UPPER_LIMIT']","","");
var lower=cordys.getNodeText(GetAppaExpenseAuthMatrixUpperLowerObjectModel.getData(),".//*[local-name()='LOWER_LIMIT']","","");
upper_limit1.setValue(upper);
lower_limit1.setValue(lower);
}
}
}
}
No comments:
Post a Comment