Hello,
I want to add a validation on the Sales line on the Sales Order form whereby it checks that the same item no. is not being used on lines.
No.-OnValidate
SalesLine.SETRANGE(No.,No.);
IF SalesLine.FINDFIRST THEN
ERROR('Same item no. cannot be used more than once');
But, even after picking a new item, it is passing into the above codes. I think the item no. should be immediately cleared out after prompting the error message.
Your help is very appreciated..
Liizz
0
Comments
The Item No. is stored in the field "Item No." of the Sales Line table, not the field "No.".
EDIT: You should also filter on Document Type and Document No.
are you sure?
Document Type Document No. Line No. Type No.
Order 1001 10000 Item 1928-W
Its ok about it.
Is there a possible way to clear out the field automatically after the error message.
Liizz
It is checking for duplicate items but the Item No. should be cleared after the error message. Instead of deleting the item no. manually.
Thanks
Liizz
C/AL Locals: (Variables)
SalesLineChk - Record - Sales Line
Existed - Boolean
http://www.BiloBeauty.com
http://www.autismspeaks.org
RIS Plus, LLC
We've made it so it only looks at ITEM types incase you need to add more than one comment line or g/l.
Also it allows duplicates on credit memo's & return orders because we use two locations(Active & Damaged)
so if a customer returns 10 pieces... 5 good & 5 bad we enter the item 2x
item 123 - pcs 5 - location damaged
item 123 - pcs 5 - location active
you have to make sure your not affecting other types of orders, that the sales line table handles, that you like they way they are working.
http://www.BiloBeauty.com
http://www.autismspeaks.org