Learn how you can direct Connectivity Studio to meet your requirements and validate field length
Today’s brief tutorial shows you an example of how you can easily adjust STAEDEAN Connectivity Studio for Microsoft Dynamics AX to your business-specific needs.
Sometimes, you may want to validate the length of incoming fields during import. Connectivity Studio does not currently validate field length. However, you can easily gain that functionality by extending a document class. This tutorial describes how you can add field length validation to a text document during import. There are just two parts to this—extending the BisDocumentText and changing the handler for your text document.
You take the following steps:
// validate the field length
if (recordField.Type == Types::String &&
strLen(valueString) > recordField.FieldLength)
{
throw error(strFmt('Field \'%1\' exceeds maximum length of %2',
AxFieldName,
recordField.FieldLength));
}
6. Save the class and generate an incremental CIL file.
You do the following:
After you have changed the handler your text document will validate the field lengths and throws an error if a field exceeds the maximum field length.
Thanks for listening! I hope you are finding this little tutorial helpful in working with Connectivity Studio. If you need more information about the Business Integration Solutions, please contact us. If you have any suggestions for improving the tutorial, please let us know, and we will be happy to incorporate them when we can. Please contact STAEDEAN.