on 08-09-2016 8:41 AM
Dear All.
I am new to SAP Business One.
I have a Customer using SAP Business One 9.1 PL05 on MSSQL2012.
Is there a way i can setup Users who can only sell (Invoice) from specific warehouse.
Kind Regards
Joshua
Hi
you can modify the Transaction Notification to check all sales documents are using the right warehouse.
if (@document_type = '13' and @transaction_type = 'A')
begin
if (select count(*) from inv1 where docentry = @list_of_cols_Val_tab_del and whscode <> yourwarehouse) >0
begin
set @error = 10
set @error_message = 'Wrong warehouse in sales invoice'
end
end
Kind regards
Agustín Marcos Cividanes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Agustin
I have tried to use this code and it is restricting all users to use only one warehouse that is specified as yourwarehouse
what i want is to allow users to only select items only from the default warehouse defined in the default user setup and restict them from selecting items in the other warehouses
Thank you in advance
kind regards
Joshua Gichuhi
Hi
try this SQL statement:
if (@document_type = '13' and @transaction_type = 'A')
begin
declare @userid int
select @userid = usersign from OINV where docentry = @list_of_cols_Val_tab_del
declare @preferences nvarchar(8)
select @preferences = DfltsGroup from OUSR where INTERNAL_K = @userid
declare @whscode nvarchar(8)
select @whscode = Warehouse from OUDG where Code = @preferences
if (select count(*) from inv1 where docentry = @list_of_cols_Val_tab_del and whscode <> @whscode) >0
begin
set @error = 10
set @error_message = 'Wrong warehouse in sales invoice'
end
end
Kind regards
Agustín Marcos Cividanes
Hi
try this code:
if (@object_type = '13' and @transaction_type in( 'A', 'U'))
begin
declare @userid int
select @userid = usersign from OINV where docentry = @list_of_cols_Val_tab_del
declare @preferences nvarchar(8)
select @preferences = DfltsGroup from OUSR where INTERNAL_K = @userid
declare @whscode nvarchar(8)
select @whscode = Warehouse from OUDG where Code = @preferences
if (select count(*) from inv1 where docentry = @list_of_cols_Val_tab_del and whscode <> @whscode) >0
begin
set @error = 10
set @error_message = 'Wrong warehouse in sales invoice'
end
end
Kind regards
Agustín Marcos Cividanes
You can set user wise default warehouse.
Go To
Administration --> Setup --> General --> User Defaults --> Defaults
and after that, you have to link that user default into Users.
If you want to block other warehouses for users, we can use store procedures.
Regards
Halik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.