noob Developer Persisting table extension

  • noob Developer Persisting table extension

    Posted by Unknown Member on August 27, 2019 at 9:03 pm
    • Mark Anderson

      Member

      August 27, 2019 at 9:03 PM

      Hi all

      brand new to D365 BC and getting my feet wet with dev (worked with many other ERP’s)

      Anyway, I want to extend the Sales Header table with two fields (and later add a new table). Fo rnow, I just want to add the two fields (ints), enter values and persist them.

      Here’s my code: I see the fields, can enter data, but when I re-open the record, the values are zero again

      tableextension 50103 “SalesOrderHeader Ext” extends “Sales Header”
      {
      fields
      {
      field(50103; “Load No”; Integer)
      {

      }

      field(50104; “Load Sequence”; Integer)
      {

      }
      }
      }

      pageextension 50103 “SaleOrderHeader Ext” extends “Sales Order”
      {
      layout
      {
      // Add changes to page layout here
      addLast(“Shipping and Billing”)
      {
      field(“LoadNo”; “Load No”)
      {
      // ApplicationArea sets the application area that
      // applies to the page field and action controls.
      // Setting the property to All means that the control
      // will always appear in the user interface.
      ApplicationArea = All;
      }
      field(LoadSeq; “Load Sequence”)
      {
      ApplicationArea = All;
      }

      }
      }

      what do i need to do to persist the values?

      on a side note, how do i add these to a filter in, for example, if I want filter by Load Sequence inĀ “Home/Sales Orders/Ready To Ship:, how would I make these new fileds visible?

      TIA

      Mark

      ——————————
      Mark Anderson
      Clesen Wholesale
      Evanston IL
      ——————————

    • Kyle Hardin

      Member

      August 28, 2019 at 8:13 AM

      First, I’ll cover persistence.

      In BC, you have to go out of your way to *not* persist data. You’d have to declare a record variable with the property temporary added:

      Ā Ā Ā Ā Ā  SalesHeader: Record “Sales Header” temporary;

      So I don’t think that is what is going on. It might have to do with declaring what type of data the new fields are, which was added recently in order to support GDPR requirements. Anyway – try this:

      field(50103; “Load No”; Integer)
      {
      Ā  Caption = ‘Load No.’;
      Ā  DataClassification = CustomerContent;
      }

      You can also eliminate the page as being the source of the problem by running the table directly in the web browser URL, and see (a) do your new fields show up and (b) did they keep the data:

      https://whatever.server.bc365/InstanceName/?Table=36

      As for filtering the list, that is going to be another Page besides Sales Order (Page 42). I do not have a D365 account, so I’m looking at BC on premise, but if I go to Home / Sales Orders / Ready To Ship, that brings up Page 9305 Sales Order List, so extend that page the same way you did Sales Order. Then you can filter on those new fields just like any other field shown.

      ——————————
      Kyle Hardin
      NAV Developer
      ArcherPoint Inc.
      Duluth GA
      ——————————
      ——————————————-

    • Matt Traxinger

      Member

      August 28, 2019 at 8:25 AM

      Also check the SchemaUpdateMode property in your launch.json file. It should be set to Synchronize. If it is Recreate it will wipe out all of the data for your extension when you deploy a new version.

      ——————————
      Matt Traxinger
      NAV Developer
      ArcherPoint Inc.
      San Antonio TX
      ——————————
      ——————————————-

    • Mark Anderson

      Member

      August 28, 2019 at 2:11 PM

      Thanks Kyle

      works now. not sure if I changed anything that would have caused it to start working

      ——————————
      Mark Anderson
      Clesen Wholesale
      Evanston IL
      ——————————
      ——————————————-

    Unknown Member replied 6 years, 7 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘noob Developer Persisting table extension’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!