cancel
Showing results for 
Search instead for 
Did you mean: 

How to make project field mandatory

Former Member
0 Kudos

Dear All,

Our client would like to know how to make project field mandatory (Purchase order >> Line >> Project field).

Do we need a UDV? Thanks in advance.

Regards,

Yuka

Accepted Solutions (1)

Accepted Solutions (1)

former_member204969
Active Contributor
0 Kudos

In version 8.81 there is general setting making mandarory the project code (for accounts set for cost acounting) under General Settings / Cost Accountin tab.

For earlier versions or specificaly only for purchase order lines you can use this code:

If @object_type = '22' 
begin
	if exists(select 'A' from opor T0 inner join por1 T1 on T0.DocEntry = T1.DocEntry
            where T0.ObjType = '22' and isnull(T1.Project,'') = ''
              and T0.DocEntry = @list_of_cols_val_tab_del)
	begin
		set @error = 1 
		set @error_message = 'Project is missing PO' 
	end 
end

Insert the above code into your SBO_SP_TransactionNotification stored procedure after the line

-- ADD YOUR CODE HERE

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Yuka.....

This is possible through SP Transaction Notification.....

Please check this thread for your solution....

You need to put object ID as 22 for OPOR and replace the tables......

Regards,

Rahul