April 29, 20214 yr Newbies I have the following problem, I don't know how to make this specific script work properly. Sorry if it is in spanish since it was made for spanish speakers in mind I have four tables, Factura, Detalle_Factura, Presupuesto y Detalle_Presupuesto The relationship of these tables is like this This is the layout in which I am trying to run the script. The portal below has the data from Detalle_Presupuesto and I need to pass that data from the portal to Detalle_Factura This is the script I am trying to use but it only copies the first row of the portal row, I tried to do a loop too but it runs forever too This is the layout I am trying to feed, the portal below has the data of Detalle_Factura and I need to feed it with the data of Detalle_Presupuesto I do have an empty presentation with the data of Detalle_Factura In case this doesn't help, I am leaving a temp link with the database itself Edited April 29, 20214 yr by Ocean West added images inline.
April 29, 20214 yr First of all: is there a reason why you cannot import the records from the Detalle_Presupuesto table into the Detalle_Factura table? Even before that: do you really need two sets of data? Couldn't you simply flag the record in the parent table as a "factura"? Now, I can't really follow your script. I think that if you really want to copy the related records in the Detalle_Presupuesto table, one by one, into the Detalle_Factura table, you should start by creating a found set of these records in a layout of the Detalle_Presupuesto table. This is easy to do using the Go to Related Record script step: Go to Related Record [ Show only related records; From table: “Detalle_Presupuesto”; Using layout: "Detalle_Presupuesto" ] Then just loop over these records using: Go to Record/Request/Page [ Next; Exit after last ] No counter is required for this. Of course, this assumes you have already created a parent record in the Factura table and stored its unique ID in a variable, so that you can link the records you will create in the Detalle_Factura table to this record. Finally, this caught my eye: you really don't want to use a random number as the $factura_id - certainly not a number drawn from a population of 500! Use either a serial number or a UUID.
Create an account or sign in to comment