Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2806

Re: SP_Transaction_Notification to block sales orders from being added or updated if they don't have a batch allocated to an item

$
0
0

I found how to attribute the request result to a variable, but the variable don't reset for a new process, it get the first result and it was repeated  in the next operations.

Now, my first question is how can i reset the variable for a new execution of the script.

The second is how can i integrate the variable into the output message to the user, with another texte.

This is my new request:

 

LANGUAGE SQLSCRIPT

AS

 

 

-- Return values

---------------------------------------------------------------------------------

error  int;                       -- Result (0 for no error)

error_message nvarchar (200);           -- Error string to be displayed

cnt int;

cnt2 int;

article nvarchar (200);

begin

error := 0;

error_message := N'Ok';

--------------------------------------------------------------------------------------------------------------------------------

if :object_type='15' and (:transaction_type='A' or :transaction_type='U') then

--Scenario#1: Case whene Quantity value = 0 --CardName is blank

 

    SELECT TOP 1 "Dscription" INTO article from (SELECT T0."DocEntry",T0."Dscription"

  FROM DLN1 T0 

  WHERE T0."Quantity"=0 or T0."Quantity" is null )

  WHERE "DocEntry" = :list_of_cols_val_tab_del;

  if article is not null then

            error := -111;

            error_message := 'Message to the user'+article;

    end if;

end if;

   -- Select the return values

select :error, :error_message FROM dummy;

end;

 

 

 

Thank you for your answers.


Viewing all articles
Browse latest Browse all 2806

Trending Articles