Sell-to Customer Name

kwajahathydrokwajahathydro Member Posts: 88
edited 2014-04-23 in Navision Attain
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

Comments

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    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?
  • kwajahathydrokwajahathydro Member Posts: 88
    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
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    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.)))
  • vijay_gvijay_g Member Posts: 884
    You can also go through by "G/L Account Name" field in G/L Entry table.
  • kwajahathydrokwajahathydro Member Posts: 88
    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
  • kwajahathydrokwajahathydro Member Posts: 88
    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
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    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..
  • ssinglassingla Member Posts: 2,973
    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
  • vijay_gvijay_g Member Posts: 884
    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.
  • TvisTvis Member Posts: 70
    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...
  • ishwar016ishwar016 Member Posts: 1
    Thanxx a lottt Tvis.. it has helped me to solve a problem in which i was stuck since many days. Next time i ll use FlowField instead of inserting. :) =D>
Sign In or Register to comment.