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

Stored Procedure to check if a Document Number already Exists

289 Views

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.

Example

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,

Pascale