Tag Cloud

CRM 2011 (161) CRM 4.0 (144) C# (116) JScript (109) Plugin (92) Registry (90) Techpedia (77) PyS60 (68) WScript (43) Plugin Message (31) Exploit (27) ShellCode (26) FAQ (22) JavaScript (21) Killer Codes (21) Hax (18) VB 6.0 (17) Commands (16) VBScript (16) Quotes (15) Turbo C++ (13) WMI (13) Security (11) 1337 (10) Tutorials (10) Asp.Net (9) Safe Boot (9) Python (8) Interview Questions (6) video (6) Ajax (5) VC++ (5) WebService (5) Workflow (5) Bat (4) Dorks (4) Sql Server (4) Aptitude (3) Picklist (3) Tweak (3) WCF (3) regex (3) Config (2) LINQ (2) PHP (2) Shell (2) Silverlight (2) TSql (2) flowchart (2) serialize (2) ASHX (1) CRM 4.0 Videos (1) Debug (1) FetchXml (1) GAC (1) General (1) Generics (1) HttpWebRequest (1) InputParameters (1) Lookup (1) Offline Plug-ins (1) OutputParameters (1) Plug-in Constructor (1) Protocol (1) RIA (1) Sharepoint (1) Walkthrough (1) Web.config (1) design patterns (1) generic (1) iframe (1) secure config (1) unsecure config (1) url (1)

Pages

Sunday, February 24, 2013

Get Record Guid by name

//Change the fetch query as per use
 
/* Jscript */


document.getBuGuid = function(product_nm){
//var _d_fxml = "";
var _d_fxml = "<fetch mapping='logical'><entity name='new_businessinterest'><no-attrs/><filter type='and'><condition attribute='new_name' operator='eq' value='"+product_nm+"'/></filter></entity></fetch>";
//var _e_fxml = CrmEncodeDecode.CrmHtmlEncode(_d_fxml);
var soap_header= document.genSoap(_d_fxml);
var ajResponse = document.ajaxSoap(soap_header);

var oXmlDoc = new ActiveXObject("Microsoft.XMLDOM"); //Create an XML document that you can parse.o
oXmlDoc.async = false;

oXmlDoc.loadXML(ajResponse); //Load the XML document that has the UnEncoded results.
var results = oXmlDoc.getElementsByTagName('resultset');
var bu_guid = oXmlDoc.selectNodes("//new_businessinterestid")[0].text;
var re1='.*?'; // Non-greedy match on filler
var re2='([A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12})'; // SQL GUID 1
var p = new RegExp(re1+re2,["i"]);
var m = p.exec(bu_guid);
if (m != null)
{
var guid1=m[1];
return(guid1.replace(/ }
};