Hallo,
I need to select a value from a database with getRecord. The problem is, that I have to select a warehouse code from the report header to use this code to select later in the line the right sku to get a record identified with the item number.
this could be the code to get the Record:
IF getLocation.GET ("Item No.") THEN ...
how can place the value for the SKU?
Comments
And of course read carefully help for both functions (and some more also). Then you will get the idea.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
never used rec.FIND before, i will give it a try.
The problem is what i see is, I got a stock keeping code from the header. then in the row i have to select a location based on an article number and the stock keeping code from the haeder. I will keep you informed tomorrow...
Take a look on my personal website (if you like )
hj
Thank you all for the help...
The example for FIND in the manual (ver. 3.10a) is a little strange (not really about the find function).
Maybe someone can post a short example about how to use the function?
Take a look on my personal website (if you like )
JECheckSalesLine.RESET;
JECheckSalesLine.INIT;
JECheckSalesLine.SETRANGE(JECheckSalesLine."Document Type","Document Type");
JECheckSalesLine.SETRANGE(JECheckSalesLine."Document No.","Document No.");
JECheckSalesLine.SETFILTER(JECheckSalesLine."Shortcut Dimension 1 Code",'<>%1','');
IF JECheckSalesLine.FIND('-') THEN BEGIN
This example shows how to use a combination of SETRANGE and SETFILTER to narrow down the search.
The rule I follow is to use GET if I have all of the primary key information and to use FIND if I do not have the full data of the primary key.
Hope this helps.
j
ALWAYS before setting ranges use a setcurrentkey. AS MUCH AS POSSIBLE the key you use should contain the fields you are sorting by, and the set ranges should be in the same order as the fields in the key.
If you do not use a SETCURRENTKEY Navision will assume you want to use the primary key, which if you are doing a FIND should really not be the best key at all...
JECheckSalesLine.RESET;
JECheckSalesLine.INIT;
JECheckSalesLine.SETCURRENTKEY("Document Type", "Document No.", "Shortcut Dimension 1 Code");
JECheckSalesLine.SETRANGE(JECheckSalesLine."Document Type","Document Type");
JECheckSalesLine.SETRANGE(JECheckSalesLine."Document No.","Document No.");
JECheckSalesLine.SETFILTER(JECheckSalesLine."Shortcut Dimension 1 Code",'<>%1','');
IF JECheckSalesLine.FIND('-') THEN BEGIN
Take it from someone who has spent time re-writing posting routines to make them faster...
-a
thanks, it works perfect!!!
Take a look on my personal website (if you like )