There is a "Get(ActivePortalRowNumber)" function if that helps. It returns the row number within the portal (startng at 1 for the first row) that has focus.
Unfortunately that didn’t work. I tried changing based on your comment ---
Go to Portal Row [No dialog; Get ( ActivePortalRowNumber )]
Go to Related Record [Show only related records; from table: “x_vendor_component_function”; Using layout: “iPad Comments” (x_vendor_component_function); New window]
Sometime it allows me to add comments in and other times it doesn't. If I click on any the of the preceding fields within the same portal record and then select the comment icon (noted from above) sometimes it will allow me to add comments and sometimes it won't. Its very erratic behavior. I also tried reversing the order the script gets ran
I tried the following using both the example post I found on the web and also the Get(ActivePortalRowNumber) function.
The related record New Window is still Active! You must commit the related record or prevent entry into that window. Being HIdden does do not Commit the record.
Remember, an active or in focus field with a blinking insert cursor, will hold that record active.
Ok I’m now even more confused. If I start off with the portal layout page and I click on the Add Comments Icon What is the script code that needs to be executed to open the new window pop-up to prevent the error message? Sorry I’m just not getting it. I have tried several ways and I’m not sure how this is supposed to be scripted.
I would like to display the portal record like this so that when a user clicks on the plus icon, a page pop ups open for the related portal record "Comments" field that allows them to enter data into the page without the error.
I DO NOT want to add the "Comments" field to the portal row. The example below is what I don’t want to do.
If anyone can assist with this that would be great. What is the script needed to be executed when the icon is clicked on? If there is another script that also needs to be executed upon closing the pop-up window, what is it as well?
Thanks to anyone that can assist with this, my deadline for completing this is tomorrow by 2:00pm and any help would be greatly appreciated.
Set Variable [$Row ; Value: Get (activeportalrownumer ) ]
Go to Portal Row [ no dialgo ; $Row ]
Go to Related Record [ From table: "Child"; New window ]
THANK YOU IT WORKS!!!! I appreciate it
OH Crap, It doesn't work - The way I have created each of my portal's is within a Tab Control. When I select the icon for adding a comment for a particular portal row within a a particular tab the window pops up and the portal record is defaulting to a completely different tab. See Below
Im on the HIE Tab and when I click on the comment icon for the 6th portal record down it jumps to the 6th portal record on a completely different tab "Analytics"
Here is the script: again Is there a way to stay within the same object? Do we need to change the script in order for it to refer to the correct Tab Object?
You can use the Name box in the top of the Inspector's position tab to give each panel in your tab control an object name. Then your script can use the Go to Object step to select a specific tab panel and make it the front tab panel.
From FMP 12 HelpGo to Related RecordPurposeGoes to the current related record(s) in a related table, except when this script step is used from an active portal row.----------------I would call a script to do the task, since by clicking on the Portal row button you put that record in focus. The trick is when the User finishes his comment or Cancels, what do you want to do next? The script must be run from the related table.1) Use show custom dialog to enter as modal Dialog is not as fancy but should return to the spot you were when clicking comment button.2) In script GotoLayout [iPad] and then depending on User Action commit the portal record, Exit Script [WithActionParameter] to decide where to go next , in the calling script you have shown..JIm...
I doubt that your set variable [$Tab step is successfully capturing the object name of the tab panel. I would guess that it will attempt to return the object name of the field or the portal object that is within that tab panel.
Since at that point you already know what tab you are on (you wouldn't be executing these specific lines of code if you weren't), just put the object name of the tab in quotes inside the go to object script step.
Phil you’re correct right the $Tab variable is not capturing the tab name. I have tried just using the object name in the go to object but I’m still having a problem with the correct portal record appearing in the pop-up window. I called FM support and they could not help me. I'm SOL and it’s driving me nuts.
I've always used Go TO Related Record from a portal row from a button in the portal row without the extra scripting here, but I didn't have the record open for editing either and thus didn't need to commit the recor.
Try including the select portal row option in the go to portal row step.
If that doesn't work...
You may have better luck using New window to open the new window and then using go to layout and performing a find to pull up the desired record in your new window.
Note that if you don't want to open the portal record for editing, there are ways to set up the fields in the portal so that the portal record cannot be opened for editing.
Thank you Phil for explaining it better. You must select the portal row to bring it in focus and then you MUST do a new window to keep the Main window with the Tabs visible, if that is what you want. You are wanting the Unix active window effect, the foremost window is in Control, when than window is CLOSED, fall back to the window underneath and Reactivate that window.
Try show custom dialog, not a pretty, but it is a Modal dialog. Leaving the orginal window visable.
if were me, i would go to a layout just for adding the notes and then return to original layout by script calls.