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.
There is no data, only bool!
0
Answers
Post what code you have written so far.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
OnInsert()
Code field - OnValidate()
Function AssistEdit Cust and OldCust variables = T222, Ship-To Address
On Form 300, Ship-To Address
OnAssistEdit
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.)
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)