Formatting address information on Customer Statement

Navision Articles

Get our Free Newletter

Don't you have the time to be online here at DUG every day? So how do you follow what is going on in the Dynamics industry and community?
If you subscribe to the DUG Newsletter then you can relax! We will make sure that you don't miss the big news!

Check out our
Newsletter Subscription Center
page a complete list of our different newsletters.

Solution (Verified) This post has 1 verified solution | 5 Replies | 1 Follower

Top 500 Contributor
Male
80 Posts
1,035 Points
Joined: Mar 31, 2008
Last Online:
Oct 15, 2009 13:59
Location: Dubai, UAE
Vinod posted on Mar 22, 2009 14:03
How helpful was this post/question? Please rate here:

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

Solution (Verified) Verified Solution

Top 500 Contributor
Male
80 Posts
1,035 Points
Joined: Mar 31, 2008
Last Online:
Oct 15, 2009 13:59
Location: Dubai, UAE
Solution (Verified) Vinod replied on Mar 22, 2009 14:18
How helpful was this comment/solution? Please rate here:
Verified by 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 (CustAddrIdea=Customer."No.") or (CustAddrIdea=Customer."Contact") then

CustAddrIdea:='';

Compressarray(CustAddr);

 

 

All Replies

Top 10 Contributor
Male
1,104 Posts
25,347 Points
Joined: May 6, 2008
Last Online:
Mar 21, 2010 14:57
Location: Dublin
Moderator
DaveT replied on Mar 22, 2009 14:17
How helpful was this comment/solution? Please rate here:

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-ons
www.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 Wink

Top 500 Contributor
Male
80 Posts
1,035 Points
Joined: Mar 31, 2008
Last Online:
Oct 15, 2009 13:59
Location: Dubai, UAE
Solution (Verified) Vinod replied on Mar 22, 2009 14:18
How helpful was this comment/solution? Please rate here:
Verified by 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 (CustAddrIdea=Customer."No.") or (CustAddrIdea=Customer."Contact") then

CustAddrIdea:='';

Compressarray(CustAddr);

 

 

Top 10 Contributor
Male
1,104 Posts
25,347 Points
Joined: May 6, 2008
Last Online:
Mar 21, 2010 14:57
Location: Dublin
Moderator
DaveT replied on Mar 22, 2009 14:31
How helpful was this comment/solution? Please rate here:

Hi Vinod,

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 );

 

Dave Treanor

Dynamics Nav Add-ons
www.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 Wink

Top 500 Contributor
Male
80 Posts
1,035 Points
Joined: Mar 31, 2008
Last Online:
Oct 15, 2009 13:59
Location: Dubai, UAE
Vinod replied on Mar 23, 2009 10:28
How helpful was this comment/solution? Please rate here:

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

Top 10 Contributor
Male
1,104 Posts
25,347 Points
Joined: May 6, 2008
Last Online:
Mar 21, 2010 14:57
Location: Dublin
Moderator
DaveT replied on Mar 23, 2009 10:43
How helpful was this comment/solution? Please rate here:

Hi Vinod,

Declare a variable of Datatype record and Subtype Country/Region (e.g. CountryRec) then you use the command

CountryRec.GET( Customer.Country );

 

Dave Treanor

Dynamics Nav Add-ons
www.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 Wink

Page 1 of 1 (6 items) | Get this RSS feed | Bookmark and Share