on 01-15-2014 12:23 PM
When creating a business partner the client wants the system to block a user who adds a new business partner with no address into the system.
in other words he wants that field to be mandatory on creating new BPs
Any one with an answer can help
Hi,
You can fulfill your requirement using SP_TransactionNotification.
GO
/****** Object: StoredProcedure [dbo].[SBO_SP_TransactionNotification] Script Date: 01/15/2014 18:11:26 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[SBO_SP_TransactionNotification]
@object_type nvarchar(20), -- SBO Object Type
@transaction_type nchar(1), -- [A]dd, [U]pdate, [D]elete, [C]ancel, C[L]ose
@num_of_cols_in_key int,
@list_of_key_cols_tab_del nvarchar(255),
@list_of_cols_val_tab_del nvarchar(255)
AS
begin
-- Return values
declare @error int -- Result (0 for no error)
declare @error_message nvarchar (200) -- Error string to be displayed
select @error = 0
select @error_message = N'Ok'
--------------------------------------------------------------------------------------------------------------------------------
-- ADD YOUR CODE HERE
--------------------------------------------------------------------------------------------------------------------------------
if(@object_Type='2' and @transaction_type in ('A','U'))
begin
if(not exists (select crd1.address from crd1 where crd1.cardcode=@list_of_cols_val_tab_del))
begin
set @error=1
set @error_message='Address is compulsory'
end
end
-- Select the return values
select @error, @error_message
end
Hope this will help you to meet your requirement.
Regards
Manoj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Above SP_TN is perfect to block BP without address.
Thanks & Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
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.