Go to Portal row - Selecting when multiple portals exist in a layout
How can I select which portal the "go to portal row" function goes to when there are multiple portals that exist on one layout.
Set a script step before it which is Go To Field and specify a filed in that portal. Naming the Portal as an object may work too, but I always use the GTF script step.
I suggest using the name box in the Inspector's position tab to give the portal an object name.
Then you can use Go To Object to set the focus on the desired portal before using go to portal row to select the portal row. An object name is a tiny bit less likely to be changed during a future interface update. (Go to field will fail to set the focus correctly if that field is later removed from the portal and in some cases, the same field may be also located in more than one portal or directly on the layout...)
An even better alternative is to write code that does not require the go to portal row step at all...
Good observation Phil, the reason I use the protal is because I have one slae transaction that can have 1 to 4 inventory subtractions so I created a seperate table that actually removes the product sold, there for I had no choice but to use a portal.
Actually, you do not need to interact with the portal rows in such a script.
you can freeze the window, use go to related records to pull up the line item records in a found set on a layout based on the portal's table, process the records there as needed, (add more related records, modify the values in existing records, etc...) and then return to the original layout where you'll see the results of the script automatically displayed in the portal.
Ah yes, good call. I'll do that. For some reason when I switched to your suggestion of go to object it broke the script. I wasn't able to loop throught the entries to void them. I'll use the related record step to avoid the portal.
With go to object, you'd do this once, before the start of the loop. I wouldn't be suprised if using go to object inside the loop reset the focus to the first portal row each time, which would interfere with go to portal row [next...
I did put it on the outside of the loop function in fear of that exact reason.
Ok, the related record method works perfectly, thank you.
Hmmm, then it should work. I use this system all the time in cases where I can't avoid portal row interaction (such as scrolling a portal to expose a specific portal record.)
I know why it didn't work, I looked into it out of curiosity. After I select the portal and click in the name box to give it a name it automatically goes to the portal and creates what looks like a text box between my fields and the portal itself. I delete the text box and try again and it does the same thing. Ever seen this?
Not sure what you are describing. You can post your script here if you'd like.
To post a script to the forum:
This isn't related to the script. what I'm describing is coming from the inspector. First I select the portal I want to name, then I click on the position tab in the inspector. I then click into the name field and start typing a name. For some reason it jumps to the portal and starts writing out what I'm typing into a text field. I first thought this was normal for a portal since I'd never given a portal a name before. After the script wasn't gaining access to portal the way I was expecting I realized the name was never applying itself to the portal but instead created a text field that was laid overtop of the portal. Every time I removed it and tried giving a name to the portal again it did the same thing.
That is truly odd behavior that I've never seen....
Make sure that you see selection boxes around the portal's top row before trying to assign an object name. Check to make sure that you are selecting the portal and neither an object inside the portal nor a group of objects that includes the portal. (Click the bottom portion of the portal, then click Ungroup if the Ungroup button in the arrange and align section of the portal isn't grey...)
Actually, I have seen this before and can reproduce it now that I think of it.
This happens if the focus is on the portal instead of the Inspector.
Make sure that the last thing you do before typing the object name is to click inside the Name box at the top of the Inspector's postiion tab.
You are correct, somehow I was clicking elsewhere. Thank you.
Retrieving data ...