on 01-09-2012 9:20 AM
Hi,
We have a requirement where we need to make the u2018Agreement Maximumu2019 field as mandatory for all the MA templates which have the Terms tab. I tried to do this through Page customization. But in this case, the system throws mandatory field required error even while trying to save MAs which do not have Terms tab.
Does this need to be done through scripting? If yes, can you please give details.
Thanks
Moumita
Hi
Your requirement can be met through scripting.
You can verify document type and field value. In case for a particular document type, your field value returns a NULL, you can raise an exception thereby making the field mandatory. You can either use a document lifecycle management script or a field validation script to achieve this.
Regards
Mudit Saini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Mudit.
There is a slight change in the requirement, the 'agreement maximum' should be made mandatory for all subagreements, which makes it simpler. But I am using below field validation script, but I am unable to fetch the value of the field using below code. Both getFieldValue() and doc.getLimitValue() returns me the value "******agreementMaxValue*****-2147483540:601:AUD:10.00" whereas I want to get only the field value i.e. '10.00' to do a null check. Here, the null check fails as even if the field doesn't have any value the methods always return me "*****agreementMaxValue******-2147483540:601:AUD:"
I am using sourcing v7.
**********************
// Get logger
logMsg =Logger.createLogMessage(session);
agreementMaxValue = getFieldValue();
Logger.info(logMsg.setLogMessage("******agreementMaxValue******" + agreementMaxValue));
agreementMaxValue = doc.getLimitValue();
Logger.info(logMsg.setLogMessage("******agreementMaxValue******" + agreementMaxValue));
if (agreementMaxValue==null) {
throw doc.createApplicationException(field.getAttributeId(),"Error");
}
Appreciate your help.
Regards
Moumita
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.