cancel
Showing results for 
Search instead for 
Did you mean: 

Can I write a stored procedure that will require the E-Mail field in the contact person tab without

Y-Yusuf
Explorer
0 Kudos
308

Can I write a stored procedure that will require the E-Mail field in the contact person tab without? When I enter a contact person, the stored procedure I wrote works, but if nothing is entered in that field and I add a business partner, the stored procedure does not work.

SonTran
Active Contributor
0 Kudos
It is convenient for supporting if you share your store procedure
Y-Yusuf
Explorer
0 Kudos
IF @transaction_type IN (N'A','U') AND (@Object_type = '2') begin if exists(select T0."CardCode" from OCRD T0 INNER JOIN OCPR T1 ON T0.[CardCode] = T1.[CardCode] where T1.[E_MailL] is null and T0."CardCode" = @List_of_cols_val_tab_del ) begin SET @error = -77 SET @error_message = 'It is mandatory to enter your e-mail address.' end end
View Entire Topic
SonTran
Active Contributor
0 Kudos

Hi,

Try to replace

INNER JOIN OCPR T1 ON T0.[CardCode] = T1.[CardCode]

by

LEFT JOIN OCPR T1 ON T0.[CardCode] = T1.[CardCode]

Hope this helps,

SonTran

Y-Yusuf
Explorer
0 Kudos
Hi, it worked. Thank you, regards.