February 20, 201114 yr I am new in data bases so I still know only a few things, hope you can help. I’m trying to make a script to generate records based on related ones but I can’t end it. First related record goes ok, then goes to the next and ok too, but on the third goes back to the first and jumps to next, so I get first and second record ok and a nonstop second record. I’ll appreciate your help. Set Variable [ $P1; Value:Table 1::P1_ID ] Go to Related Record [ From table: “Table A”; Using layout: “Table A” (Table A) ] [ Show only related records ] Go to Record/Request/Page [ First ] Loop Set Variable [ $As1; Value:Table A::A1_ID ] Go to Layout [ “Table B” (Tabla ] New Record/Request Set Field [ Table B::A1_ID; $As1 ] Set Field [ Table B::P1_ID; $P1 ] Go to Related Record [ From table: “Table A”; Using layout: “Table A” (Table A) ] [ Show only related records ] Go to Record/Request/Page [ Next; Exit after last ] End Loop
February 20, 201114 yr a script to generate records based on related ones I am not sure what exactly are you trying to accomplish here. I think you want: Set Variable [ $P1; Value:Table 1::P1_ID ] If [ not IsEmpty ( Table A::P1_ID ) ] Go to Related Record [ From table: “Table A”; Using layout: “Table A” (Table A) ][ Show only related records ] Go to Record/Request/Page [ First ] Loop Set Variable [ $As1; Value:Table A::A1_ID ] Go to Layout [ “Table B” (Table ] New Record/Request Set Field [ Table B::A1_ID; $As1 ] Set Field [ Table B::P1_ID; $P1 ] Go to Layout [ “Table A” (Table A) ] Go to Record/Request/Page [ Next; Exit after last ] End Loop End If
Create an account or sign in to comment