Error: reference to object not established as an instance of an object. Genexus

1

The situation is as follows.

I have the condition of filling in an SDT , but I want to clean up a decision variable and mark the following error:

  

Reference to object not established as an instance of an object.

The code is as follows:

if &ban = 2     
            if &kar_anio2 = &anterior
                if &kar_periodo2 = &mes_anterior
                    if &esObservacion = "SI"
                        &sdtCeldaItem.pperiodo_anio = &kar_anio2
                        &sdtCeldaItem.numCeldas = 1
                        &sdtCeldaItem.pperiodo_num = &periodo_num
                        &sdtCeldaItem.mperiodo_nom = &kar_periodo2
                        &sdtCeldas.Add(&sdtCeldaItem)
                        &sdtCeldaItem= new SDTCeldasCombinar.SDTCeldas()
                        &anterior = &kar_anio2
                        &mes_anterior = &kar_periodo2
                        &esObservacion = "NO"
                    endif
                endif
            endif
        endif

The variable to which I want to assign a value is what is called &esObservacion .

    
asked by user14408 13.09.2016 в 20:09
source

1 answer

1

I think the error may come from wanting to assign properties of &sdtCeldaItem without having initialized it previously.

Try to move line &sdtCeldaItem= new SDTCeldasCombinar.SDTCeldas() before the first assignment, in this case: &sdtCeldaItem.pperiodo_anio = &kar_anio2

    
answered by 13.09.2016 в 22:15