Item Cross reference does not exist error

dkajfesdkajfes Member Posts: 7
Hi,

I'm only new to dataports in navision and i am having an issue getting a value from a second table.

I have a Sales Invoice Line data item where i read the sales invoice line data. I also need to read and export the item cross reference.

So i setup a global variable called
crossref with a datatype RECORD and subtype "item cross reference".

i also have setup a variable call crossrefno

I then use the following GET statement

crossref.GET("No.");
crossrefno := crossref."Cross-Reference No.";

"No." is the item number in the sales invoice line

When i compile, everything is fine. When i run the dataport i get the following error.....

"The Item cross reference does not exist. Identification fields and values:

Item No.='102-01-02750',Variant Code=", Unit of Measure..........other fields from the cross reference table"

I can't see where i am going wrong. :?

I have done the exact same thing with the sales invoice header to get values from that table and it works perfectly. (got help from another member on how to do this )

Do i need to get data from the cross reference table in a different way?

Thanks for your help.

Comments

  • MalajloMalajlo Member Posts: 294
    Primary key in Item Cross Reference is "Item No.,Variant Code,Unit of Measure,Cross-Reference Type,Cross-Reference Type No.,Cross-Reference No."

    I assume that you should use different key and apply filter on ItemcrossRef. First, change CurrentKey to "Cross-Reference No.", then setrange with value of field "Cross-Reference No." from "Sales Line", Findfirst or Find('-').
  • BeliasBelias Member Posts: 2,998
    crossref.GET("no.");

    how can you do a get with only one of the primary key fields?
    use
    crossref.get("Item No.","Variant Code","Unit of Measure","Cross-Reference Type","Cross-Reference Type No.","Cross-Reference No.");
    
    (put your values instead of the name of the fields)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • dkajfesdkajfes Member Posts: 7
    Belias wrote:
    crossref.GET("no.");

    how can you do a get with only one of the primary key fields?
    use
    crossref.get("Item No.","Variant Code","Unit of Measure","Cross-Reference Type","Cross-Reference Type No.","Cross-Reference No.");
    
    (put your values instead of the name of the fields)

    I was under the impression that the "Get" statement would retreive the record where ("no.") from from my Sales Invoice Line matched the "Item No." in the Cross reference table.

    Then i assign the various values to variables which i output in my dataport. for example itemcrossref := crossref."Item No.";

    "itemcrossref" being the variable i write in the dataport.

    "crossref" being the global variable setup to store the record that matched the item no.

    Thanks
    Daniel.
Sign In or Register to comment.