I need a small work around to display the customer address in a specific format on Customer Statement? Currently, the output comes from the FormatAddr codeunit and I don’t want to touch that module. Is there any way of tweaking the CustAddr array variable to display the address info as follows.
Customer Address 2
Any help would be much appreciated.
March 22, 2009, 1:17pm
You can just assign it yourself. The idea of the format address function is to format the address to the format set on the country/region table and then compresses the array.
comment out the format address call and assign the variable as you want. If you do not want blank line then call the COMPRESSARRAY function e.g. COMPRESSARRAY(CustAddr);
Got the answer.
Declare an integer variable i.
The on the Customer - OnAfterGetRecord() event, add the below code after the FormatAddr.Customer(CustAddr,Customer); line.
for i:= 1 to arraylen(CustAddr) do
if (CustAddr[i]=Customer.“No.”) or (CustAddr[i]=Customer.“Contact”) then
March 22, 2009, 1:31pm
Yes if you still want to use the country address format funucionality
If not then it’s more simple than that i.e.
COMPRESSARRAY( CustAddr );
How do I get the Country Name from the country table?
Customer.Country gives me the code of the country (AE, IN, UK, etc) only? Is there any way I can use GET keword?
March 23, 2009, 9:43am
Declare a variable of Datatype record and Subtype Country/Region (e.g. CountryRec) then you use the command
CountryRec.GET( Customer.Country );