Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, June 28, 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!
 Web Forums - SalesLogix Web Client (Pre-7.2)
Forum to discuss using & developing the legacy SalesLogix Web Client (For versions 7.0 and earlier). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Client (Pre-7.2) | New ThreadView:  Search:  
 Author  Thread: Problem passing parameter
Allen
Posts: 13
 
Problem passing parameterYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Nov 06 2:22 PM
fiogf49gjkf0d
Here's the problem. I have an alias, that is a hyperlink, that, when clicked, redirects to a page. When it redirects to the page, it passes a parameter along with it. I have a submit button on that page and I want the action to be able to grab the value passed in by the hyperlink.

I have tested the insert and update code separately, without the other and without the id = <#af name=id>, and it all works fine. So, I know that the problem is coming from the id = <#af name=id>. Is it that I am not making the call to the parameter correctly? I haven't worked with CRM's before don't know if I am doing this correctly.

Here is the code for the action on the template that is displayed when the hyperlink is clicked:

Sub Main

LogixClearError

'declare some variables
Dim iuHandle As Long
Dim id As String = Nothing

'this will get the Hs_Acct_GMProfilesId, which is being passed in as a parameter
id = <#af name=id>

'check to see if we will update or add a record
If id <> Nothing Then
'we will be updating a record
iuHandle = CreateRecord("UPDATE HS_ACCT_GMPROFILES")
RecordAddCondition iuHandle, "gmhsaccgmid", "=", "CUS1002185"
RecordAdd iuHandle, "gmreference", "Employment Type"
Else
'we will be adding a new record
iuHandle = CreateRecord("INSERT HS_ACCT_GMPROFILES")
RecordAdd iuHandle, "gmaccountid", "A6UJ9A000000"
RecordAdd iuHandle, "gmcreateuser", "Admin"
RecordAdd iuHandle, "gmmodifyuser", "Admin"
RecordAdd iuHandle, "gmcontactid", "ContactId"
RecordAdd iuHandle, "gmprofilename2", "ProfileName"
RecordAdd iuHandle, "gmreference", id
End If

PostRecord(iuHandle)

'for now, we are going to redirect to a blank page
DoTemplate("blank")

End Sub
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Problem passing parameterYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Nov 06 2:47 PM
fiogf49gjkf0d
An Alternative is to have that Parameter assigned into a Hidden variable on the Page, which would then be posted to the Action.
[Reply][Quote]
Allen
Posts: 13
 
Re: Problem passing parameterYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Nov 06 3:16 PM
fiogf49gjkf0d
If the parameter is coming from the hyperlink, how can I assign that to a hidden variable?
[Reply][Quote]
Jeff Ballard
Posts: 326
 
Re: Problem passing parameterYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Nov 06 3:17 PM
fiogf49gjkf0d
Allen,

This line in your web action:

id = "<#af name=id>"

won't work. You need to put the value of "id" on a hidden input box on the receiving template (where your submit button is) like so:
<input type="hidden" name="myhiddenid" value="<#AF name=id>">

Then, in your web action, you can get the value like so:

Dim id as String

id=PostedGetValue("myhiddenid")

That should do it.

Jeff
[Reply][Quote]
Allen
Posts: 13
 
Re: Problem passing parameterYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Nov 06 3:38 PM
fiogf49gjkf0d
Oh, I see. Thanks.
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Problem passing parameterYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Nov 06 3:39 PM
fiogf49gjkf0d
Depending on what the redirection page is (if its an SLX Template) you might be able to do something as follows on the client side:

<input type="hidden" name="myhiddenid" value="">

If that is not possible for any reasons, you may parse it out of the URI using javascript/VBScript


<input type="hidden" name="myhiddenid" value="">

vbscript
Dim id
id = windows.location.href
id = right(id, 12) 'Assuming that the last 12 chars are the ID on the URL.
document.all.myhiddenid.value = id


Note: I have made my examples to complement the action code used by Jeff
[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): 6/28/2024 4:57:10 PM