Hi,
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 Name
Customer Address
Customer Address 2
Customer City
Customer Country
Customer Phone
Customer Fax
Any help would be much appreciated.
Thanks,
Vinod
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=Customer."No.") or (CustAddr=Customer."Contact") then
CustAddr:='';
Compressarray(CustAddr);
Hi Vinod,
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);
Dave Treanor
Dynamics Nav Add-onswww.simplydynamics.ie/Addons.html
Please:1. Use a meaningful title.2. Give as much detail as possible.3."Verify Solution" to the post that help you solve your problem.4. Fill out your Tags - it will help other people.5. N.B. Don't be afraid to ask - we all had to learn and are still learning
Yes if you still want to use the country address format funucionality
If not then it's more simple than that i.e.
CustAddr[1]=Customer.Name;CustAddr[2]=Customer.Address;CustAddr[3]=Customer."Address 2";......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?
Thanks
Declare a variable of Datatype record and Subtype Country/Region (e.g. CountryRec) then you use the command
CountryRec.GET( Customer.Country );