on 10-21-2016 8:29 AM
Hello Experts!
I'm trying to create a blocking notification for my opportunities module. We plan to block the updating of the opportunity whenever the user fails to provide at least one reason for a "Lost" opportunity. I have created trans notif query for this
DECLARE
@Status as varchar (10),
@Reason as varchar (100)
IF (@object_type = '97' AND @transaction_type in ('A','U'))
BEGIN
SELECT @Status = a.status, @Reason = a.Reason from OOPR a inner join OPR5 b on a.OpprID = b.OpportID
WHERE a.OPPRId = @list_of_cols_val_tab_del
IF @Status = 'L' and @Reason = '' and @Reason is NULL BEGIN SET @error = -97 SET @error_message = 'Please input reason'
END
END
Please advice as to what I can change with this code.
Immediate response would be much appreciated.
Thank you.
Hi Nikka,
Try this:
IF (@object_type = '97' AND @transaction_type in ('A','U'))
BEGIN
DECLARE @Status as varchar (10), @Reason as int
SELECT @Status = status, @Reason = Reason from OOPR WHERE OPPRId = @list_of_cols_val_tab_del
IF @Status = 'L' and ISNULL(@Reason, 0) = 0
BEGIN
SET @error = -97
SET @error_message = 'Please input reason'
END
END
Kind Regards,
Diego Lother
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
6 | |
6 | |
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.