cancel
Showing results for 
Search instead for 
Did you mean: 

Prevent marketing documents creation on a specific warehouse

Former Member
0 Kudos

Hello all,

I have a client with a warehouse for damaged goods and they will like to prevent users from selling from this warehouse. I guess this can be done using a stored procedure but i have never done this before.

I will appreciate any help.

Regards

Debola

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Debola,

By th way define your whse code, assuming you have the code DAMAGED, the below mentioned SP would block the creation of Sales Orders with the 'DAMAGED' warehouse selected.

if @transaction_type IN (N'A', N'U') and @object_type = '17'

begin

if exists(select T0.docentry from

ORDR T0

inner join RDR1 T1 on T0.DocEntry=T1.DocEntry

inner join OWHS T2 on T1.WhsCode = T2.WhsCode

where T0.docentry = @list_of_cols_val_tab_del and T2.WhsCode like '%DAM%' )

begin

SET @error = 17

SET @error_message = N'! You cannot sell from this warehouse !!'

end

end

You can change the object type & tables for Delivery, AR Invoice too.

Thanks,

Joseph

Former Member
0 Kudos

Thanks Joseph,

I noticed that the message is displayed below and it disappears after a while. I there any way this can be a pop up message? Most users will not see the message bar and will assume the solution is not working.

Regards

Debola

Former Member
0 Kudos

It disappears but it still shows for a while on the screen.

Transaction notifications help only to display message on screen and you cant get pop up msgs with Trans notif.

Thank,

Joseph

Answers (0)