Skip to Content
Jun 21, 2016 at 12:57 PM

Stored Procedure to check if a Document Number already Exists


Dear Experts,

I want to link two different documents together. These are: Disassembly production order and Standard Production order. I want to link them using a UDF called Production Reference.

Basically, you create a disassembly production order and follow the disassembly process to the end. When you are creating a standard production order, you will link it to the disassembly production order created earlier by inputting the disassembly production order number in the production reference UDF.


Disassembly Production Order No. - 157

Standard Production Order No. - 161, which will be linked to the disassembly production order by inputting 157 in the UDF field.

I would appreciate help in coming up with a stored procedure that checks if the number inputed in the UDF field (157) exists in the production order numbers in the system and if not it asks the user to put a valid number. Thanks

Kind Regards,