1 Reply Latest reply: Jul 2, 2013 3:27 PM by user9098259 RSS

    Getting value from an item in previous record in tabular form

    user9098259

      Good afternoon,

       

      I will try to explain my problem:

       

      I have a tabular block with items X, Y and Z (all are database items)...

      On the first record the user is required to put the values for all the items...

      For the rest of the records the X value has to be the value of Z in the previous record.

       

      How could i do this and what is the best way to do so?

       

      Thanks in advanced.

      Daniel Guzzo

        • 1. Re: Getting value from an item in previous record in tabular form
          user9098259

          Ok, problem solved by myself:

           

          IF :system.CURSOR_RECORD!=1 and :global.rec_changed=0 THEN

                 :global.rec_changed:=1;

                 PREVIOUS_RECORD;

                 :global.fec_hasta:=to_char(:cret_prod_pol_renovacionesb.crpn_fe_hasta,'DD-MM-YYYY');

                 NEXT_RECORD;

                 :global.rec_changed:=0;

                 IF :global.fec_hasta is null THEN previous_record; end if;

                 :cret_prod_pol_renovacionesb.crpn_fe_efectiva:=to_date(:global.fec_hasta,'DD-MM-YYYY');       

          --MESSAGE(:global.fec_hasta);

          END IF;


          If anyone have a better solution it will be welcome.

          Thanks