on 05-08-2012 6:40 AM
Hi Tam,
pls help me a stored procedure for blocking a UDF in Purchase Invoice
when first we create the purchase invoice user select the UDF field and post the document..
My requirement is further update to the field to be blocked..
i am using SP is
IF @object_type = N'18' and @transaction_type IN (N'U')
Begin
Declare @INV1 as Nvarchar(200)
Select @INV1=U_assignedfor From OPCh Where DocEntry=@list_of_cols_val_tab_del
Declare @INV2 as Nvarchar(200)
Select @INV2=U_assignedfor from PCH1 T1 Inner Join OPCH T0 ON T0.Docentry=T1.Docentry where T1.DocEntry=1
if @INV2 NOT IN (@INV1)
Begin
Set @error =207
Set @error_message =(CONVERT(nvarchar(20), @INV2))+(CONVERT(nvarchar(20), @INV1))
End
End
But in this SP @inv1 and @inv2 Take the same value
Yours AjiAlukkal
Declare @INV1 as Nvarchar(200)
Select @INV1=U_assignedfor From OPCh Where DocEntry=@list_of_cols_val_tab_del
Declare @INV2 as Nvarchar(200)
Select @INV2=U_assignedfor from PCH1 T1 Inner Join OPCH T0 ON T0.Docentry=T1.Docentry where T1.DocEntry=1
That is because you are setting them to the same value. The second query only adds the PCH1 table to you OPCH query.
Did you set the U_assignedfor in the current AP Invoice the same value as the very first AP Invoice entered?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
102 | |
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.