No. Series on Ship-To Address Table

thaug
Member Posts: 106
I'm trying to implement an automatic/default no. series on the Ship-To Address table. I've got all of the pieces set up in code, but I'm having a problem with it that I think is related to the form link.
On the customer card, when I select Ship-To Addresses, I hit F3 to create a new record and get the following error: "Code must be filled in. Please enter a value." If I click on the AssistEdit button and choose the no. series, it creates the new record as expected. So it works, I'm just looking for a way to implement this so that it works by the normal process of inserting a new record by hitting F3.
Classic client.
On the customer card, when I select Ship-To Addresses, I hit F3 to create a new record and get the following error: "Code must be filled in. Please enter a value." If I click on the AssistEdit button and choose the no. series, it creates the new record as expected. So it works, I'm just looking for a way to implement this so that it works by the normal process of inserting a new record by hitting F3.
Classic client.
There is no data, only bool!
0
Answers
-
Not know what your code is or what additional fields you created on the Ship-to table, I can only assume your code is wrong.
Post what code you have written so far.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
In table 222, Ship-To Address:
OnInsert()IF Code = '' THEN BEGIN SalesSetup.GET; SalesSetup.TESTFIELD("Cust. Ship-To Nos."); NoSeriesMgt.InitSeries(SalesSetup."Cust. Ship-To Nos.",xRec."No. Series",0D,Code,"No. Series"); END;
Code field - OnValidate()IF Code <> xRec.Code THEN BEGIN SalesSetup.GET; NoSeriesMgt.TestManual(SalesSetup."Cust. Ship-To Nos."); "No. Series" := ''; END;
Function AssistEditWITH Cust DO BEGIN Cust := Rec; SalesSetup.GET; SalesSetup.TESTFIELD("Cust. Ship-To Nos."); IF NoSeriesMgt.SelectSeries(SalesSetup."Cust. Ship-To Nos.",OldCust."No. Series","No. Series") THEN BEGIN NoSeriesMgt.SetSeries(Code); Rec := Cust; EXIT(TRUE); END; END;
Cust and OldCust variables = T222, Ship-To Address
On Form 300, Ship-To Address
OnAssistEditIF AssistEdit(xRec) THEN CurrForm.UPDATE;
New field in Sales & Receivalbe Setup table
SalesSetup."Cust. Ship-To Nos."
I created the necessary no. series. Ship-To Address form is called from the Customer Card form Function menu with
RunFormLink = Customer No.=FIELD(No.)There is no data, only bool!0 -
This is related to the 'not blank' property of the Code table field.
Because this property is set on a primary key field, this will be validated as soon as you insert a new record (before the No series-code is given a chance to fill this field)0 -
Thank you. That worked.There is no data, only bool!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions