Hello all,
My company has Navision 4.0 SP1 and we have the Item table set to automatically assign a number when creating part numbers. The problem is that people are looking at the item card and scrolling to the last number and then accidentally creating a new part when they TAB off the blank number field.
So what I did is this on the Item Card:
Form - OnNewRecord(BelowxRec : Boolean)
IF CONFIRM('Are you sure you want to create a new part?') = FALSE THEN BEGIN
ERROR('');
END;
But this is not the best solution. I would like it if rather than ERROR(‘’) I could just set the card to the last item number and not exit the card. I have tried several things to accomplish this and I keep having problems.
Any suggestions?
Answers
RIS Plus, LLC
please try this...
Form - OnInsertRecord(BelowxRec : Boolean) : Boolean
IF NOT CONFIRM('Are you sure you wanna make da new item?') THEN BEGIN
GET(xRec."No.");
EXIT(FALSE);
END;
The Get will reposition to the last record you were on. If you want it to go to the last record just change it to find('+').
…my final solution looks like your suggestion ashadam999:
I like "GET(xRec."No.");". This behaves better than I originally had in mind.
Thanks again,
Shane