cancel
Showing results for 
Search instead for 
Did you mean: 

Field to be made mandatory for some types of Master Agreement

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

I have also tried to use agreementMaxValue = fieldValue; but it always returns me null.

Regards

Moumita

Former Member
0 Kudos

Hi

Use getPrice() function to get the desired value for e.g. doc.getLimitValue().getPrice();

Regards

Mudit Saini

Former Member
0 Kudos

Thanks a lot

Regards

Moumita