mibuso.com

Microsoft Business Solutions online community
It is currently Mon May 20, 2013 9:55 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Sell-to Customer Name
PostPosted: Thu Feb 23, 2012 11:24 am 
Offline

Joined: Mon Jan 30, 2012 11:03 am
Posts: 61
Country: Singapore (sg)
Hi,

I would like to know on how to add the sell-to customer name field that appears in table 112 (sales invoice header) to be shown into the customer ledger entry screen.

I would like to capture this field into customer ledger entry table for new records as well as for old records. I did inserted a new field in customer ledger entry table as 50003, Sell-to Customer Name with type as code & length 50

I wrote a new report for the data item cust ledger entry and on validate trigger, i wrote this code


IF R_SalesInvoiceHeader.GET("Sell-to Customer Name") THEN
BEGIN
"Cust. Ledger Entry"."Sell-to Customer Name":=R_SalesInvoiceHeader."Sell-to Customer Name";
MODIFY(TRUE);
END;

Under CAL Globals, I defined the variable as R_SalesInvoiceHeader, with type as record and pointed it to Sales Invoice Header Table.

I run the report and there is no error but after this when i look at customer ledger entry screen, the field Sell-to Customer Name appears but no value to it.

I need some help on the above!

Regards
Khan


Top
 Profile E-mail  
 
 Post subject: Re: Sell-to Customer Name
PostPosted: Thu Feb 23, 2012 11:33 am 
Online
MVP Microsoft Dynamics NAV

Joined: Tue Sep 02, 2008 8:37 am
Posts: 4224
Location: New Delhi
Country: India (in)
Read this post to know about how to use GET
http://www.mibuso.com/forum/viewtopic.php?f=23&t=51996

Why do you want to insert data..Why dont you use a FlowField?

_________________
-Mohana
http://mibuso.com/blogs/mohana
http://mohana-dynamicsnav.blogspot.in/


Top
 Profile  
 
 Post subject: Re: Sell-to Customer Name
PostPosted: Thu Feb 23, 2012 11:48 am 
Offline

Joined: Mon Jan 30, 2012 11:03 am
Posts: 61
Country: Singapore (sg)
Hi,

I am not a techie in Nav, so can you give me the steps or write down for me if you have time on how to use flow field, for which table and etc

This code was given to me by my colleague so I used it after long time, never did it but today the need was there so I have use it. Well I want the sell to customer name that is sitting in posted invoice header table to be displayed in customer ledger entry. Now if flowfield can help me its fine and at same time i want all the old records in the customer ledger entry to be captured with its customer name rather than only new ones getting captured.

pls help me out by writing the details to me, I hope you dont mind

Regards
Khan


Top
 Profile E-mail  
 
 Post subject: Re: Sell-to Customer Name
PostPosted: Thu Feb 23, 2012 12:04 pm 
Online
MVP Microsoft Dynamics NAV

Joined: Tue Sep 02, 2008 8:37 am
Posts: 4224
Location: New Delhi
Country: India (in)
Please dont try yourself with this kind of code where you dont know the effect of it..

Select Properties of New Created field in Customer Ledger Entry and
Set FieldClass = FlowField
CalcFormula = Lookup("Sales Invoice Header"."Sell-to Customer Name" WHERE (No.=FIELD(Document No.)))

_________________
-Mohana
http://mibuso.com/blogs/mohana
http://mohana-dynamicsnav.blogspot.in/


Top
 Profile  
 
 Post subject: Re: Sell-to Customer Name
PostPosted: Thu Feb 23, 2012 12:12 pm 
Offline

Joined: Mon May 18, 2009 6:36 am
Posts: 792
Location: India
Country: India (in)
You can also go through by "G/L Account Name" field in G/L Entry table.

_________________
Vijay Gupta
Changing the code is last step. Try to change processes first...


Top
 Profile E-mail  
 
 Post subject: Re: Sell-to Customer Name
PostPosted: Thu Feb 23, 2012 12:38 pm 
Offline

Joined: Mon Jan 30, 2012 11:03 am
Posts: 61
Country: Singapore (sg)
Hi Mohana,

Thanks for your help. It worked! Well What ever i do, i do in my test DB without effecting my live. Once confirmed I do it in Live. Any how thanks for the tip on not to do things when we are not sure of it.

Regards
Khan


Top
 Profile E-mail  
 
 Post subject: Re: Sell-to Customer Name
PostPosted: Fri Feb 24, 2012 2:46 am 
Offline

Joined: Mon Jan 30, 2012 11:03 am
Posts: 61
Country: Singapore (sg)
Hi Mohana,

In customer ledger entry, document type for invoice only it shows cust name, but how about if i need to show the name for the document type credit note

I hope if its simple pls let me know the areas where to go and add what kind of code, dont worry! I will do it in my test DB and once assured I shall upload it into the live DB

Hope you dont mind

Regards
Khan


Top
 Profile E-mail  
 
 Post subject: Re: Sell-to Customer Name
PostPosted: Fri Feb 24, 2012 6:02 am 
Online
MVP Microsoft Dynamics NAV

Joined: Tue Sep 02, 2008 8:37 am
Posts: 4224
Location: New Delhi
Country: India (in)
You have to try your self also...

As vijay suggested use g/lAccount Name example..

Use Customer table to get the customer name instead of Sales Invoice header..

_________________
-Mohana
http://mibuso.com/blogs/mohana
http://mohana-dynamicsnav.blogspot.in/


Top
 Profile  
 
 Post subject: Re: Sell-to Customer Name
PostPosted: Fri Feb 24, 2012 7:35 am 
Offline

Joined: Thu Dec 08, 2005 9:12 am
Posts: 2870
Location: India
Country: India (in)
mohana_cse06 wrote:
Please dont try yourself with this kind of code where you dont know the effect of it..

Select Properties of New Created field in Customer Ledger Entry and
Set FieldClass = FlowField
CalcFormula = Lookup("Sales Invoice Header"."Sell-to Customer Name" WHERE (No.=FIELD(Document No.)))


Flowfield can have performance issue especially if the data size is huge. I suggest consult a technical consultant to do the appropriate coding for you.

_________________
CA Sandeep Singla
http://ssdynamics.co.in


Top
 Profile E-mail WWW  
 
 Post subject: Re: Sell-to Customer Name
PostPosted: Fri Feb 24, 2012 9:06 am 
Offline

Joined: Mon May 18, 2009 6:36 am
Posts: 792
Location: India
Country: India (in)
When we use Lookup method in flowfield then i don't think it will impect to DB performance even it does not required any key to show the value.
If the purpose of this field is to display only.

_________________
Vijay Gupta
Changing the code is last step. Try to change processes first...


Top
 Profile E-mail  
 
 Post subject: Re: Sell-to Customer Name
PostPosted: Fri Feb 24, 2012 5:31 pm 
Offline

Joined: Tue Aug 29, 2006 6:00 pm
Posts: 64
Location: DK
Country: Denmark (dk)
Quote:
Please dont try yourself with this kind of code where you dont know the effect of it..

Select Properties of New Created field in Customer Ledger Entry and
Set FieldClass = FlowField
CalcFormula = Lookup("Sales Invoice Header"."Sell-to Customer Name" WHERE (No.=FIELD(Document No.)))


I think it would make more sense to create the flowfield like this:

Select Properties of New Created field in Customer Ledger Entry and
Set FieldClass = FlowField
CalcFormula = Lookup(Customer.Name WHERE (No.=FIELD(Customer No.)))

As all Customer Names will be filled out for the CLE's and not only the ones that have Sales Invoice Headers...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: