También puedes usar el método AtributoCtrlCombo.GetOldValue() te regresa el valor anterior.
Espero te sirva, saludos cordiales!!
From: carlos.hernandez@zofracro.com
To: gx-l@gxtech.com.uy
Date: Fri, 2 Nov 2012 11:05:35 -0600
Subject: RE: [gx-l] Manejo del valor anterior y posterior de una Transaccion
Buen día, pues utilizar la regla Old, la cual te retorna el valor anterior de un atributo, al retornarte la función el valor anterior deberías de almacenar dicho valor en algún lado porque luego de confirmados los datos el Old del atributo pasaría a ser en nuevo dato grabado.
Old Function
Scope
Objects: Transactions
Languages: .NET, C/SQL, Cobol, Java, RPG, Visual Basic, Visual FoxPro
Interfaces: Web, Win
Purpose
Returns the last stored value of a given attribute.
Syntax
Old(Attribute)
Type Returned:
Same as its argument
Description
Returns the last stored value of a given attribute = Attribute. The type definition which is returned is equal to attribute's type definition.
If attribute is a non-redundant formula, the returned value is the result of evaluating the formula using the last stored values of the Attributes involved in the formula.
Example
Let us suppose we want to simulate an ADD rule to update PrdStk (Product Stock) from a Receipt Transaction, where RcptQty (Receipt Quantity) is the quantity received of a certain product. It should be done in the following way:
// STOCK update (add simulation)
PrdStk = PrdStk + RcptQty IF Insert;
PrdStk = PrdStk + RcptQty - Old(RcptQty) IF Update;
PrdStk = PrdStk - RcptQty IF Delete;
At insert time we add the quantity purchased of the product to the previous stock. At update time, we are allowed to modify such quantity (if necessary). To achieve this, we add the new quantity, but we have to subtract the one previously entered. We do this by subtracting the "old" value entered for RcptQty. Finally, in cases where a delivery has been turned back, we have to perform a Delete operation (cancel the previous entry), and subtract the quantity indicated by the Receipt.
All this is functionally equivalent to the following ADD rule:
ADD(RcptQty, PrdStk);
Saludos.
De: Jair Osma [mailto:jair.osma@gmail.com]
Enviado el: Viernes, 02 de Noviembre de 2012 10:52 a.m.
Para: gx-l@gxtech.com.uy
Asunto: Re: [gx-l] Manejo del valor anterior y posterior de una Transaccion
Una manera que se me ocurre es usando una variable websession que almacene todos los datos de la transacción al inicio y luego en el aftervalidate grabar en una segunda variable de websession la info de la transaccion modificada y luego invocar un procedimiento que se encargue de comparar los dos contenido y así obtener el antes y el después
Cordial saludo,
Jair
El 1 de noviembre de 2012 10:46, cer@adinet.com.uy <cer@adinet.com.uy> escribió:
Hola, hay alguna manera de poder trabajar con el valor viejo y el nuevo
en una Transaccion?
Ejemplo: Tengo en una Transaccion el atributo Estado.
Los valores del Estado pueden ser: Ingresado, Pendiente, Finalizado,
En Proceso, y Dado de Baja.
El usuario puede seleccionar el Estado (mediante un dinamic ComboBox).
Como puedo saber el valor que tenia dicho atributo antes de ser
cambiado?
Gracias
-----------------------------------------
Para Suscribirse/Desuscribirse:
http://www.gxtechnical.com/cgi-bin/hforum.exe?2,3,30,1
Por consultas owner-gx-l@gxtech.com.uy
0 Response to "RE: [gx-l] Manejo del valor anterior y posterior de una Transaccion"
Publicar un comentario