I did this to send emails from my database...works great! I'm not sure if there is a more efficient way...best I came up with.
That can work, but there's an alternative you can play with to see if it works as well without needing so much extra programming to implement.
Create a data entry layout where auto-save is disabled in Layout Setup. The place an invisible, empty web viewer behind all the other layout objects sized to cover the entire body of the layout. This object will intercept clicks of the layout background so that they don't trigger the save dialog. If you want, you can add buttons that use commit record to save it and revert record to cancel it.
Interesting...I will look into this. My global temps are on two separate layouts ( can send emails from the inventory and contacts layout ); which means that if an email is created in the inventory and is not sent, the user can go into the contacts layout and then send the email...this can be bad if the email/attachment in the email needed to be linked to the inventory item and not the contact where the email was sent...so the webviewer alternative may help with this...??? What happens when user switches layouts in my situation if i use the webviewer alternative?
I'm assuming the save dialog will be triggered...
Also, my email creation is on a tab in both layouts...so the entire layout would have to be set as auto-saved disabled? that wouldn't be desired.
I rarely disable auto save with my systems, but I think a layout change will always commit the record. I suggest you test it out. What I am not sure of is whether you'd get the save if both layouts refer to the same table occurrence (and thus have the same current record) or not.
Auto-save is a layout setting, so disabling it disables it for the entire layout. Note that I said, you'd create a layout expressly for the purpose of entering data into a new record...
It worked fine in my case since I had a popup layout just for data entry.
Now when I try to close the window, a save dialog appears but is there any way to disable it?
You can put a save button on the pop up window that runs a script that commits the record with the no dialog option before it does anything else--such as closing the window.
I'm sorry Phil,
I don't think I was clear, but the dialog opens when I try to close the window by clicking on the OS's close window red button (os X). I do currently have a scripted button to commit and close the window and when I click that, dialog does not show up.
Yep. I use a custom menu on my pop up windows to run my own script when the user closes the window. I do that because I use a paused, infinitely looped script with user abort disabled to keep the dialog "modal" but it could also be used to commit the record silently when the window is closed. Without the custom menu, this scripted trick simply disables the close control in the window.
Phil, I built off of your idea...
I didn't want to disable auto-save nor create a separate layout, so I combined my idea with yours...
I put an "invisible" portal on the email tab and added onObjectEnter script...
if the email temp fields are empty then temp fields that store the type ( item/contact ) and id ( item id/contact id ) will be filled accordingly. Then when the message is sent, the user will have the option of choosing whether the email should be sent from the original layout or the current. (basically with the current layout's info or the currently stored info, where the email was originated; user friendly terms will be used though).
I don't mind the extra "temp variable" scripting because i use it for other reasons too...plus i had already did the work.
Thanks! Problem solved...
I placed a web browser at the back of the layout as you suggested. But I found that If there is a button on the layout and the mouse is set to change to hand shape when hovering, after the mouse leave that button, the cursor remains a hand shape until you click a field wil it change back to a normal cursor.