Skip to Content
author's profile photo Former Member
Former Member

A/R invoice (making udf mandatory)

Hi All Experts,

I am trying to make some UDF mandatory in A/R Invoice as object_type '13' and transaction_type 'A' and 'U'.The problem is it not at all working and this invoice is sent for financial approval ,i am trying this which is wrong query as

IF @transaction_type = 'A' AND @object_type = '13' 
BEGIN    
if exists (Select T0.cardcode from oinv T0 where T0.U_Region is null and T0.DocEntry=@list_of_cols_val_tab_del)
	begin
		SET @error = 10
		SET @error_message = N'Enter Region'
	end
END

Can any one guide me with right query in repect to the approval process.

Regards,

Inder

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

14 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2009 at 08:42 AM

    Hi,

    seen already fro those i had cleared all other notificaton and tried it alone its still enter into Draft.

    Regards,

    Inder

    Add a comment
    10|10000 characters needed characters exceeded

    • When an approval procedure is activated, the transaction is stored as a draft in the ODRF table. And the object type passed to the procedure is 112 !

      So you should write different code to manage the draft documents. For example for an invoice you should start your code with something like this:

      IF @transaction_type = 'A' AND @object_type = '112' 
       And  (Select ObjType From ODRF
             Where DocEntry = @list_of_cols_val_tab_del)='13' --. 

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2009 at 04:14 AM

    Hi,

    any one

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2009 at 04:29 AM

    Hi!

    Try this

    IF @transaction_type = 'A' AND @object_type = '13' 
    BEGIN    
    if exists (Select T0.docentry from oinv T0 where (T0.U_Region is null or T0.U_Region = '') and T0.DocEntry=@list_of_cols_val_tab_del)
    	begin
    		SET @error = 10
    		SET @error_message = N'Enter Region'
    	end
    END

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2009 at 05:28 AM

    Hi Thanga Raj K,

    Same no response from the invoice i am confused it is not displaying any thing from this query's. and yes, It do have and approval window attached to it .Do i need to check draft also..?

    Regards,

    Inder.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2009 at 05:48 AM

    Thanga Raj K,

    Yes, i am doing it SBO_SP_TransactionNotification procedure..

    There are different validations too.but those are working.. but this one is a only one not working .

    i am trying all this in test DB.

    Regards,

    Inder

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2009 at 06:45 AM

    Yes,

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2009 at 07:23 AM

    Now. what to do?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 18, 2009 at 07:36 AM

    Your original code is working with a numeri/alphanumeric type field without default value. (With @transaction_type In ('A','U') modification for update transactions).

    What is your field type?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2009 at 07:43 AM

    Hi,

    Its nvarchar(MAX) in DB

    Regards,

    Inder

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2009 at 08:54 AM

    Hi,

    Is any other detail required to solve this one??

    help???

    Regards,

    Inder

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.