Documentation on complex data types

alien251alien251 Member Posts: 80
I'm looking for some documentation on one of the complex data types, namely the record data type. I'm trying to call the get method of this type (sub type of purchase header) to retrieve the record from the database, passing the "No.". I'm getting an error: The expression Code cannot be converted toa Option value.

PurchHeader.GET("No.");

Is the GET method expecting an Option? Am I using this incorrectly...?

Thanks,

Dan

Answers

  • DenSterDenSter Member Posts: 8,304
    GET is used to retrieve one uniquely identifiable record, and the parameters that are expected are the primary key fields in their right order. The primary key of the Purchase Header table is "Document Type, No.". The data type of the first field is 'option'.

    You must specify ALL primary key fields. So to retrieve your purchase order, you do
    PurchaseHeader.GET(MyDocumentTypeValue,MyDocumentNoValue);
    
    If you don't specify all primary key values, you cannot uniquely identify the record, and you can therefore not use GET.
  • alien251alien251 Member Posts: 80
    Thank you! For future reference, do you know where I might find that in the product documentation? I can't say that I made an exhaustive search of the documentation but I did look without any luck... It was pretty 'brief' in terms of the complex data types.

    Thanks again!!

    Dan
  • DenSterDenSter Member Posts: 8,304
    You're welcome, always happy to help :mrgreen:

    There's the C/SIDE Reference Guide, which is on the Help menu. I use the Search tab all the time. In the Doc folder on your product disk you'll find all the pdf's for installation, and one special document called the "application Designer's Guide", file name w1w1adg.pdf, which is the most comprehensive document about the technical details.

    For NAV2009 they combined all the help files and made it all available online too: http://msdn.microsoft.com/en-us/library/cc160853.aspx
Sign In or Register to comment.