on 10-27-2015 12:12 PM
Hi Experts,
This is my SP Query .This query is made for only for Production order .This query is executing perfectly.
While adding marketing documents more than 19 documents . And SP Query is Reflecting here. How i can overcome this problem
I want this query only in production order not in other documents.
If @object_type='202' and @transaction_type='a'
declare @doc int
set @doc=(select count(DocNum) from OWOR where Status like '%[pr]' )
BEGIN
if exists( select T1.[DocNum] FROM OWOR T1 where T1.[DocEntry]=@list_of_cols_val_tab_del and @doc>=19)
BEGIN
SET @error=-1
SET @error_message=N'Open work order Exceeds 19 Orders'
END
END
Please Help me
Regards
Ram
Hi
I didn't understand exactly what you need but I think you cab use this:
@object_type='202' and @transaction_type='a'
@doc int
@doc=(select count(DocNum) from OWOR where Status like '%[pr]' )
if @doc>=19
BEGIN
SET @error=-1
SET @error_message=N'Open work order Exceeds 19 Orders'
END
shachar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi sir,
Actually my requirement in production order open documents must not exceed 19 . If i add 20 th document i want one error message and document should not to be add.
In my system while executing above query in SP_Transaction Notification .The SP Query executing succesfully.
While adding 20 th document in production order .The document is not adding but it ok. But,
While adding 20 th document in sales order ,Delivery, purchse order .The error message is coming.
What can i do to overcome this problem.
The SP query is what i posted above one is.
Thanks & Regards
Ram
Hi
Now I understand the problem.
You need to put"BEGIN" after the condition and END at the end
use this query it should work
If @object_type='202' and @transaction_type='a'
BEGIN
declare @doc int
set @doc=(select count(DocNum) from OWOR where Status like '%[pr]' )
BEGIN
if exists( select T1.[DocNum] FROM OWOR T1 where T1.[DocEntry]=@list_of_cols_val_tab_del and @doc>=19)
BEGIN
SET @error=-1
SET @error_message=N'Open work order Exceeds 19 Orders'
END
END
END
shachar
Hi
dose it work now?
shachar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
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.