Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, November 26, 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: Contact last name lookup based on AccountID and not Account Name
Jason
Posts: 14
 
Contact last name lookup based on AccountID and not Account NameYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Jun 06 9:37 AM
fiogf49gjkf0d
I found the script that restricts the contact lookup to only contacts list for the account chosen in thaccount field.

PROBLEM: it brings back all contacts based on account name and not account id, so if there are 2 accounts with the same name and they both have 2 contacts the lookup will bring back 4 contacts after choosing the specific account. this becomes a mess when you have 14 accounts with the same name....."Mercy Hospital"

here is the script..........very shot and sweet but I cant figure out what exactly i need to edit to bring back the proper contacts. Any help???


Global Const ScriptName = "META Ticket Contact When PopUp"

sub main
'*********************************************************************************************************
' Description: Limits the Contact lookup to the Account
' Purpose :
' Called By : Account When Change
' Calls :
' Inputs :
' Outputs :
' Written : 12/99 mjm
' Updates :
'*********************************************************************************************************
call slx_Specific

'*********************************************************************************************************
' place your customization code here
'*********************************************************************************************************
end sub

sub slx_Specific()

If UCase ( CurrentViewMode ) = "TRUE" then
Call InsertMode
Else
Call EditMode
End If

If LogixErrors then Checkerror

End Sub


Sub InsertMode

If Trim ( GetPropertyOf ( "leAccount", "Text" )) <> "" then
setpropertyof "leContact", "LookupRestrictAlways", "True"
setpropertyof "leContact", "LookupRestrictField", "CONTACT:ACCOUNT"
setpropertyof "leContact", "LookupRestrictOp", "="
setpropertyof "leContact", "LookupRestrictValue", getpropertyof ( "leAccount", "Text" )
Else
setpropertyof "leContact", "LookupRestrictField", "CONTACT:STATUS"
setpropertyof "leContact", "LookupRestrictOp", "="
setpropertyof "leContact", "LookupRestrictValue", "Active"
setpropertyof "leContact", "LookupRestrictAlways", "True"
End If

End Sub


Sub EditMode

If Trim ( GetPropertyOf ( "leAccount", "LinkID" )) <> "" then
setpropertyof "leContact", "LookupRestrictAlways", "True"
setpropertyof "leContact", "LookupRestrictField", "CONTACT:ACCOUNT"
setpropertyof "leContact", "LookupRestrictOp", "="
setpropertyof "leContact", "LookupRestrictValue", getpropertyof ( "leAccount", "Text" )
Else
setpropertyof "leContact", "LookupRestrictAlways", "True"
setpropertyof "leContact", "LookupRestrictField", "CONTACT:STATUS"
setpropertyof "leContact", "LookupRestrictOp", "="
setpropertyof "leContact", "LookupRestrictValue", "Active"

End If

End sub


Sub CheckError
dim I as Integer

I = Msgbox ( LogixErrorText, 16, ScriptName )

End Sub
[Reply][Quote]
Carlos H. Treviño
Posts: 10
 
Re: Contact last name lookup based on AccountID and not Account NameYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Jun 06 11:43 AM

ventolin hfa

ventolin overdose redirect
fiogf49gjkf0d
Just change the two lines with

setpropertyof "leContact", "LookupRestrictField", "CONTACT:ACCOUNT"

to

setpropertyof "leContact", "LookupRestrictField", "CONTACT:ACCOUNTID"

and the 2 lines shortly after those:

setpropertyof "leContact", "LookupRestrictValue", getpropertyof ( "leAccount", "Text" )

to

setpropertyof "leContact", "LookupRestrictValue", getpropertyof ( "leAccount", "LinkID" )

I can't test it right now, but that should do the trick.
[Reply][Quote]
Jason
Posts: 14
 
Re: Contact last name lookup based on AccountID and not Account NameYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Jun 06 1:14 PM

champix

champix iweinreimerink.nl
fiogf49gjkf0d
Perfect.....thanks.

I was on the right track.....I changed those fields once.......but not all 4 lines.

THANK YOU!
[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/26/2024 3:49:57 AM