January 14, 201213 yr Hi, I am new to this forum, and could use some help with a script. I have found this script on this forum and adjusted it. The script is working almost fine, but i have a problem with the portal rows. Only the first row from the portal is copied and the others not. The reason that i want to copy is that i don't want to type the data twice. I have a screenprint from the script attached. Thanks, Frans Script copy record with portal.doc
January 17, 201213 yr Author Hi, I have solved the problem with the script see below, but now i have another question. I try to perform the script from a layout (with a button) to copy the entries from the portal to another portal in an external filemaker file. The script works but i cannot open a new record in the external file. I have tried it also with an "perform script" in the original script then he opens a new record but i think that the variables are empty. Has someone a clue how i can handle this Thanks, Frans If [ Verkoopopdrachten::FactuurID ] Set Variable [ $FactuurID; Value:Get(RecordNumber) ] Show Custom Dialog [ Title: "Vrachtkosten aanmaken"; Message: "U gaat nu een kopie maken van deze Factuur om de vrachtkosten te declareren, wilt u dit"; Buttons: “Cancel”, “OK” ] If [ Get (LastMessageChoice)=1 ] Exit Script [ ] End If Go to Related Record [ From table: “Verkoopopdrachten”; Using layout: <Current Layout> ] [ Show only related records; Match found set ] Duplicate Record/Request Go to Record/Request/Page [ $FactuurID ] [ No dialog ] Loop Set Variable [ $productitemnummers; Value:Artikelen::Productitemnummer ] Set Variable [ $Beschrijvings; Value:Artikelen::Beschrijving ] Set Variable [ $Hoeveelheids; Value:Artikelen::Hoeveelheid ] Set Variable [ $Valutas; Value:Artikelen::Valuta ] Go to Record/Request/Page [ Last ] Go to Layout [ “Formulierweergave” (Verkoopopdrachten) ] Set Field [ Verkoopopdrachten::Formnaam; "Vrachtkosten" ] Set Field [ Verkoopopdrachten::Verzendingsstatus; "Vrachtkosten" ] Set Field [ Artikelen::Productitemnummer; $Productitemnummers ] Set Field [ Artikelen::Beschrijving; $Beschrijvings ] Set Field [ Artikelen::Hoeveelheid; $Hoeveelheids ] Set Field [ Artikelen::Valuta; $Valutas ] Go to Record/Request/Page [ $FactuurID ] [ No dialog ] // Duplicate Record/Request Go to Portal Row [ Select; Next; Exit after last ] End Loop Go to Record/Request/Page [ Last ] Delete Portal Row [ No dialog ] End If
Create an account or sign in to comment