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: Adding a condition(where clause) to ALL queries
David Joseph
Posts: 13
 
Adding a condition(where clause) to ALL queries Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Feb 07 7:09 PM
fiogf49gjkf0d
Hello,

I would like to add a where clause to ALL queries performed on
the contacts table. Can this be done..

The account ownership is everyone. however the sales rep should
be able to see/query only the contacts he/she entered.. is this
possible.. I would like to add a custom field called
'userid' on the contact table and restrict the users to only
viewing these contacts
[Reply][Quote]
Timmus Agersea
Posts: 328
 
Re: Adding a condition(where clause) to ALL queries Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Feb 07 11:21 PM
fiogf49gjkf0d
You do not need to add a column as you can use the createuser field. However, no, you can not impose this restriction via scripting. For example, consider the ability for users to add groups - you can not impose a condition that adds your restriction.

Depending on the version that you are running you can add security extensions that do what you need. This, however, seems like overkill. Why dont you just change your security model so that accounts are not owned by everyone? If all you are filtering on is a single column, why not use the stock product security that also filters by a single column (seccodeid)? When the sales rep adds a record make them the owner of the record. This requires zero customization (well maybe hardcoding the seccodeid to be the current user vs using useroptions requires a single line of code). If you have found short comings with this option please elaborate as I suspect we can get you what you need without a bunch of code.

Timmus
[Reply][Quote]
David Joseph
Posts: 13
 
Re: Adding a condition(where clause) to ALL queries Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Feb 07 2:17 PM
fiogf49gjkf0d
Hello Timmus,

Thank you for your response. I like the option of updating the SeccodeID for each record.. This however will make the Account SeccodeID different from the contact and Opportunity SeccodeId. is this OK (so, the account seccodeId will be Everyone/Team, the contact and the Opportunity SeccodeID will be the individual users). Will this cause any issues? Please advice.

also, we are panning to upgrade our current 6.1 version to 7.0 and you had mentioned the use of security extensions. can you guide me to some documentation on this and how this could be done?



[Reply][Quote]
Timmus Agersea
Posts: 328
 
Re: Adding a condition(where clause) to ALL queries Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Feb 07 4:41 PM
fiogf49gjkf0d
David,

This is doable especially since you are leaving the Account.SecCodeID alone. The system is hard coded to cascade the Account.SecCodeID to its children Contacts and Opportunities. But as mentioned this will not matter since you are leaving Account.SecCodeID alone. For example, you can not use the Territory Realigment tool as any changes to the Account will be applied to its child records.

Note that there are ways around this even if you do intend on changing Account.SecCodeIDs in the future. It just requires a bit of hacking (and its not supported).

For now, I would just modify the Add New Account Contact form to map the Contact.SecCodeID to the current user. In version 6.2.4 the line number is 244: I have included the signature of the member as well, just in case your has been customized:

Sub InsertNewContact(strSeccodeID, strPrimaryAddress, strShippingAddress)
Dim strSQL
Dim objRS

Set objRS = objSLXDB.GetNewRecordSet
strSQL = "Select * From CONTACT Where 1=2" 'DNL
objRS.Open strSQL, objSLXDB.Connection
With objRS
.AddNew
.Fields("CONTACTID").Value = CheckForNull(mLastConID) 'DNL
.Fields("ACCOUNTID").Value = CheckForNull(mLastAccID) 'DNL
.Fields("ACCOUNT").value = CheckForNull(txtAccount.Text) 'DNL
'.Fields("SECCODEID").Value = strSeccodeID 'DNL
.Fields("SECCODEID").Value = Application.Users.Item(Application.BasicFunctions.CurrentUserID).DefaultSecCodeID 'DNL


I commented out the original line which uses strSeccodeID and instead used the current user's defaultseccodeid.

I have not tested this but it should get you started at least.

Timmus
[Reply][Quote]
Timmus Agersea
Posts: 328
 
Re: Adding a condition(where clause) to ALL queries Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Feb 07 4:42 PM
fiogf49gjkf0d
Unfortunatley, I have not used the security extensions and I do not have any documentation to share.

Timmus
[Reply][Quote]
David Joseph
Posts: 13
 
Re: Adding a condition(where clause) to ALL queries Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Feb 07 4:51 PM
fiogf49gjkf0d
Thank you for your response. I will try this option out
[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 4:43:30 AM