8/28/2025 5:29:44 AM
|
|
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!
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.
|
|
|
|
URL Web Link for Address
Posted: 05 Mar 09 12:42 PM
|
On the main Account screen SalesLogix created a URL Link so when you click on the address 1 field it opens up mapquest and plots that specific location.
I want to do the same thing but have it open a Realestate page Zillow.com and show plot that address.
Doesn anyone know how SalesLogix does this plotting? |
|
|
|
Re: URL Web Link for Address
Posted: 05 Mar 09 7:32 PM
|
When the button is clicked, the CallMapQuest function in the SLX Address Common script is called - just have a look at the code there and you will see how it was done.
Phil |
|
|
| |
| |
|
Re: URL Web Link for Address
Posted: 06 Mar 09 11:59 AM
|
Thanks, but how do I get Zillow to use the address for whatever Contact I'm on? How is the address passed from SalesLogix to Zillow? I don't want to have a static address but rather dynamic one. Am I making sense?
|
|
|
|
Re: URL Web Link for Address
Posted: 06 Mar 09 12:04 PM
|
Originally posted by Tom
Thanks, but how do I get Zillow to use the address for whatever Contact I'm on? How is the address passed from SalesLogix to Zillow? I don't want to have a static address but rather dynamic one. Am I making sense? |
|
That is your job . You write the code that gets the contact address. Then you construct a string that forms the URL (re-read my last reply). Then you launch it in the browser. Does that make sense? |
|
|
|
Re: URL Web Link for Address
Posted: 06 Mar 09 12:30 PM
|
Do you mean write a code like SalesLogix did below? I'm not a programmer so I basically copied theirs and am trying to modify the url piece to accept it for Zillow. I got it to launch the website but it won't dynamically place the Contact address in and plot the location.
Sub CallZillow(ContactID, Description) Const adrAddress = 1 Const adrCity = 2 Const adrState = 3 Const adrPostalCode = 4 Const adrCountry = 5 Const adrMax = 5
Dim strFields, strWhere Dim strAddress() Dim strNameValue(5) Dim strURL Dim i
If ErrorCheck (Application.Translator.Localize("Error accessing address caption:")) > 0 Then Exit Sub
strNameValue(adrAddress) = "streetaddress=" 'DNL strNameValue(adrCity) = "city=" 'DNL strNameValue(adrState) = "state=" 'DNL strNameValue(adrPostalCode) = "zip=" 'DNL strNameValue(adrCountry) = "country=" 'DNL
strURL = "http://www.zillow.com/homes/map/2324-University-Ave-West-Saint-Paul-MN-55114_rb/
strFields = "A1.ADDRESS1, A1.CITY, A1.STATE, A1.POSTALCODE, A1.COUNTRY" 'DNL strWhere = "A1.ENTITYID = '" & ContactID & "' AND DESCRIPTION " 'DNL
If Description = "" Then strWhere = strWhere & "IS NULL" 'DNL Else strWhere = strWhere & " = '" & Description & "'" 'DNL End If
If GetFields(strFields, "ADDRESS A1", strWhere, strAddress) Then 'DNL For i = 1 To adrMax strURL = strURL & "&" & strNameValue(i) & strAddress(i) Next Application.BasicFunctions.WebOpen(strURL) ErrorCheck Application.Translator.Localize("Error opening web browser:") End If End Sub
|
|
|
|
Re: URL Web Link for Address
Posted: 06 Mar 09 12:49 PM
|
Add this code - this isn't tested or anything, so might be errors, also it doesn't do any error checking to see if the address fields are blank:
Sub CallZillow(ByVal ContactID) Dim rs Dim url
Set rs = Application.GetNewConnection.Execute("SELECT ADDRESS1, CITY, STATE, POSTALCODE FROM ADDRESS WHERE ENTITYID = '" & ContactID & "' AND ISPRIMARY = 'T'") If rs.RecordCount > 0 Then url = "http://www.zillow.com/homes/map/" url = url & rs.Fields("ADDRESS1").Value & "-" url = url & rs.Fields("CITY").Value & "-" url = url & rs.Fields("STATE").Value & "-" url = url & rs.Fields("POSTALCODE").Value url = url & "_rb/" Application.BasicFunctions.WebOpen url Else MsgBox "Could not get the primary address for the contact." End If
rs.Close Set rs = Nothing End Sub
Then to use it you would just pass the current ContactID to CallZillow. Does that make sense? |
|
|
|
Re: URL Web Link for Address
Posted: 06 Mar 09 1:50 PM
|
It was throwing up a error based on your first line "Sub CallZillow(ByVal ContactID)" S/B Sub CallZillow(ContactID, Description)
I was able to fix it and now it works!
I really appreciate the assistance, I know you're not in the biz of giving away free stuff but because I'm not a programmer I would never had gotten this without your help. I think this might be a good one keep in case any other realestate customers might want to use this too.
Thanks again as always! |
|
|
|
Re: URL Web Link for Address
Posted: 06 Mar 09 6:47 PM
|
Glad that you made it work - Ryan has really helped you out with this one!
As 'Description' does not appear in the code for the subroutine, it should not be necessary to include it as one of the arguments. If you post the final code that you have, I will check it for you if you would like.
Phil |
|
|
|
Re: URL Web Link for Address
Posted: 07 Mar 09 12:37 AM
|
If you replace the following function in the “System:SLX Address Common” VBScript plugin it should give you a better map button … at least in my opinion.
Sub CallMapQuest(ContactID, Description) Const adrAddress = 1 Const adrCity = 2 Const adrState = 3 Const adrPostalCode = 4 Const adrCountry = 5 Const adrMax = 5
Dim strFields, strWhere Dim strAddress() Dim strNameValue(5) Dim strTmpURL Dim strURL Dim i
If ErrorCheck (Application.Translator.Localize("Error accessing address caption:")) > 0 Then Exit Sub
strNameValue(adrAddress) = "streetaddress=" 'DNL strNameValue(adrCity) = "city=" 'DNL strNameValue(adrState) = "state=" 'DNL strNameValue(adrPostalCode) = "zip=" 'DNL strNameValue(adrCountry) = "country=" 'DNL
'strURL = "http://www.mapquest.com/cgi-bin/ia_free?height=300@width=500" 'DNL
'strFields = "A1.ADDRESS1, A1.CITY, A1.STATE, A1.POSTALCODE, A1.COUNTRY" 'DNL strFields = "A1.ADDRESS1, A1.ADDRESS2, A1.ADDRESS3, A1.CITY, A1.STATE" 'DNL strWhere = "A1.ENTITYID = '" & ContactID & "' AND DESCRIPTION " 'DNL
If Description = "" Then strWhere = strWhere & "IS NULL" 'DNL Else strWhere = strWhere & " = '" & Description & "'" 'DNL End If
If GetFields(strFields, "ADDRESS A1", strWhere, strAddress) Then 'DNL For i = 1 To adrMax If Trim(strAddress(i)) <> "" Then If strTmpURL = "" Then strTmpURL = Replace(strAddress(i), " ", "+") Else strTmpURL = strTmpURL & "+" & Replace(strAddress(i), " ", "+") End If End If Next strURL = "http://maps.google.com.au/?ie=UTF8&hl=en&q=" 'DNL strURL = strURL & strTmpURL & "&f=q&om=1&iwloc=addr&z=17" Application.BasicFunctions.WebOpen(strURL) ErrorCheck Application.Translator.Localize("Error opening web browser:") End If End Sub
|
|
|
|
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!
|
|
|
|
|
|
|
|