March 24, 20178 yr I'm looking to create a script and place it in a button to exist on two layouts (BACKUP and MAIN), to accomplish the following when activated from either layout: Copy current ACCTNUMBER If current layout is MAIN then go to BACKUP layout and show the same ACCTNUMBER record. else if current layout is BACKUP then go to MAIN layout and show the same ACCTNUMBER record. ....I'm sure it's a no brainer but right now I'm totally missing some small step to start the script ....help? Edited March 24, 20178 yr by AbsoluteVoice4u correction
March 24, 20178 yr Why don't you define a relationship between the two tables (assuming the two layouts are showing records from two different tables), then use Go to Related Record[] as the button action (no common script necessary)?
March 24, 20178 yr Author Thank you for your response and suggestion. All records are within the same table and I just need the script step to identify which button the layout is on. Edited March 24, 20178 yr by AbsoluteVoice4u
March 24, 20178 yr 4 minutes ago, AbsoluteVoice4u said: All records are within the same table Are the two layouts also based on the same table occurrence? If so, all you need to do is go to the other layout. Again, no script is required: just set each button to go to the "other" layout.
March 24, 20178 yr Author Great thinking however there are 18 layouts in this solution and yes, all based on the same table occurrence. I could place the layouts next to each other in the menu order and go previous and next for each button but would rather identify the present layout and have it go to the other of the two. Any help on doing that? Edited March 24, 20178 yr by AbsoluteVoice4u
March 25, 20178 yr It does sound like you're over-complicating it, but maybe you want to pass Get (LayoutName) as a script parameter?
March 25, 20178 yr Author Nowhere on the internet, including in this forum is there an example of a script showing the way to use Get (LayoutName) , with example that I can find. If you know of a more simple way to accomplish my goal, please share it and be specific. Get (LayoutName) isn't a mandatory. Edited March 25, 20178 yr by AbsoluteVoice4u
March 25, 20178 yr 23 hours ago, AbsoluteVoice4u said: yes, all based on the same table occurrence. If they are based on the same TO, then moving from one to another does not change the current record. So this entire part: 23 hours ago, AbsoluteVoice4u said: Copy current ACCTNUMBER If current layout is MAIN then go to BACKUP layout and show the same ACCTNUMBER record. else if current layout is BACKUP then go to MAIN layout and show the same ACCTNUMBER record. can be reduced to just: 23 hours ago, AbsoluteVoice4u said: If current layout is MAIN then go to BACKUP layout else if current layout is BACKUP then go to MAIN layout which is rather trivial to translate to a script: If [ Get ( LayoutName ) ="MAIN" ] Go to Layout [ “BACKUP” ] Else If [ Get ( LayoutName ) ="BACKUP" ] Go to Layout [ “MAIN” ] End If The only problem with this approach is that if you change the name of a layout, you also have to change the string in the corresponding If/ElseIf step. There are ways around that, but they require more work - and with a just little more work you can have a dedicated button on each layout, as I suggested earlier - and as I will suggest again now: 23 hours ago, AbsoluteVoice4u said: however there are 18 layouts in this solution I am not sure what this has to do with anything. The original post discusses two layouts only. You can have as many other layouts as you like, and the two layouts in question don't need to be next to each other. Just place a button on the MAIN layout to go to the BACKUP layout (by name), and a similar button on the BACKUP layout to go to the MAIN layout and be done.
March 26, 20178 yr Author Thank you all for your help. And thank you for the "trivial" script translation....that's exactly what I needed!!!!
Create an account or sign in to comment