on 09-10-2014 7:14 AM
Hello Expert,
I created one TN to block to add Purchase order if 6 PO for the particular vendor is open.
The following TN is working fine if we do not given any Approval template to it.
The TN is as follows:-
IF @object_type = '22' AND @transaction_type IN ('A')
BEGIN
IF ((SELECT Count(t1.docentry) FROM OPOR t1
where CardCode=(Select Cardcode from OPOR where docentry=@list_of_cols_val_tab_del ))) > 6
BEGIN
SET @error = -2
SET @error_message = ' You Cannot Perform this Action Because this vendor already 6 or greater that 6 Purchase Order Open'
END
END
Now I want modification in the TN is as follows:
Now i applies Approval Procedure then,
1) if for a particular vendor if 6 PO is opened then next PO will not be added,
2) As well as no draft document will be added in the system.
Regards,
Sandesh
Hi Sandesh,
TN and approval can't be co-exist. You have to decide only using one of them. If approval is needed for any PO that opened more than 6 for a vendor, go for approval by termed condition. TN will be no need.
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandesh,
1. I think that you need other test in the where clause because if the customer has more than 6 PO closed the TN will not allow the user to add other PO.
2. Please post the query that you use in the Approval.
Regards,
Augusto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello sir,
Given TN is working fine when I not used approval procedure.
But when I added approval procedure,it stored that PO in draft until I not approve it and add that PO.if i used above TN, it give permission to add draft,after i approve it and try to add PO then it gives me Block msg error.
I need it to block to add draft in this case if 6 PO is open in the system for the specified vendor....
Regards,
sandesh
Hi,
1. In your TN you have to add
where T1.DocStatus = 'O' and CardCode .. (and the rest that you have)
2. You need to create a query more or less like this:
SELECT 'True' from OCRD T0 Where T0.[CardCode] =$[OPOR.CardCode] and (SELECT Count(t1.docentry) FROM OPOR t1
where T1.CardCode=(Select T1.DocStatus = 'O' and Cardcode from OPOR ))) < 6
3. In the approval you have to remove the always and select "When The Following Applies"
4. in the query name you have to select the query that you created in 2.
Hope it helps,
Augusto
Hi,
The TN is to avoid the user to add a document if the customer has more than 6 open orders,
The approval I don't know why you need it but if you need other user to approve the PO, you need the approval.
If you just want to avoid the user to add a PO if the customers has more than 6 open PO you just need the TN.
I hope it helps,
Regards,
Augusto
Hello Expert,
Please give me solution....
Regards,
Sandesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
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.