Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

how to make Mandatory field

Dear experts,

Is there any stored procedure to make the "dimension"(cost center) as mandatory field in the invoices and production orders?

Thanks& regards

Hiren

Former Member replied

Hi Hiren,

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:

SAP Business One Objects ID and Menu ID List - Business One - SCN Wiki

If

@transaction_type  IN  (N'A', N'U') AND (@Object_type = N'18')

begin

if

exists (SELECT T0.docnum FROM dbo.OPCH T0 INNER

JOIN

dbo.PCH1 T1 ON T1.DOCENTRY =

T0

.docENTRY

WHERE

t1.OcrCode is null

and

T0.DOCENTRY = @list_of_cols_val_tab_del)

select

@Error = 1, @error_message =

'You cannot add invoice without selecting the Cost Center!!'

End

Thanks,

Joseph

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question