It would help to see your script so we know why a different tab panel becomes the front tab panel. It may be possible to change that script such that the current tab panel stays in front, it may be necessary to include a go to object or go to field step to put the focus back into the tab panel that was in front when the script was first performed.
To post a script to the forum:
- You can upload a screen shot of your script by using the Upload an Image controls located just below Post a New Answer.
- You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here. (with this approach, you can get multiple script steps on the same line, please edit the pasted text by inserting some returns to separate those steps.)
- If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
- If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.
All objects have a script trigger on object enter that runs this first script, just to grab the current contents. except images and signature fields.
Script Triggers: Trigger | Set current contents
#this script merely grabs the current fields contents adn sets teh global variable with it.
Set Variable [ $$oldcontents; Value:Get ( ActiveFieldContents ) ]
Then all object have another script trigger for verification that runs this script.
Script Triggers: Trigger | Audit Trail
#this will run when any changes are attempted to be made to an item. and will enter them into an audit trail
Set Error Capture [ On ]
Set Variable [ $afn; Value:Get ( ActiveFieldName ) ]
Set Variable [ $afc; Value:Get ( ActiveFieldContents ) ]
Set Variable [ $aon; Value:Get ( ActiveLayoutObjectName ) ]
#script triggers can be: nottext ; recordview ; if nothign script assums field edit #nottext used for field that are not text based
#recordview used for when a record is viewed
Insert Calculated Result [ Assets::Audit Trail; Case ( Get ( ScriptParameter ) = "" ; ¶ & Get ( CurrentTimeStamp ) & " " & Get
( AccountName ) & " changed " & $afn & " from:" & $$oldcontents & " to:" & $afc ; Get ( ScriptParameter ) = "nottext" ; ¶ & Get ( CurrentTimeStamp ) & " " & Get ( AccountName ) & " changed " & $afn ; Get ( ScriptParameter ) = "recordview" ; ¶ & Get
( CurrentTimeStamp ) & " " & Get ( AccountName ) & " viewed this record " ) ]
And it works fine, until the script ends then I'm dropped on the audit tab with the audit field active and editable. but i just want to be left where i was editing with this to run in the background away from the user. am I going to have to put the audit field on its own layout?