how to pass the information after posting in sales order?

I have some fields in sales Line, and in sales order I gave the data to those fields but after invoicing how can I pass the information of those fields to Cust.Ledger entry table.

Best Answers

Answers

  • Sebastien_KonsbruckSebastien_Konsbruck Member Posts: 30
    edited 2016-07-22
    Dear Tejaswini,

    You can change the posting codeunits (sales = 80, ledger entries = 12) to achieve this but what is your target?

    You could also use flow fields to lookup information in the posted documents.

    Best regards,
    Sebastien
  • TejaswiniTejaswini Member Posts: 75
    edited 2016-08-27
    Yes, I have observed those codeunits, but where can I assign my field and in which function? My target is to dispaly the total amount present in amount including tax field in customer ledger entry after posting and display the charges that I have added this field in sales Line table before posting I added charges amount to amount including tax field, but it didn't display the total amount present in amount including tax field in customer ledger entry table?

    please help me

  • TejaswiniTejaswini Member Posts: 75
    fct.copy means??
  • TejaswiniTejaswini Member Posts: 75
    Can U please explain me in detail with code
  • archer89archer89 Member Posts: 337
    edit table 21 "cust. ledger entry" (button design in development environment).
    search for function (fct.) CopyFromGenJnlLine.
    in this function the fields of a new cust. ledger entry are set.
    you only have to add some lines of code at the end.
    you can at least add the values of the additional fields from sales header here.
    fields "document type" and "document no." are the key fields of table sales header. with them you can load the according sales header record (SalesHeader.GET("Document Type","Document No.");).
    after that write something like that ...
    CustLedgerEntry."Your Field 1" := SalesHeader."Your Field 1";
    ...
    best regards
    Franz Kalchmair, MVP
    Alias: Jonathan Archer

    please like / agree / verify my answer, if it was helpful for you. thx.
    Blog: http://moxie4nav.wordpress.com/
  • archer89archer89 Member Posts: 337
    edited 2016-07-25
    i checked again.
    it's better you add you code to codeunit (CU) 12.
    scroll down to function PostCust.
    ...
    DtldCustLedgEntry.LOCKTABLE;
    CustLedgEntry.LOCKTABLE;
    InitCustLedgEntry(GenJnlLine,CustLedgEntry); // here above fct. CopyFromGenJnlLine is called
    IF NOT Cust."Block Payment Tolerance" THEN
    ...

    CVLedgEntryBuf.CopyFromCustLedgEntry(CustLedgEntry); // the new created cust.led.entry record is copied and then changed. your fields and values are not copied here.
    ...

    // Post customer entry
    CVLedgEntryBuf.CopyToCustLedgEntry(CustLedgEntry); // the changed data ist copied back to the cust.led.entry record
    CustLedgEntry."Amount to Apply" := 0;
    CustLedgEntry."Applies-to Doc. No." := '';
    // start her your own code
    // declare local variable SalesHeader of type "Sales Header"
    // e.g.
    SalesHeader.get(CustLedgEntry."document type",CustLedgEntry."document no.");
    CustLedgEntry."your field 1" := SalesHeader."Your Field 1";
    ...
    // end of your code
    CustLedgEntry.INSERT;
    ...
    best regards
    Franz Kalchmair, MVP
    Alias: Jonathan Archer

    please like / agree / verify my answer, if it was helpful for you. thx.
    Blog: http://moxie4nav.wordpress.com/
  • TejaswiniTejaswini Member Posts: 75
    Thank you for your valuable information
  • TejaswiniTejaswini Member Posts: 75
    InitCustLedgEntry(GenJnlLine,CustLedgEntry); how can I declare this in C/AL Variables?
    Is InitCustLedgEntry a function?
  • TejaswiniTejaswini Member Posts: 75
    Thank You,
    I got it
  • TejaswiniTejaswini Member Posts: 75
    I have one more question , can u please help me?
  • TejaswiniTejaswini Member Posts: 75
    edited 2016-08-27
    Hello...
  • TejaswiniTejaswini Member Posts: 75
    edited 2016-08-27
    Charges amount should get added to the amount including tax field while posting in sales order and that amount should post to the item for example amount including field has 100 and charges has 10 and while posting amount including field should has 110 and get posted the item amount as 110 in item card of sales amount(actual) field please suggest me....
  • archer89archer89 Member Posts: 337
    why not use sales lines of type "charge (item)"? check if there are appropriate entries in the list of the charges. if not simply create a new one.
    for details follow https://msdn.microsoft.com/en-us/library/hh173037(v=nav.90).aspx
    best regards
    Franz Kalchmair, MVP
    Alias: Jonathan Archer

    please like / agree / verify my answer, if it was helpful for you. thx.
    Blog: http://moxie4nav.wordpress.com/
  • TejaswiniTejaswini Member Posts: 75
    Yes I created
  • TejaswiniTejaswini Member Posts: 75
    Now my question is how to post the amount in carrier charges as item charges I want to post the amount only present in carrier charges field
  • TejaswiniTejaswini Member Posts: 75
    edited 2016-08-27
    but when ever I am posting in sales order the amount present in amount including tax field is get posted but I don't want that I just want only to post the amount field that I have created

    please suggest me where can I change the code to achieve this.....
  • Sebastien_KonsbruckSebastien_Konsbruck Member Posts: 30
    edited 2016-07-28
    Hi Tejaswini,

    Glad someone showed you where to find .INSERT in code unit 12.

    @FlowFields: Regarding flow fields and performance I wanted to clarify this depends on how well your indexes are defined, how complex the conditions are to search for information and where you want to display the flow fields. I don't think one should generally avoid flowfields in these tables: https://blogs.msdn.microsoft.com/nav/2014/11/12/microsoft-dynamics-nav-faster-than-ever/

    @Item Charges: http://forum.mibuso.com/discussion/67029/about-carrier-charges#latest

    I think I understood you now: do you mean how to post item charges without applying taxes / VAT?

    Best regards,
    Sébastien
  • TejaswiniTejaswini Member Posts: 75
    edited 2016-08-27
    Auto posting...
Sign In or Register to comment.