Changing mandatory fields to nonmandatory in AIF

Hello all,

I came across a scenario where i need to make the mandatory fields(required) to nonmandatory in one of the document service.

The requirement was Biz dont want to pass few mandatory fields values but they want us to initialize the values to them through number sequences.

In this case by default, the schema gets generated based on the mandatory fields that are set as mandatory in the table level.

To change this we need to make the fields as non mandatory so that schema gets changed and biz need not pass the these field values to create the new record.

As you know we have a AxBC classes for every table, just go that class for the table in the query you want make the fields as non mandatory.

Override the method initMandatoryFieldsExemptionList and write the below code for the required fields.

protected void initMandatoryFieldsExemptionList()
{
super();
this.setParmMethodAsNotMandatory(methodStr(AxMROFunctionalLocationObject,parmObject));
this.setParmMethodAsNotMandatory(methodStr(AxMROFunctionalLocationObject,parmFunctionalLocation));
this.setParmMethodAsNotMandatory(methodStr(AxMROFunctionalLocationObject,parmValidFrom));
}

This should do the job for you provided when you redeploy the service that you want to see the changes for.

Happy Daxing….

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s