Am working on a XPages App that need to fill in 15 fields based on Key.
In xpages i would use
Key = document1.getItemValue(“AccessCode”);
var result = @DbLookup(@DbName, “viewname”, key, 1); (typeof result == “string”) ? “No result” : result
But how do i get the KEY from URL String
Like this String http://thissite.server.com/ar.nsf/Sk?OpenForm&Settings=1234RT
to get the Value of the KEY by using @Middle(Query_String_decoded;”&Settings=”;”&”) would return “1234RT”
there must be a simple way to get the Key from URL STRING in Xpages ?
is this the only solution ? http://www-10.lotus.com/ldd/ddwiki.nsf/page.xsp?documentId=E8B7585FA5C75392852574E8007A45FC&action=openDocument
That’s a good question. I checked the cheatsheet that I have over at xpagescheatsheet.com and see that I have listed:
param.get(“parameter”)
listed. Quite honestly I don’t remember using that. I do see that paramValues is a global object so that might work. but then it would probably be paramValues.get(“parameter”)
However, recently I have been doing this and I’ve been using:
context.getUrlParameter(“location”)
That’s been working fine. So I suggest try either approach.
HI David , Thanks i did not go and look at the cheatsheet but i will next time. Am going to try that paramValues.get(“parameter”)
Let me know what you find out. I’m thinking I messed up the cheatsheet a bit on that one. 😦
I do know that context.getUrlParameter is working in my current application.
Getur notað fall í context (SSJ):
var key = context.getUrlParameter(“Settings”);
Var ég að skilja þig rétt?
Sæll Arnar – já ég var viss um að það væri “auðvelt” leið til að fá þetta gildi , Takk
Palmi, the global SSJS variable that David mentioned (param) supports “extended syntax”, just like the scope variables do. In other words, if the URL is:
/index.xsp?settings=1234RT
…either of the following would work:
param.get(“settings”)
param.settings
The formal syntax is preferred, but either will return the same result.
Thanks Tim ,good to know. thanks for your input