Comment Lines and Option Type

MauddibMauddib Member Posts: 269
edited 2006-03-05 in Navision Attain
I put a new option in the Purch. Comment Line table. I added it to the end of the string for "Document Type".

I have a copy of the Purchase Header form and on this i added a button to open the Purch. Comment Line table form.

However when I look at the Table Filter (Ctrl + F7) on the comments the filter on Document Type does NOT match that of the Record on which i hit the button. The button is the same as the ones on the other forms like Purchase ORder, Purchase Invoice and so on.

Am I in some way meant to inform the form of the new option type? I would have thought the following on the button:

RunObject: Form Purch. Comment Sheet
RunFormLink: Document Type=FIELD(Document Type),No.=FIELD(No.)

would be enough? But it is picking up a different option for Document Type than the header I am looking at.

Gavin

Comments

  • DenSterDenSter Member Posts: 8,307
    First of all, when you add an option value to a standard Navisiont able, you should add a number of commas between the existing last one and your new option value. So if the existing option string is "quote,order,invoice" and you want to add muaddib at the end you should change it to "quote,order,invoice,,,,,,,muaddib" instead of "quote,order,invoice,muaddib". The reason is that MS might decide to add a few option values themselves, and by adding the commas in between you prevent complicated data issues when you upgrade.

    Then, in case of the comment table and forms, the option string and the captions are different on the forms, so in addition to the option value in the table, you also need to modify the option caption on the form. I don't know exactly what it is that you have to change, but it's in the variable that the option box it tied to on the form. Make sure that the form's option value is tied to your new option in the table. Browse around in the form code and you should find it in there.

    If you don't have access to the C/AL code on forms, then you need to have your solution center do this particular one.
  • MauddibMauddib Member Posts: 269
    The option Value isnt on my form its in the record. Take a look at how the Purchase Orders do this. When you open the form the form links to the Purchase header table but is filtered on "Order" type. So when you insert a new record it creates it with this Document type automatically.

    So I have a copy of the Purchase Header table and a copy of the form that links to it. I have changed the "Document Type" In the new tables to include my new option value "Pass-Through Order".

    I have told the new form to link to this table and filter on my new option type. I have a copy of the comments button as well thats on the Purchase Orders. This uses the code I pasted above.

    So when I insert a new record it does as I expect. When I look at the new record created the Document Type on it is exactly what I wanted it to me.

    However when I click on the comments button and insert a comment... and then I look at the created record in the purch. Comment Line table... it has a different Document Type assigned than the record I inserted it against!!

    GaMBe
Sign In or Register to comment.