how to make Mandatory field
Is there any stored procedure to make the "dimension"(cost center) as mandatory field in the invoices and production orders?
Joseph Antony replied
You can check the below for AP Invoice: for other documents, you may change the table name and update the object type too:
To get the object type, you can refer:
@transaction_type IN (N'A', N'U') AND (@Object_type = N'18')
exists (SELECT T0.docnum FROM dbo.OPCH T0 INNER
dbo.PCH1 T1 ON T1.DOCENTRY =
t1.OcrCode is null
T0.DOCENTRY = @list_of_cols_val_tab_del)
@Error = 1, @error_message =
'You cannot add invoice without selecting the Cost Center!!'