Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 22, 2024 
 
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: Forcing users to update two fields when they open a contact in detail view.
SLX_Novice
Posts: 246
 
Forcing users to update two fields when they open a contact in detail view.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 25 Sep 06 9:28 AM
fiogf49gjkf0d
Hi all.

Is there a way to force users to update two fields when they open a contact in detail view, if those two fields are empty. Both fields will be populated by choosing from a pick list.

So when a user opens a contact in detail view, if those two fields are empty then it will send them a message to update the one or both of the fields that are empty, and it will not let the user leave the contact detail view until they update it.

Any help would be great!

Thank you in advance.
[Reply][Quote]
Swapnil
Posts: 46
 
Re: Forcing users to update two fields when they open a contact in detail view.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Sep 06 12:45 AM
fiogf49gjkf0d
Hi Fabian,
You can create a procedure to find whthere these two fields are empty or not. It's empty then you prompt a message to fill it. At same time you can set modulresult of plugin = mrCancel so that the form cannot save. You call this procedure from 'AXFormValidate' event of plugin.
Hope this will help you.
[Reply][Quote]
SLX_Novice
Posts: 246
 
Re: Forcing users to update two fields when they open a contact in detail view.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Sep 06 8:31 AM
fiogf49gjkf0d
Thanks Swapnil.

I've never done any coding in SalesLogix, but I'll give it a shot in a test database. Any idea where I can find code samples for SLX?
[Reply][Quote]
Carla Tillman
Posts: 290
 
Re: Forcing users to update two fields when they open a contact in detail view.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Sep 06 10:30 AM
fiogf49gjkf0d
Fabian

You can add an OnCreate or OnExit type of function that surveys the fields and {if NULL} then pop a message or complete pop up window. However from a business logic point of view; What if the user doesn't know? What if it is a manager who pulled into the screen for a drill down to history or activities? In these cases, you may get data but it will probably be dirtier data than a NULL value...

Carla
[Reply][Quote]
SLX_Novice
Posts: 246
 
Re: Forcing users to update two fields when they open a contact in detail view.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Sep 06 10:52 AM
fiogf49gjkf0d
Thanks for the reply Carla.

The pick list will have Yes, No, N/A. And we will run a process that will send the manager of each territory all contacts that have N/A and it's up to them to have their people update the picklist. I will try the OnExit type of function in the contact detail view and see how that goes.
[Reply][Quote]
SLX_Novice
Posts: 246
 
Re: Forcing users to update two fields when they open a contact in detail view.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Sep 06 12:46 PM
fiogf49gjkf0d
Dim PriceLevel
PriceLevel = PickList2.Text

if PriceLevel = "" then

MsgBox "Enter a Price Level", 0, "Error"

End if

Where can I add this script so that when a user tries to go to another contact or go to Accounts or Opportunities it will prompt the message. I saw a function: AXFormChange in the account detail view, should I add this code as the last if statement?
[Reply][Quote]
SLX_Novice
Posts: 246
 
Re: Forcing users to update two fields when they open a contact in detail view.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Sep 06 3:20 PM
fiogf49gjkf0d
Swapnil,

what do mean by: At same time you can set modulresult of plugin = mrCancel so that the form cannot save. You call this procedure from 'AXFormValidate' event of plugin.

Do I have to include that in my procedure? Here is what I have (the beginning is part of SalesLogix):

Function AXFormValidate(Sender)

strCRLF = chr(13) & chr(10)

if strAccount <> txtAccount.Text then
if MsgBox ("You have changed the account name from " & chr(34) & strAccount & chr(34) & " to " & chr(34) & txtAccount.Text & chr(34) & strCRLF & strCRLF & _
"Are you sure you want to change the acccount name?", vbYesNo + vbExclamation + vbDefaultButton2, "Warning") = vbNO then
txtAccount.Text = strAccount
end if 'if MsgBox (...) = vbNO
end if 'if strAccount <> txtAccount.Text


Dim PriceLevel
PriceLevel = PickList2.Text

if PriceLevel = "" then
MsgBox "Enter a Price Level", 0, "Error"
AXFormValidate = False
end if


'if you don't set AXFormValidate = True, then the form will abort the close function that called this function
'(This would be similar to SetProperty "Postable", "False" in legacy scripts)
AXFormValidate = True
End Function
[Reply][Quote]
SLX_Novice
Posts: 246
 
Re: Forcing users to update two fields when they open a contact in detail view.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Sep 06 4:06 PM
fiogf49gjkf0d
I want to do the same thing as in contact detail. When you erase the contact name it prompts a message stating: Validation Error: "You must fill in all required information!".

And it won't let you do anything until you put a contact name.
[Reply][Quote]
Swapnil
Posts: 46
 
Re: Forcing users to update two fields when they open a contact in detail view.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Sep 06 11:38 PM
fiogf49gjkf0d
Fabian,
Yes you are right. You have to add your code in AXFormValidate function.If these values are blank or null then you have to set value of function = False.
eg. AXFormvalidate = False
Exit the procedure before end if.
eg.
if PriceLevel = "" then
MsgBox "Enter a Price Level", 0, "Error"
AXFormValidate = False
exit function
end if

Regarding that error "Validation Error: "You must fill in all required information!".
In some control(s) the 'required' property set as true. Just b'coz of this SLX won't allow you to move further.
You have to put some values in that fields. Don't keep it blank.
[Reply][Quote]
SLX_Novice
Posts: 246
 
Re: Forcing users to update two fields when they open a contact in detail view.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Sep 06 8:28 AM
fiogf49gjkf0d
That is not working, it still lets me scroll to the next record even though that field is blank.
[Reply][Quote]
Steve Knowles
Posts: 657
Top 10 forum poster: 657 posts
 
Re: Forcing users to update two fields when they open a contact in detail view.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Sep 06 6:28 AM
fiogf49gjkf0d
Fabian,
Last thing I knew you couldn't prevent a Main View from scrolling to the next record with code. On other screens you can set AXFormvalidate = False or mrCancel etc. to prevent them from closing or saving, but not on the main views.

Steve K.
[Reply][Quote]
RJ Eaton
Posts: 234
 
Re: Forcing users to update two fields when they open a contact in detail view.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Sep 06 1:25 PM
fiogf49gjkf0d
Fabian,

If I understand this correctly.. is the item they are filling a picklist..? if so you can add to the AXFormChange Event the following:

pklPriceLevel.setfocus

and make the picklist a required entry.. this will force them to enter something into the picklist before it will move on. By setting the focus to the control your forcing them into it and forcing the required collection. This will then happen everytime they change an account.

Only downside is that each time the screen changes they will be in that picklist and possiblity of accidental changes.. ut you can force the picklist to match the listings and that usally takes care of accidential changes..

If you need this to happen for only certain accounts just add it into a select of if statement where it checks for the "Type" of account or status etc. before sending focus to the picklist.

Hope this helps if I understood what you needed..

Rich
[Reply][Quote]
Marc Johnson
Posts: 252
 
Re: Forcing users to update two fields when they open a contact in detail view.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 29 Sep 06 8:11 AM
fiogf49gjkf0d
Quote:
Originally posted by Carla Tillman

In these cases, you may get data but it will probably be dirtier data than a NULL value...


I agree with Carla on this one too. Required fields are a tricky business from a development perspective. Sales people are notorious for finding ways around restrictions when they slow them down.

I've always found that 'required' data becomes a PEOPLE problem not a technology one.

Marc
[Reply][Quote]
SLX_Novice
Posts: 246
 
Re: Forcing users to update two fields when they open a contact in detail view.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Oct 06 8:05 AM
fiogf49gjkf0d
Quote:
Originally posted by RJ Eaton

Fabian,

If I understand this correctly.. is the item they are filling a picklist..? if so you can add to the AXFormChange Event the following:

pklPriceLevel.setfocus

and make the picklist a required entry.. this will force them to enter something into the picklist before it will move on. By setting the focus to the control your forcing them into it and forcing the required collection. This will then happen everytime they change an account.

Only downside is that each time the screen changes they will be in that picklist and possiblity of accidental changes.. ut you can force the picklist to match the listings and that usally takes care of accidential changes..

If you need this to happen for only certain accounts just add it into a select of if statement where it checks for the "Type" of account or status etc. before sending focus to the picklist.

Hope this helps if I understood what you needed..

Rich


Rich I tried that and indeed it does focus on the picklist when I go from one account to the next, and I made it a required entry but it still allows me to go to the next record. I did not think this would be so difficult to accomplish!...so I'm going to suggest making a business rule out of the picklist to keep SalesLogix up to date.

Thanks for everyone's help!
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Forcing users to update two fields when they open a contact in detail view.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Mar 08 9:59 AM
AXFormValidate = False

I'm on a non mainview form.......I'm putting up a warning message "Do you REALLY want to close this form?"

Does the above work in the AXFormClose event?

In other words how do I keep the form Open if they choose CANCEL/mrCancel?

THANKS!

[Reply][Quote]
Lee Barker
Posts: 1
 
Validating a picklist on btnOKClickYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jan 16 11:30 AM

Hi,


I thought this might be a suitable place to fit my question in.


I have a picklist which is successfully validated on field exit, i.e. the user cannot exit the blank field if no item chosen.


However they can press the OK button and the plugin closes with no validation.


I have tried the following code which sucessfully raises a message, but the once the message is cleared the plugin form should remain open - but it doesn't. Can you please advise how I can keep the popup open? I thought SetFocus whould do it.


If (Not strStatus = Application.Translator.Localize("Closed - Won")) & CheckForNull(pklReasonWon.Text) Then


        MsgBox Application.Translator.Localize("Please enter a Reason Lost."),, "SalesLogix"


        pklReasonWon.SetFocus


        '--- Keep popup open


    Else


    '--- Process and close


 


Thanks,


Lee

[Reply][Quote]
Lee Harris
Posts: 23
 
Re: Validating a picklist on btnOKClickYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jan 16 6:03 AM

Hi,


Are you running your validation code in the OnClick event of the button?


Try moving your code to the form event OnValidate. Then after your line where you set focus to your picklist add the following line:


AXFormValidate = false


 


That should be enough to stop the form from closing if the user has not selected a value in the picklist.


 

[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 © 2024 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): 11/22/2024 9:38:08 AM