Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, November 27, 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: Check for duplicates when entering information in a UserField
SLX_Novice
Posts: 246
 
Check for duplicates when entering information in a UserFieldYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Mar 07 11:32 AM
fiogf49gjkf0d
Hi all.

I have SalesLogix v6.2.6 and we have two userfields (CustDiv and CustNumber) they are in the Accounts table.

Currently, the end user has the option of adding the CustDiv and CustNumber if they know it, but we are running into problems because they are incorrectly entering CustDiv and CustNumber and we have duplicates and sometimes the CustDiv and CustNumber is in the database 3 or 4 times for the wrong customer name.

So I would like to add an event that when the user enters the CustDiv and CustNumber it checks in the database and if those two exact fields are in the system it should not let them to save it and it should give them a pop up message.

I've gone to the Architect and I went to the plugin and I added my subroutine to the AXFormChange procedure, but I need to get an idea on how to start.

Any ideas? Thank you in advance.
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: Check for duplicates when entering information in a UserFieldYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Mar 07 1:16 PM
fiogf49gjkf0d
The problem is two-fold. On one hand you need to validate what's entered but on the other you may want to automatically fill in the next available number.

AXFormChange is where you would look for the last CustNumber then increment it, most likely involving a SQL statement like "select top 1 custnumber order by custnumber desc" (I get the order wrong off the top of my head but you get the idea).

AXFormValidate (after your form's OnValidate event is configured) is where you'd place the validation code. Your routine is going to check to see if a record is found that matches CustNumber and/or CustDiv. If found, set AXFormValidate to false and it'll keep the form open as well as stop SLX from saving the record. Only when AXFormValidate is true will it operate normally and because of this you have to be careful or else you could introduce a scenario where the form will never close.

I'd suggest looking at the Account Details screen or any other stock code that implements AXFormValidate (doing a search through the entire database wouldn't hurt). That'll give you the basic structure to follow. Once you've done validation for a few times and understand how to make things start and stop, streamlining the process becomes much easier. I add validation to every form whether I immediately need it or not because 9/10 times I'll eventually need it and the code I reuse is simple to adjust.
[Reply][Quote]
SLX_Novice
Posts: 246
 
Re: Check for duplicates when entering information in a UserFieldYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Mar 07 1:30 PM
fiogf49gjkf0d
I found IsDuplicateRecord(objRS, strRecord, strField) in the SLX_Common script I guess I can use that, can someone tell me what goes into each of the parameters?

objRs
strRecord
strField
[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/27/2024 7:03:35 AM