Sub Form button error : Field No. 6 is not defined

hairyjimhairyjim Member Posts: 99
edited 2010-12-16 in Navision Attain
I have created a new form that sources the Tracking Spec table, I also have a sub form view to Item Tracking that sources the Item Ledger Table.

On this sub form I have specified a button called Navigate that when clicked opens up the posted sales shipment document related to the line the user is focussed on.

Now on the button I defined it to RunObject: Form Posted Sales Shipment and the RunFormLink: No.=FIELD(Document No.)

If I were to run this form by itself the button works correctly and the Posted Shipment card is displayed for the line item. If I run my new form that has this sub form and I click the button I get the following error

"Field No. 6 is not defined in the Tracking Specification table"

Could someone please shed some light on this for me.

Cheers
James
Give a man a fish and he will eat for a day, teach a man to fish and he will drink beer allday.

Comments

  • awarnawarn Member Posts: 261
    Is the button on your subform, or did you copy it onto your main form?

    If the button is on your main form it does not have direct access to the values on the subform, and you need to remove the runformlink property, and in the OnPush of the menuitem something like this:

    CurrForm.NameOfSubForm.FORM.GETRECORD(lrRecordOfTypeThatIsDisplayedOnTheSubform);

    Now you have a record variable relating to eh current record on the subform.

    Then you can call the Posted Shipment form and send in the record variable...

    Hope that makes sense,

    -a
  • hairyjimhairyjim Member Posts: 99
    Hi,

    Thanks for the reply.

    The button is actually on the sub form.

    Jim
    Give a man a fish and he will eat for a day, teach a man to fish and he will drink beer allday.
  • awarnawarn Member Posts: 261
    OK Sorry I read the error incorrectly.

    "Field No. 6 is not defined in the Tracking Specification table"

    In base Navision there is no field 6 for this table, something you are using (one of the two forms) is referencing this field (maybe it was added then removed?).

    Try compiling the main form and see if the complier gives you the same message. This error is telling you that an event / trigger somewhere is referencing a field that doesnt exist. But it would have had to exist at some point for the object to originally compile...

    -a
  • hairyjimhairyjim Member Posts: 99
    Hi.

    The button is defined on the sub form, and when this sub form is run independently from the main form the button works fine. But when I define the form to be a sub form of the main form the button does not work.
    Give a man a fish and he will eat for a day, teach a man to fish and he will drink beer allday.
  • awarnawarn Member Posts: 261
    Did you re-compile both forms?

    What about the Tracking Specification table, is there a field # 6?
  • tinoruijstinoruijs Member Posts: 1,226
    I just recently bumbed into the same message.
    I've spent hours looking with other developers for the solution and did not find it.

    My conclusion is NAV cannot work correctly with buttons on a subform which use Runobject and RunFormLink.
    My is opinion is that you should not want to use buttons on a subform. [-X

    And because deleting the buttons from the subform was not allowed ,I've solved it by making a function for showing related records.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • geronimogeronimo Member Posts: 90
    when running into a situation like this i generally export both objects to text and then have a search for the thing that goes wrong
  • SavatageSavatage Member Posts: 7,142
    tinoruijs wrote:
    My is opinion is that you should not want to use buttons on a subform.

    I don;t agree 100% - but when you try to copy buttons from 1 form to another, instead of creating it new, you will sometimes fall into some unforseen complications due to previous coding or property setups that do not apply to your new form
Sign In or Register to comment.