Values posting problem from page to table.

Rajat_MRajat_M Member Posts: 34
edited 2016-05-03 in NAV Three Tier
Hello,

I'm working on Sales Order page. I have created two fields in Cust. Ledger Entry table, Address1 & Address2. Then in the Sales Order page I have taken three variables, Address1, Address2 & RecCLE(Record).After that I wrote the following code:

Address1- OnValidate()


RecCLE.RESET;

RecCLE.INIT;

RecCLE.Address1:=Address1;

RecCLE.INSERT;

Address2- OnValidate()


RecCLE.RESET;

RecCLE.INIT;

RecCLE.Address2:=Address2;

RecCLE.INSERT;

After executing the page when I enter the values in those fields, only the first value goes to the Cust. Ledger Entry table that is Address1. But I want to bring both the values in Cust. Ledger Entry table. What should I do next??

Answers

  • Wisa123Wisa123 Member Posts: 308
    Unless your RecCLE is temporary: STOP RIGHT HERE. We don't "manually" insert Lines into CLE.

    Usually the solution would be to just
    1.) add the Fields to T36-SalesHeader and all the corresponding tables (sales invoice header, sales shipment header) if you want them listed there too.
    2.) add those fields to their respective pages
    3.) add those 2 fields to CLE
    4.) Look through the posting routine, and add code to fill your fields in CLE while posting.
    Austrian NAV/BC Dev
  • Rajat_MRajat_M Member Posts: 34
    I was being told that I have to use codeunit..!
  • postsauravpostsaurav Member Posts: 708
    Hey Bro,

    One Question - Why you need address in Customer Ledger Entry?

    Now your issue -
    You need to learn posting routine for sales posting.

    Hint (only for Customer Ledger)** -
    A Sales order when posted via 81 and 80, creates a journal.
    Then Journal posting routine is called which actually creates Detailed Cust. Ledger and then Customer Ledger..

    Dig it and let us know what you found...

    Thanks & Regards,
    Saurav Dhyani

    Do you Know this About NAV?


    Connect - Twitter | Facebook | Google + | YouTube

    Follow - Blog | Facebook Page | Google + Page
  • RockWithNAVRockWithNAV Member Posts: 1,139
    Rajat,

    If you are doing any customization on standard tables then its always recommended to follow the standard processes instead of writing your own set of codes and creating new objects and codeunits. In this case of yours I will too recommend to the same what Wisa123 has recommended and I belief you might have been asked to do the same way and use standard codeunits.
Sign In or Register to comment.