This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Mar 4, 2012, 8:24 AM
11 Posts

Set value using QuryString

  • Category: Other
  • Platform: Windows
  • Release: 8.5.2
  • Role: Developer
  • Tags:
  • Replies: 5
Scenario: There is a form named frmRequest. On this form there are multiple fields. Some are Computed and some are Editable. 
There is an XPages is being created using this Form. 
 
XPages shows some values that are computed on the form. Example below: 
 
1. fldEmployeeLoginID: @UserName 
2. fldDepartment: Lookup department name from another view based on the value in fldEmployeeLoginID as the key. 
 
When any XPageis opened to create a new Request document,  the value of these two field are being shown.
 
 
All it is working fine. 
 
Problem/ Requirement: Now the requirement is not to use @UserName as the default value in fldEmployeeLoginName. Instead a value will be passed in the URL when the XPages is opened. Example: http://server/application.nsf/xpRequest.xsp?EmployeeLoginID=emp3 
 
As shown in the example above, the employee login id will be taken from the querystring and will not be computed using @UserName.  
 
Now the challenge is how to show the two values - fldEmployeeLoginID and fldDepartment using the value passed on the URL. 
 
Please suggest. 
 
Thanks, 
Atin 
Mar 4, 2012, 10:50 AM
56 Posts
Re: Set value using QuryString
Hi,
 
I have written an article in my Blog about this, it is written in german, but following the link in the article you can copy the code for a server-side Javascript library and in my article there is the code for an additional method, named getURLParam.
 
Look here: http://mnicklisch.wordpress.com/tag/cgivariables/
 
Using this library, you can easily draw values from the query string. You can set this value as the default parameter of the field in the XPage, but you have to remove the default value from the form itself.
 
Hope this helps.
Mar 4, 2012, 3:23 PM
56 Posts
Re: Set value using QuryString
@David: Is this a new functionality with 8.5.3?
Mar 5, 2012, 7:45 PM
129 Posts
Re: Set value using QuryString
If I remember correctly, param.get('paramName') / param.paramName has been available since 8.5.0.

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal