cancel
Showing results for 
Search instead for 
Did you mean: 

SBO Validation Query for sales invoice

millicentdark
Contributor
0 Kudos

Dear Experts,

I need a validation(SBO_SP_TRANSACTIONNOTIFICATION) query that will block the addition or update of sales invoice when the items selected in row does not contain itemcode = 'ITM-001'.

But when the items in the row has at least on of the above itemcode it should add.

Regards.

Justice

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi,

Put Below Code in Transaction Notification.

Select T0.OINV from OINV T0 
Inner JOIN INV1 T1 on T0.DOcentry=T1.Docentry
Left Outer Join OITM T2 on T1.Itemcode=T2.Itemcode

where T0.Itemcode='ITM-001' and T0.DocEntry = @list_of_cols_val_tab_del

Answers (3)

Answers (3)

Abdul
Active Contributor
0 Kudos

IF @transaction_type IN ('A','U') AND @Object_type = '13' BEGIN

IF EXISTS (SELECT T0.[DocEntry] FROM OINV T0 INNER JOIN INV1 T1 ON T0.[DocEntry] = T1.[DocEntry] WHERE (T1.[ItemCode] = 'ITM-001') and T0.DocType = 'I' and T0.DocEntry = @list_of_cols_val_tab_del) BEGIN SELECT @Error = 13, @error_message = 'Item is blocked' END END

millicentdark
Contributor
0 Kudos

Any help from experts here?

Abdul
Active Contributor
0 Kudos

Please clear you question you mean one code should not be allowed and if there are certain codes then this condition should not applied ?

Simply in you query deploy condition where item code = 'ITM-001' and Itemcode <> exceptional items

millicentdark
Contributor
0 Kudos

Abdul,

I mean if the item code ='ITM-001' is not included in the item selections it should block it. But if the itemcode is included it should add.