November 9, 201015 yr Item table has a historical values table. There can be multiple historical values per item. The relationships is defined that historical values can be deleted/created/etc from the item. I have a script to update the historical values with current info from the item table. What is happening is that it seems to be overlaying the existing portal row rather than creating another one. Freeze window Go to layout [item layout with the history portal in it] show all records go to record/request/page [first] loop go to portal row [last] set field [historical::value; item::value] ..then several more set field lines.. end if go to record/request/page [next;exit after last] end loop go to layout [original layout] When I first run the script it adds the portal row fine. If I change the value in the item record and rerun the script it seems to simply replace the values in the portal row rather than add another row with the new values. What am I doing wrong? Edited November 10, 201015 yr by Guest
November 10, 201015 yr Newbies What version of FileMaker are you using? Perhaps you can give the portal a name and add a go to object(the portal name) script step right before the step "go to last portal row".
November 10, 201015 yr Author The problem isn't that it doesn't find the portal it does. It does add the portal row. The problem is that if you run the script again it doesn't add a second row. It seems to replace the values in the first row.
November 10, 201015 yr Add a commit records step in your script after setting the values in the related record
November 10, 201015 yr Author Nope. Still not working. The first time I run the script I get portal rows as I expect. The next time I run the script it is not creating a second row. Looks like it is updating the existing row.
November 10, 201015 yr Author What was missing was a go to field step before going to the portal row. I hadn't mentioned in my post that there was more than one portal on the layout. So #1 added the commit, #2 added the go to field. Works fine now.
Create an account or sign in to comment