Screen Customisation: Difference between revisions
From Sage CRM Knowledge Base
No edit summary |
No edit summary |
||
| Line 18: | Line 18: | ||
---- | ---- | ||
Useful menthod to parse the querystring from the client | |||
function getQuerystring(key, default_) | |||
{ | Ref: http://www.bloggingdeveloper.com/post/JavaScript-QueryString-ParseGet-QueryString-with-Client-Side-JavaScript.aspx | ||
function getQuerystring(key, default_) | |||
{ | |||
if (default_==null) default_=""; | |||
key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); | |||
var regex = new RegExp("[\\?&]"+key+"=([^&#]*)"); | |||
var qs = regex.exec(window.location.href); | |||
if(qs == null) | |||
} | return default_; | ||
else | |||
return qs[1]; | |||
} | |||
Revision as of 08:08, 12 June 2013
To add in script code from a page set the link as follows
<script src="../custompages/pathtofile/commlist.js" type="text/javascript" language="JavaScript"></script>
To enumerate block entries (Ref: https://community.sagecrm.com/partner_community/b/hints_tips_and_tricks/archive/2007/11/28/setting-screen-properties-within-a-multiblock-asp-page-using-the-com-api.aspx)
//Set EntryBlock properties for an EntryGroup Block using an Enumerator
var myE = new Enumerator(myBlock);
while (!myE.atEnd())
{
myEntryBlock = myE.item();
myEntryBlock.ReadOnly = false;
myEntryBlock.Required = false;
myE.moveNext();
}
Useful menthod to parse the querystring from the client
function getQuerystring(key, default_)
{
if (default_==null) default_="";
key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
var qs = regex.exec(window.location.href);
if(qs == null)
return default_;
else
return qs[1];
}