- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
bSave and This record has been modified by another user
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-24-2011 04:27 PM
Hello,
I am trying to block users form inadvertantly copy and posting CRLFs into text fields in Maintain Customers.
I am using the below code to do this. The problem I am hiavng is if bSave fires and cancels the save, the next attempt by that user to save (after deleting the bad chars) results in "This record has been modified by another user. Your changes will not be saved" The user must then exit the record completely, go back in, and then enter the 'clean' data and save.
Am I missing something here?
Sub Form_Save(bSave)
if instr(Form.Controls("txtAddressLine", 1) & Form.Controls("txtAddressLine", 2) & Form.Controls("txtAddressLine", 3) & Form.Controls("txtAddressLine", 4) & Form.Controls("txtAddressLine", 5), chr(13)) > 0 or instr(Form.Controls("txtAddressLine", 1) & Form.Controls("txtAddressLine", 2) & Form.Controls("txtAddressLine", 3) & Form.Controls("txtAddressLine", 4) & Form.Controls("txtAddressLine", 5), chr(10)) > 0 then
msgbox "Address cannot contain a Carriage Return or Linefeed. Please remove it before saving.", 0, "MAS 500"
msgbox "Save Canceled", 0, "MAS 500"
bsave = false
end if
if instr(Form.Controls("txtContName") & Form.Controls("txtContTitle") & Form.Controls("txtPhone") & Form.Controls("txtPhone2") & Form.Controls("txtFax") & Form.Controls("txtFaxExt") & Form.Controls("txtEmail"), chr(13)) > 0 or instr(Form.Controls("txtContName") & Form.Controls("txtContTitle") & Form.Controls("txtPhone") & Form.Controls("txtPhone2") & Form.Controls("txtFax") & Form.Controls("txtFaxExt") & Form.Controls("txtEmail"), chr(10)) > 0 then
msgbox "Contact cannot contain a Carriage Return or Linefeed. Please remove it before saving.", 0, "MAS 500"
msgbox "Save Canceled", 0, "MAS 500"
bsave = false
end if
End Sub
Re: bSave and This record has been modified by another user
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-24-2011 04:42 PM
It appears your Customizer code is conflicting with the standard processes of the form (which by the way will always win). You may have to rethink how you want to accomplish what you want do in order to get around the issue. This seems to be one of those cases where Customizer and the standard code of a form aren't playing well together due to the limitations of what Customizer was orignally designed for.. Maybe someone else has run into this issue and found another way to check the values you want for carriage returns using vbScript.
Another option is to modify the task itself using the SDK to easily accomplish what it is you need done. If you do not have the SDK, contact your reseller to see if they can do this for you.
e2b teknologies, inc
www.e2btek.com
Re: bSave and This record has been modified by another user
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-02-2011 01:09 PM
Unfortunately, I have run into this with bSave also, no matter what the code is doing. I've run SQL traces to try to pinpoint the issue, and it appears that although this code is supposed to run before anything is saved, it's not. MAS is saving something behind the scenes, and probably not rolling it back properly, so when you try to save again, it thinks the record is still in use.
I've heard that Sage is working on improvements for Customizer, I'm hoping this is one of them.
Hollie
Hollie


