Commit Records should do the trick for this, but you can lose the "focus" on the given portal row so you may want to use Get ( ActivePortalRowNumber ) to capture the current portal row in a variable. Then you can capture the portal row number, commit records, use go to object and go to portal row to return the focus to the portal row and then do the rest of the steps you need to do for your script to do what it needs to do.
Unfortunately it does not work, here are the steps of my script : http://screencast.com/t/w19Nwq7qJO0
It's clearly a dumb focus issue as just "manually" clicking in any field before clicking the button makes the script work perfectly...
Any other idea ?
Is there any way to "force a click somewhere", which whereas not elegant at all should solve my issue...
Anyone has another idea on how to solve this ? I'm stuck.
What happens when you run the script. I'm puzzled as to why it changes layouts creates a new record and then tries to capture the active portal row number in a variable, then never returns to the original layout.
I've successfully used the method I have described here in my own systems.
(PS. I respond to a lot of threads here and have had to limit my responses to 1 per day for any given thread...)
It's not exactly the work flow, here a few screenshot with explainations :
1) text is entered in the portal main field and
2) the button is clicked :
3) the button script basically does what you told me was necessary + what I need (which is simply : go to layout + create new record + insert in a field the ID passed as parameter which is then used to display the corresponding data)
4) on the target layout the ID passed as parameter is not set :
And where it's getting really annoying is that if I simply click in another field BEFORE clicking the button then the parameter is really correctly passed :
If I choose to change the script to display a dialog when the function "go to portal row" runs I see the function go to portal row clearly goes to the correct row.
Any clue ?
PS : no problem, I see you're busy but I just hope we solve this one in the next days
Aha, I get it now.
The script parameter is passed to the script BEFORE the record is committed.
Just don't use the script parameter and this will work.
Instead of using a script parameter, add a set variable step after the focus is reset to the portal row that copies this value into the variable.
Then, once you have created your new record, use set field to copy the value from the variable to the field in the new record.
THANKKKS a LOOOT !
It's working perfectly now !