I think it's because you never increment the $portal variable, you always go to Portal Row [select; No dialog ; 1].
i do at close to loop end. =)
I used a show custom dialog to track.. and its going from 1 -> end.. just not getting the values.. :/ am guessing its the set field that are wrong.. :/
Hum, sorry about that, I thought you were going through the portal in the inside loop, not the outside one.
What does your debugger says?
My debugger is not saying anything (sitting on Pro) :/
So maybe instead of going through your portal using the $portal counter, use "Go to portal row [first]" before the first Loop, and instead of Set Variable [$portal ; $portal + 1] write Go to row [Next; exit after last]
And get rid of the Go to Row in the inside loop.
So one loop for the rows (outside), one loop for the fields (inside).
i see what you are going. =) already tried that one..
And by using the Show Custom Dialog, am printing Get(ActivePortalRawNumber) it shows that its working..
That one tells me "Software field" and ActivePortalRow. but it looks like this every row:
Microsoft Access - 1
Microsoft Access - 2
Microsoft Access - 3
Microsoft Access - 4
Microsoft Access - 5
It should be looking like this:
Microsoft Access - 1
Adobe Acrobat Standard - 2
Adobe Acrobat Pro - 3
Microsoft Office - 4
SnagIT - 5
Same thing with using "Go to Portal Row".. :/
It looks like you start the script from the child table, then go "Home" and try to work through a portal.
Does it make more sense to simply run within a found set on the child table?
Even if you were starting from the "Home" Layout, I would pop a new window, GTRR and work from the found set in the child table. It is easier to do than to try to work through the portal.
Thanks for giving it a try =)
Home is main page..
Software table is the location of the data am creating logs from.
Log table is the where am trying to create new records in..
And then end up at Home again..
So you think its better to go Home -> Software -> Logs -> Home ?
You might be right,
So basicly i do.
- Set the variables i need
- Search the criterias i need
- Creates the tables and values i need
That way i basicly leave the portal as it is.. Yaa you might be right.. =)
But the function it self then,, to grab information from inside a portal.. shouldnt that be possible ? since i already have the search and criteria ready there.
Looks like you have some things in the wrong order.
You set all of your variables before you Go To Portal Row, then right after that, you go to a different layout, which will lose the focus of the portal.
On your inside loop, the 2nd - last times, you are going to a portal row, but you are on a different layout than the first time. Is there a portal on the Logs layout?
You set your variables right after you Go To Object, but before your Go To Portal Row step. I think your custom dialog might be misleading you. I would assume that it would go to the first line every time you go to that object without specifying a row, so I'm not sure why that number is incrementing for you.
Anyway, long story short (too late!), I would move your Go To Portal Row step up to just under the Go To Object step (line 32). That should produce the results you are after.
Looking at a couple areas:
You go to a portal row and set your focus there
Then you go to another layout and lose the focus you just got
Sitting on the Logs table, you are setting a field to a value including Software::Software...and you are getting the value from the first related record....over and over.
If you loop through the records having the values you actually want, while residing on the table where those records are, the focus changes will be easier to manage and you won't be wrestling with which related record you want to look at.
Multiple ways to defur a feline...I just tend toward the ones that are simple and clear. If I want a list of software, I want to be on the software table.
If I want the software on a single computer, I start at the computer, GTRR to the software table, and get it.
So much simpler (mentally for me) than trying to fight with portal row focus maintenance.
To a large degree...it's preference.
Thanks guys.. ! =)
I have followed your advice, rewriting the code to get the information from the Software table instead.
As you say, simpler in the mind =D