Hello all,
I have a problem when i try to import data into a reclassification journal. I obtain an error message "new location code must be..."
Here is my code :
RecGItemJournalLine.VALIDATE("Location Code",location1);
RecGItemJournalLine.VALIDATE("Bin Code",bin1);
RecGItemJournalLine.VALIDATE("New Location Code",location2);
RecGItemJournalLine.VALIDATE("New Bin Code",bin2);
The debug stops in the validate of the New bin code :
New Bin Code - OnValidate()
TESTFIELD("Entry Type","Entry Type"::Transfert);
IF "New Bin Code" <> xRec."New Bin Code" THEN BEGIN
TESTFIELD("New Location Code");
IF "New Bin Code" <> '' THEN BEGIN
GetLocation("New Location Code");
Location.TESTFIELD("Bin Mandatory");
Location.TESTFIELD("Directed Put-away and Pick",FALSE);
GetBin("New Location Code","New Bin Code");
[b][u]TESTFIELD("New Location Code",Bin."Location Code");[/u][/b]
END;
END;
it seems that the function getbin() give me the wrong bin. In fact when i enter in the function, i have already the wrong bin (Bin1 instead of Bin2)charged in the Bin record. When i enter the reclassification line manually, i have no problem and the Bin record is uninitialised before the getbin and charged with the right bin after the function.
Is there a problem in the getbin function or am i not using the right way to import data?
Thanks for your help
best regards,
Nicolas
Comments
There seems to be a bug on the getbin function in that if you call it with the same bin code but different locations then it doesn't get the bin record
e.g. getbin( 'loc1', 'bin1 ); -> getbin( 'loc2', 'bin1' );
the IF statement should read
Hope this helps - I didn't search for a hotfix, etc
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
I'm going to correct the function
Best regards
Nicolas