Jump to content

Commit a Record across all of it's open Windows?


This topic is 1954 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I work a lot with multiple windows open on the same Record. Something that is driving me mad right now is; I have a Field open in one Window and I try to edit the same Record in another Window. But of course I get the Record Locked message. Because I have multiple Windows open I have to go clicking through all my open Windows to release the Record -  which is very irritating. I thought of making a Script containing the Commit command which I could quickly run with a Command-[Number] keystroke. But Commit only works on the frontmost window. 

Is there some workaround that would let me Commit the Record across all of it's open Windows?

 

Link to comment
Share on other sites

I think you gave the answer yourself:

Quote

 

 I have to go clicking through all my open Windows to release the Record -  which is very irritating. 

 

The script would have to do the same thing (except the getting irritated part). And you would probably want to check that the record is the same one before committing it.

Link to comment
Share on other sites

The number (and names) of open Windows are never the same - so a Script that steps through known Windows will not work.

 

I was trying to think of something 'out of the box' - ie: use a Script Step not really intended for that purpose. I tried scripting switching from Preview Mode and back to Browse Mode but again that only works on the frontmost Window. Is there anything more systemwide? 

Link to comment
Share on other sites

Off the top of my head, I imagine it could look something like (untested, pseudocode):

Set Variable [ $recordID ; Get (RecordID) ]
Set Variable [ $originalWindow ; Get (WindowName) ]
Set Variable [ $openWindows ; WindowNames ("") ]
Set Variable [ $n ; ValueCount ( $openWindows ) ]
Loop
  Set Variable [ $i ; $i + 1 ]
  Exit Loop If [ $i > $n ]
  Select Window [ GetValue ( $openWindows ; $i ) ]
  If [ Get (RecordID) = $recordID and Get (RecordOpenState) = 2 ]
    Commit Records []
    Exit Loop If [ 1 ]
  End If
End Loop
Select Window [ $originalWindow  ]  

 

Link to comment
Share on other sites

This topic is 1954 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.