Build-in Functions
Anveo EDI Connect has a lot of build in functions. Most of them are available in all mappings, some of them are mapping specific. You can use functions, for example, on source expressions and on conditionals. The build-in functions can be selected like any other function that is defined in the ANVEDI Callback codeunit.
The following functions are globally available:
TableName
Returns the count of record inside the filter.
Returns True, if there is no record inside the filter. In other words, the count is equal to zero.
TRANSMISSION
Whether the current transmission is flagged as test.
DATABASE
This function is dangerous. Please use this function only if you know what you are doing and it is absolutely necessary.
Commits the current database transaction and return always true. Using this function can break the error logging functionality of the mapping and can result in unwanted data in the database.
SYSTEM
Returns the current work date of Microsoft Dynamics NAV 2009R2 Classic.
Returns today’s date.
Returns the current time.
Returns the current date/time.
Returns a combined date/time information from two separate values.
The date part
The time part
Returns a calculated date. Please see Microsoft Dynamics NAV 2009R2 Classic development guide for more details.
The calculation expression.
The date on which the calculation is based on.
Calls the Microsoft Dynamics NAV 2009R2 Classic internal “FORMAT” function. Please see Microsoft Dynamics NAV 2009R2 Classic development guide for more details.
The source value.
The maximal length.
The format string or format number.
Gets a substring of the input. Calls the Microsoft Dynamics NAV 2009R2 Classic internal “COPYSTR” function. Please see Microsoft Dynamics NAV 2009R2 Classic development guide for more details.
The input string.
The start position. The first character is indexed with 1. If the position is higher than the input string length an empty string is returned.
The count of characters that should be returned. If the input is too short the substring from position to the end of the string is returned.
Return the count of characters of the input string.
The input string whose length is returned.
Concatenates all strings that are passed to this function. This function is special as you do not have to use all parameters. If you don’t configure a parameter, it will not be used.
The input string.
The input string.
The input string.
The input string.
The input string.
Removes characters from an input. Calls the Microsoft Dynamics NAV 2009R2 Classic internal “DELCHR” function. Please see Microsoft Dynamics NAV 2009R2 Classic development guide for more details.
The input string.
You can specify where you want to delete data:
At the begin of the string
At the end of the string
At any position
The characters to be deleted. If this parameter is empty the module will remove spaces.
Changes the input characters to the output characters. Calls the Microsoft Dynamics NAV 2009R2 Classic internal “CONVERTSTR” function. Please see Microsoft Dynamics NAV 2009R2 Classic development guide for more details.
The input string.
The input characters as a string, wihout any delimiters.
The target characters. This string has to be the same length as the input characters and specifies the replacement for the input string at the same position.
Pads a string to the given length. The text is left aligned. The converter output options give you more control and are preferred over this function. Calls the Microsoft Dynamics NAV 2009R2 Classic internal “PADSTR” function. Please see Microsoft Dynamics NAV 2009R2 Classic development guide for more details.
The input string.
The target string length.
The charcter used to pad the string.
Increases a number inside a string by one . Calls the Microsoft Dynamics NAV 2009R2 Classic internal “INCSTR” function. Please see Microsoft Dynamics NAV 2009R2 Classic development guide for more details.
The input string.
Create a new GUID and returns the value.
COMMUNICATION
Requires setup in the communication channel.
There is a new function GETLASTNUMBER2 that just returns the number and you can use the formatting of the converter to change the format.
Returns the last used communication number padded with 0 to 5 characters.
Requires setup in the communication channel.
There is a new function GETNUMBER2 that just returns the number and you can use the formatting of the converter to change the format.
Returns the next number from the communication channel padded with 0 to 5 characters.
Requires setup in the communication channel.
Returns the last used communication number .
Requires setup in the communication channel.
Returns the next number form the communication channel.
This function only works for outgoing files and before the export mapping is started. In the export mapping you cannot change the value anymore. Resets all pre selected values for the communication, like the EDI Communication Channel and EDI Communication Partner. You can reset values from the business transaction concept and values that are set by previous or in the current mapping.
This function only works for outgoing files and before the export mapping is started. In the export mapping you cannot change the value anymore. Sets the EDI Communication Channel that should be used for outgoing data.
alias SET_RECEIVER_PARTY
This function only works for outgoing files and before the export mapping is started. In the export mapping you cannot change the value anymore. Sets the EDI Communication Partner that should be used for the receiver on the outgoing data.
This function only works for outgoing files and before the export mapping is started. In the export mapping you cannot change the value anymore. Sets the receiver identification for the outgoing transmission. For outgoing SMTP communication channels the receiver ID is used as recipient e-mail address.
alias SET_SENDER_PARTY
This function only works for outgoing files and before the export mapping is started. In the export mapping you cannot change the value anymore. Sets the EDI Communication Partner that should be used for the sender on the outgoing data.
This function only works for outgoing files and before the export mapping is started. In the export mapping you cannot change the value anymore. Sets the sender identification for the outgoing transmission. For outgoing SMTP communication channels the sender ID is used as sender e-mail address.
This function only works for incoming data. Gets the receiver identification from the incoming transmission. In case of an POP3 channel this is the receiver’s e-mail address.
This function only works for incoming data. Gets the receiver identification from the incoming transmission. In case of an POP3 channel this is the sender’s e-mail address.
DIALOG
Opens a confirmation dialog. This can be useful for testing, but is usually a bad idea in productive mappings, as they can’t be executed in the background/job.
Opens a confirmation box and returns the value chosen by the user: True for yes; or False for no.
The text shown to the user.
COMPANYINFORMATION
The object COMPANYINFORMATION gives you easy access to the table Company Information, without the need to add a table loop to the mapping.
Gets the column “Name” from the table Company Information.
Gets the column “Name 2” from the table Company Information.
Gets the column “Home Page” from the table Company Information.
Gets the column “Address” from the table Company Information.
Gets the column “Address 2” from the table Company Information.
Gets the column “City” from the table Company Information.
Gets the column “Post Code” from the table Company Information.
Gets the column “Country/Region Code” from the table Company Information.
Gets the column “Phone No.” from the table Company Information.
Gets the column “Phone No.” from the table Company Information.
Gets the column “Fax No.” from the table Company Information.
Gets the column “E-Mail” from the table Company Information.
Gets the column “Telex No.” from the table Company Information.
This field is special.
If there is a value in the column Global Identification Number in the table EDI Setup that value is used. Otherwise the module will try to get the content of field number 90 from the table Company Information. If that fails an empty string is returned.
Gets the column “VAT Registration No.” from the table Company Information.
Gets the column “Registration No.” from the table Company Information.
Gets the column “Giro No.” from the table Company Information.
Gets the column “Bank Name” from the table Company Information.
Gets the column “Bank Branch No.” from the table Company Information.
Gets the column “Bank Account No.” from the table Company Information.
Gets the column “Ship-to Name” from the table Company Information.
Gets the column “Ship-to Name 2” from the table Company Information.
Gets the column “Ship-to Address” from the table Company Information.
Gets the column “Ship-to Address 2” from the table Company Information.
Gets the column “Ship-to City” from the table Company Information.
Gets the column “Ship-to Contact” from the table Company Information.
Gets the column “Ship-to Post Code” from the table Company Information.
Gets the column “Ship-to County” from the table Company Information.
Return a temp table with the posted invoice lines associated with this line. To use this function, you have to add a table loop in the mapping with the table Sales Invoice Line in temporary read mode. You can then use this function as the InitFunction of that loop. In the mapping you can access the data from the temp table, like from any other table instance.
If the Credit Memo Line is applied to an entry in the table Item Ledger Entry the function searches in the table Value Entry for entries that are of type sales invoice and return the data from the table Sales Invoice Line.
Parameters:
The posted sales invoice header number.
The posted sales invoice line number.
Return a temp table with the shipment lines associated with this line. To use this function, you have to add a table loop in the mapping with the table Sales Shipment Line in temporary read mode. You can then use this function as the InitFunction of that loop. In the mapping you can access the data from the temp table, like from any other table instance.
If the Credit Memo Line is applied to an entry in the table Item Ledger Entry the function searches in the table Value Entry for entries that are of type sales invoice and return the data from the table Sales Shipment Line that is related to the found sales invoices.
Parameters:
The posted sales invoice header number.
The posted sales invoice line number.
Return a temp table with the shipment lines associated with this line. To use this function, you have to add a table loop in the mapping with the table Return Receipt Line in temporary read mode. You can then use this function as the InitFunction of that loop. In the mapping you can access the data from the temp table, like from any other table instance.
Technically we are using the table Value Entry filtered to the type Sales Return Receipt and return the data from table Return Receipt Line.
Parameters:
The posted sales invoice header number.
The posted sales invoice line number.