2/22/2025 8:00:15 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 using & developing the legacy SalesLogix Web Client (For versions 7.0 and earlier). View the code of conduct for posting guidelines.
|
|
|
|
Problem passing parameter
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 |
|
|
|
Re: Problem passing parameter
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. |
|
|
|
Re: Problem passing parameter
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? |
|
|
|
Re: Problem passing parameter
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
|
|
|
| |
|
Re: Problem passing parameter
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
|
|
|
|
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!
|
|
|
|
|
|
|
|