Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, August 25, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Required Fields (Adding New Account/Countacts)
Long
Posts: 8
 
Required Fields (Adding New Account/Countacts)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Sep 08 6:42 AM
What''s the best way to do it?

I was trying to use this but is not very practical

'Seperate method to enable the 'Save' buttons so we don't have to go through the initialization of all controls
Sub EnableDisableButtons
cmdOK.Enabled = (gIntOption = 2 And txtAccount.Text <> "") Or (gIntOption <> 2 And namContact.Text <> "" And txtAccount.Text <> "")
cmdSaveNew.Enabled = (cmdOK.Enabled And gIntOption <> 2)
cmdSaveClear.Enabled = cmdOK.Enabled
'Enable the Match button if any data exists for Contact/Account/Email/Phone/Web Address
cmdMatchRecords.Enabled = cmdOK.Enabled Or (txtPhone.Text <> "" Or txtEmail.Text <> "" Or txtWeb.Text <> "")
End Sub

since, if i wanted just to add a new contact to an existing account, the OK button will never appear since the required field is grayed out in the account info section.

Any Ideas how i should implement Required field for creating new accounts/contacts? Thanks in advance
[Reply][Quote]
Matt Dockins
Posts: 159
 
Re: Required Fields (Adding New Account/Countacts)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Sep 08 9:13 AM
Use the form call AXFormCloseQuery, setup a validation method like so

Function ValidateData() 'returns false if required fields not specified
Dim strMsg
strMsg = ""
if (txtAccount.text = "") then
strMsg = strMsg & "Account" & vbCrLf
end if
if (txtPhone.text = "") then
strMsg = strMsg & "Phone" & vbCrLf
end if
'Continue for all required fields you wish

If (strMsg <> "") then
strMsg = "The following fields are required before the form can be closed: " & vbCrLf & strMsg
msgbox strMsg,,"Validation"
ValidateDate = false
else
ValidateData = true
end if
end function
[Reply][Quote]
Matt Dockins
Posts: 159
 
Re: Required Fields (Adding New Account/Countacts)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Sep 08 9:16 AM
Then setup AXFormCloseQuery (the form's On Close Query event) as follows - AXFormCloseQuery prevents the form from closing if false is returned from it.

if (Sender.ModalResult <> mrCancel and ValidateData()) then

'Do whatever it is you do to save the data
AXFormCloseQuery = true
elseif (Sender.ModalResult = mrCancel) then
AXFormCloseQuery = true
else
AXFormCloseQuery = false
end if

[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 8/25/2025 7:23:52 AM