Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all 46379 articles
Browse latest View live

addCustomFilter - How to filter with operator 'in' where value is an array of objects

$
0
0

Hi, I'm trying to create a filter for addCustomFilter function where the value is an array of Guids (teamId), and the operator is 'in', but I can't seem to get the xml right.

I'm trying to iterate through the array and add a <value> tag for each guid in the array.

       var userTeams = dataService.GetTeamsIdOfUser(userId[0].id);
        
            var filter = "<filter type='and'><condition attribute='teamid' 
             operator='in'>";
            userTeams.forEach(function (val) {
                filter+= "<value='{" + val + "}'></value>"
            });
            filter += "</filter>";
            Xrm.Page.getControl("mtx_assign2userteam").addCustomFilter(filter,"team");


can anyone show me what I'm doing wrong?

Thanks in advance!


Dynamics 365 Build Tools is disabling my plugin steps

$
0
0

Hi, I'm doing my solution deployment using this Dynamics 365 Build Tools. Upon deploying all the Steps that are included in my solution has been disabled. Why does this happen? Can configure something to stop the disabling of the steps?

KB Article CSS styling between backend and exposed portal front-end when published help

$
0
0

Hi all,

I'm trying to setup some overarching CSS styles for KB articles published onto Portal. I noticed a few strange things as we're also migrating the KB articles from another source complete with all their HTML and HTML tags.

Some of the migrated articles has CSS added inline within the HTML tags themselves (they were added in the CRM via the Customer Service HUB>Knowledge Articles) whilst others reference off a external style sheet. 

As they were going consolidate the styles I was looking to add in the external style sheet classes into the bootstrap css file in Dynamics and just have published articles inherit that style on the Portal front end. 

This seems to work except when inline CSS is added to the HTML of the KB articles via the Customer Service Hub after which the inline CSS takes precedence over the bootstrap portal styling.

My question is:

- Is there a way to override the inline CSS styling within the created KB articles.

- What's the best method of getting a uniformed CSS style across all KB articles published to the portal. Should I be editing the default CSS of the portal?

Kind regards,

Mike

Product integration from Dynamics Sales(CRM) to Dynamics 365 Finance and Operation using CDS

$
0
0

Hi All,

I want to make product integration between dynamics crm products to dynamics 365 finance and operation product using CDS.

There is no template available for sales to fiance&operation for product so is there any way to create custom template for the same.

Any help would be appreciated.

Regards,

Shahbaaz

Dynamics 365 9 OnPremise Invalid character when loading My Apps.

$
0
0

Problem:
After upgrading to Dynamics 365 9.0 Onprem (version 1612 (9.0.4.5) (DB 9.0.4.5) local

when loading the "My Apps" page (Shows model driven apps) we get an error "Crash Report" in all browsers ex. (Chrome, IE 11).

Problem is for all users including including users with the System administrator security role.

Have you experienced this as well?

Invalid character
CrmSymbols.woff (1,5)

Chrome error:

CrashReport:
		FileName:/Webresources/msdyn_/AppManagementControl/css/CrmSymbols.woff
		LineNumber:1
		Function:anonymousror:Invalidorunexpectedtoken
		ErrorReport:<CrmScriptErrorReport>
  <ReportVersion>1.0</ReportVersion>
  <ScriptErrorDetails>
   <Message>Uncaught SyntaxError&#58; Invalid or unexpected token</Message>
   <Line>1</Line>
   <URL>&#47;Webresources&#47;msdyn_&#47;AppManagementControl&#47;css&#47;CrmSymbols.woff</URL>
   <PageURL>&#47;Webresources&#47;msdyn_appmanagementcontrol</PageURL>
   <Function>anonymousror&#58;Invalidorunexpectedtoken</Function>
   <FunctionRaw>SyntaxError&#58; Invalid or unexpected token</FunctionRaw>
   <CallStack>
    <Function>anonymousror&#58;Invalidorunexpectedtoken</Function>
   </CallStack>
  </ScriptErrorDetails>
  <ClientInformation>
   <BrowserUserAgent>Mozilla&#47;5.0 &#40;Windows NT 10.0&#59; Win64&#59; x64&#41; AppleWebKit&#47;537.36 &#40;KHTML, like Gecko&#41; Chrome&#47;74.0.3729.169 Safari&#47;537.36</BrowserUserAgent>
   <BrowserLanguage>undefined</BrowserLanguage>
   <SystemLanguage>undefined</SystemLanguage>
   <UserLanguage>undefined</UserLanguage>
   <ScreenResolution>1920x1200</ScreenResolution>
   <ClientName>Web</ClientName>
   <ClienState>Online</ClienState>
   <ClientTime>2019-06-04T11&#58;52&#58;12</ClientTime>
  </ClientInformation>
</CrmScriptErrorReport>


Internet Explorer 11 Error:

CrashReport:
  FileName:/Webresources/msdyn_/AppManagementControl/css/CrmSymbols.woff
  LineNumber:1
  Function:
  ErrorReport:<CrmScriptErrorReport>
  <ReportVersion>1.0</ReportVersion>
  <ScriptErrorDetails>
   <Message>Invalid character</Message>
   <Line>1</Line>
   <URL>&#47;Webresources&#47;msdyn_&#47;AppManagementControl&#47;css&#47;CrmSymbols.woff</URL>
   <PageURL>&#47;Webresources&#47;msdyn_appmanagementcontrol</PageURL>
   <Function></Function>
   <FunctionRaw></FunctionRaw>
   <CallStack>
   </CallStack>
  </ScriptErrorDetails>
  <ClientInformation>
   <BrowserUserAgent>Mozilla&#47;5.0 &#40;Windows NT 10.0&#59; WOW64&#59; Trident&#47;7.0&#59; .NET4.0C&#59; .NET4.0E&#59; .NET CLR 2.0.50727&#59; .NET CLR 3.0.30729&#59; .NET CLR 3.5.30729&#59; rv&#58;11.0&#41; like Gecko</BrowserUserAgent>
   <BrowserLanguage>en-US</BrowserLanguage>
   <SystemLanguage>hu</SystemLanguage>
   <UserLanguage>sv-SE</UserLanguage>
   <ScreenResolution>1536x960</ScreenResolution>
   <ClientName>Web</Cl

Is it possible to generate OOB report as pdf format on button click of a custom entity

$
0
0

I have written the code as given below but it is not working

//Author: Arunav Dash
//Description: Creating Email and notes with attachment PDF
var base64 = null;

function form_onsave(executionContext) {
debugger;
var formContext = executionContext.getFormContext();
// if (formContext.getAttribute("ccc_senttocustomer") !== null && formContext.getAttribute("ccc_senttocustomer") !== undefined)
// {
// var senttocustomer = formContext.getAttribute("ccc_senttocustomer").getValue();
// if (senttocustomer === true) {
// createAttachment();
// }
// }
createAttachment();
alert("Report Send Successfully");
}
function getReportingSession() {
var reportName = "Report Test.rdl"; //set this to the report you are trying to download
//var reportGuid = "170faa66-19ad-e811-a96f-000d3af43d1a"; //set this to the guid of the report you are trying to download
var reportGuid = "2B5A0201-D382-E911-A973-000D3AF06590"; //set this to the guid of the report you are trying to download
var rptPathString = ""; //set this to the CRMF_Filtered parameter
var selectedIds = Xrm.Page.data.entity.getId();
var pth = Xrm.Page.context.getClientUrl() + "/CRMReports/rsviewer/reportviewer.aspx";
var retrieveEntityReq = new XMLHttpRequest();

var strParameterXML = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'><entity name='im360_recurringprocess'><all-attributes /><filter type='and'><condition attribute='im360_recurringprocessid' operator='eq' value='" + selectedIds + "' /> </filter></entity></fetch>";

retrieveEntityReq.open("POST", pth, false);

retrieveEntityReq.setRequestHeader("Accept", "*/*");

retrieveEntityReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

retrieveEntityReq.send("id=%7B" + reportGuid + "%7D&uniquename=" + Xrm.Page.context.getOrgUniqueName() + "&iscustomreport=true&reportnameonsrs=&reportName=" + reportName + "&isScheduledReport=false&p:CRM_im360_recurringprocess=" + strParameterXML);
var x = retrieveEntityReq.responseText.lastIndexOf("ReportSession=");
var y = retrieveEntityReq.responseText.lastIndexOf("ControlID=");
// alert("x" + x + "y" + y);
var ret = new Array();

ret[0] = retrieveEntityReq.responseText.substr(x + 14, 24);
ret[1] = retrieveEntityReq.responseText.substr(x + 10, 32);
return ret;
}

function createEntity(ent, entName, upd) {
var jsonEntity = JSON.stringify(ent);
var createEntityReq = new XMLHttpRequest();
var ODataPath = Xrm.Page.context.getClientUrl() + "/XRMServices/2011/OrganizationData.svc";
createEntityReq.open("POST", ODataPath + "/" + entName + "Set" + upd, false);
createEntityReq.setRequestHeader("Accept", "application/json");
createEntityReq.setRequestHeader("Content-Type", "application/json; charset=utf-8");
createEntityReq.send(jsonEntity);
var newEntity = JSON.parse(createEntityReq.responseText).d;

return newEntity;
}

function createAttachment() {
var params = getReportingSession();

if (msieversion() >= 1) {
encodePdf_IEOnly(params);
} else {
encodePdf(params);
}
}

var StringMaker = function () {
this.parts = [];
this.length = 0;
this.append = function (s) {
this.parts.push(s);
this.length += s.length;
}
this.prepend = function (s) {
this.parts.unshift(s);
this.length += s.length;
}
this.toString = function () {
return this.parts.join('');
}
}

var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

function encode64(input) {
var output = new StringMaker();
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;

while (i < input.length) {
chr1 = input[i++];
chr2 = input[i++];
chr3 = input[i++];

enc1 = chr1 >> 2;
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
enc4 = chr3 & 63;

if (isNaN(chr2)) {
enc3 = enc4 = 64;
} else if (isNaN(chr3)) {
enc4 = 64;
}

output.append(keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4));
}

return output.toString();
}

function encodePdf_IEOnly(params) {
var bdy = new Array();
var retrieveEntityReq = new XMLHttpRequest();

var pth = Xrm.Page.context.getClientUrl() + "/Reserved.ReportViewerWebControl.axd?ReportSession=" + params[0] + "&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=" + params[1] + "&OpType=Export&FileName=Public&ContentDisposition=OnlyHtmlInline&Format=PDF";
retrieveEntityReq.open("GET", pth, false);
retrieveEntityReq.setRequestHeader("Accept", "*/*");

retrieveEntityReq.send();
bdy = new VBArray(retrieveEntityReq.responseBody).toArray(); // minimum IE9 required

createNotesAttachment(encode64(bdy));
}

function encodePdf(params) {
var xhr = new XMLHttpRequest();
var pth = Xrm.Page.context.getClientUrl() + "/Reserved.ReportViewerWebControl.axd?ReportSession=" + params[0] + "&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=" + params[1] + "&OpType=Export&FileName=Public&ContentDisposition=OnlyHtmlInline&Format=PDF";
xhr.open('GET', pth, true);

xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("Content-Type", "application/json; charset=utf-8");
xhr.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");


xhr.responseType = 'arraybuffer';

xhr.onload = function (e) {
//xhr.onreadystatechange = function() {
if (this.status == 200) {
var uInt8Array = new Uint8Array(this.response);
base64 = encode64(uInt8Array);
CreateEmail(base64);
createNotesAttachment(base64);
}
};
xhr.send();
}

function msieversion() {

var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");

if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer, return version number
return parseInt(ua.substring(msie + 5, ua.indexOf(".", msie)));
else // If another browser, return 0
return 0;
}

function createNotesAttachment(base64data) {

var propertyName;
var propertyAddress;
var propertyCity;
var estimateNumber;
// if (Xrm.Page.getAttribute("name") !== null && Xrm.Page.getAttribute("name") !== undefined)
// {
// estimateNumber = Xrm.Page.getAttribute("name").getValue();
// //alert(estimateNumber);
// }
// if (Xrm.Page.getAttribute("ccc_propertyid") !== null && Xrm.Page.getAttribute("ccc_propertyid") !== undefined) {
// var propertyNameRef = Xrm.Page.getAttribute("ccc_propertyid");
// if (propertyNameRef != null && propertyNameRef != undefined) {
// propertyId = propertyNameRef.getValue()[0].id.slice(1, -1);
// propertyAddress = propertyNameRef.getValue()[0].name;
// var object = getPropertyAddress(propertyId);
// propertyName = object[1];
// propertyCity = object[2];
// }
// }

var post = Object();
post.DocumentBody = base64data;
post.Subject = estimateNumber+propertyAddress;
post.FileName = "Testing Report " + ".pdf";
post.MimeType = "application/pdf";
post.ObjectId = Object();
post.ObjectId.LogicalName = Xrm.Page.data.entity.getEntityName();
post.ObjectId.Id = Xrm.Page.data.entity.getId();
createEntity(post, "Annotation", "");
}

function CreateEmail(base64) {

var recordURL;
var propertyName;
var propertyAddress;
var propertyCity;
var estimateNumber;
var serverURL = Xrm.Page.context.getClientUrl();
var email = {};
var qid = Xrm.Page.data.entity.getId().replace(/[{}]/g, "");
var OwnerLookup = Xrm.Page.getAttribute("ownerid").getValue();
var OwnerGuid = OwnerLookup[0].id;
OwnerGuid = OwnerGuid.replace(/[{}]/g, "");
var ContactLookUp = Xrm.Page.getAttribute("im360_selectcontact").getValue();
var ContactId = ContactLookUp[0].id.replace(/[{}]/g, "");
var contactTypeName = ContactLookUp[0].typename;
var contactName = ContactLookUp[0].name;
//var signature = getSignature(OwnerGuid);
// if (Xrm.Page.getAttribute("ccc_recordurl") !== null && Xrm.Page.getAttribute("ccc_recordurl") !== undefined)
// {
// recordURL = Xrm.Page.getAttribute("ccc_recordurl").getValue();
// //alert(estimateNumber);
// }
// if (Xrm.Page.getAttribute("name") !== null && Xrm.Page.getAttribute("name") !== undefined)
// {
// estimateNumber = Xrm.Page.getAttribute("name").getValue();
// //alert(estimateNumber);
// }
// if (Xrm.Page.getAttribute("ccc_propertyid") !== null && Xrm.Page.getAttribute("ccc_propertyid") !== undefined)
// {
// var propertyNameRef = Xrm.Page.getAttribute("ccc_propertyid");
// if (propertyNameRef != null && propertyNameRef != undefined) {
// propertyId = propertyNameRef.getValue()[0].id.slice(1, -1);
// propertyAddress = propertyNameRef.getValue()[0].name;
// var object = getPropertyAddress(propertyId);
// propertyName = object[1];
// propertyCity = object[2];
// }
// }
//signature=XMLToString(signature);
//alert("OwnerGuid" + OwnerGuid + " signature" + signature);
// if (signature == null || signature == undefined)
// {
// signature = "";
// }
var string = "Hello " + contactName + " ,</br>Here is the estimate you requested for this location:</br>Estimate # " + "" + " </br>" + "" + " " + "" + ", " + "" + "</br></br>A PDF copy is attached to this email, as well.</br>If you have any questions about this estimate, please reply back to this email or call me.Thank you for considering us!</br></br>" + "";
// var string = "Hello " + contactName + " ,</br>Here is the estimate you requested for this location:</br>Estimate # <a href=" + recordURL + ">" + estimateNumber + "</a> </br>" + propertyName + " " + propertyAddress + ", " + propertyCity + "</br></br> You can click on the estimate number to view the estimate online to approve it, request changes, etc.</br>A PDF copy is attached to this email, as well.</br>If you have any questions about this estimate, please reply back to this email or call me.Thank you for considering us!</br></br>" + signature;

email["subject"] = "Tesing Subject";
// email["description"] = "Hello "+contactName+" ,"+'\n'+"Here is the estimate you requested for this location:"+'\n'+"Estimate # [ESTIMATE-NUMBER] (linked to the estimate)"+'\n'+" ([PROPERTY-NAME]) [PROPERTY-ADDRESS], [PROPERTY-CITY]"+'\n'+""+'\n'+" You can click on the estimate number to view the estimate online to approve it, request changes, etc."+'\n'+"A PDF copy is attached to this email, as well."+'\n'+"If you have any questions about this estimate, please reply back to this email or call me."+'\n'+""+'\n'+"Thank you for considering us!"+'\n'+""+'\n'+signature;
email["description"] = string;
email["regardingobjectid_im360_recurringprocess@odata.bind"] = "/im360_recurringprocesses(" + qid + ")";
//activityparty collection
var activityparties = [];
//from party
var from = {};
from["partyid_systemuser@odata.bind"] = "/systemusers(" + OwnerGuid + ")";
from["participationtypemask"] = 1;
//to party
var to = {};
to["partyid_contact@odata.bind"] = "/contacts(" + ContactId + ")";
to["participationtypemask"] = 2;

activityparties.push(to);
activityparties.push(from);

//set to and from to email
email["email_activity_parties"] = activityparties;

var req = new XMLHttpRequest();
req.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/emails", false);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.onreadystatechange = function () {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 204) {
var uri = this.getResponseHeader("OData-EntityId");
var regExp = /\(([^)]+)\)/;
var matches = regExp.exec(uri);
var newEntityId = matches[1];
createEmailAttachment(newEntityId, base64);
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send(JSON.stringify(email));
///////////////////
}
function createEmailAttachment(emailUri, base64) {
var activityId = emailUri.replace(/[{}]/g, "");
var propertyId;
var propertyName;
var propertyAddress;
var propertyCity;
var estimateNumber;
// if (Xrm.Page.getAttribute("name") !== null && Xrm.Page.getAttribute("name") !== undefined)
// {
// estimateNumber = Xrm.Page.getAttribute("name").getValue();
// }
// if (Xrm.Page.getAttribute("ccc_propertyid") !== null && Xrm.Page.getAttribute("ccc_propertyid") !== undefined)
// {
// var propertyNameRef = Xrm.Page.getAttribute("ccc_propertyid");
// if (propertyNameRef != null && propertyNameRef != undefined) {
// propertyId = propertyNameRef.getValue()[0].id.slice(1, -1);
// propertyAddress = propertyNameRef.getValue()[0].name;
// var object = getPropertyAddress(propertyId);
// propertyName = object[1];
// propertyCity = object[2];

// }
// }


var activityType = "email"; //or any other entity type
var entity = {};
entity["objectid_activitypointer@odata.bind"] = "/activitypointers(" + activityId + ")";
//entity.body = "ZGZnZA=="; //your file encoded with Base64
entity.body = base64; //your file encoded with Base64
entity.filename = "report" + ".pdf";
entity.subject = "Testing Subject";
entity.objecttypecode = activityType;
var req = new XMLHttpRequest();
req.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/activitymimeattachments", false);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.onreadystatechange = function () {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 204) {
var uri = this.getResponseHeader("OData-EntityId");
var regExp = /\(([^)]+)\)/;
var matches = regExp.exec(uri);
var newEntityId = matches[1];
//alert("attachement created "+newEntityId);
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send(JSON.stringify(entity));
}
function getPropertyAddress(pid) {
debugger;
var ccc_name;
var ccc_property1;
var ccc_propertycity;
var req = new XMLHttpRequest();
req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/ccc_properties(" + pid + ")?$select=ccc_name,ccc_property1,ccc_propertycity", false);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");
req.onreadystatechange = function () {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 200) {
var result = JSON.parse(this.response);
ccc_name = result["ccc_name"];
ccc_property1 = result["ccc_property1"];
ccc_propertycity = result["ccc_propertycity"];
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send();
return [ccc_name, ccc_property1, ccc_propertycity];
}
function getSignature(OwnerGuid) {
debugger;
var sig;
var req = new XMLHttpRequest();
req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/emailsignatures?$select=presentationxml&$filter=_ownerid_value eq " + OwnerGuid, false);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");
req.onreadystatechange = function () {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 200) {
var results = JSON.parse(this.response);
for (var i = 0; i < results.value.length; i++) {
var presentationxml = results.value[i]["presentationxml"];
oXml = CreateXmlDocument(presentationxml);
sig = oXml.lastChild.lastElementChild.textContent;
}
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send();
return sig;
}
function CreateXmlDocument(signatureXmlStr) {
// Function to create Xml formate of return email template data
var parseXml;

if (window.DOMParser) {
parseXml = function (xmlStr) {
return (new window.DOMParser()).parseFromString(xmlStr, "text/xml");
};
}
else if (typeof window.ActiveXObject != "undefined" && new window.ActiveXObject("Microsoft.XMLDOM")) {
parseXml = function (xmlStr) {
var xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = "false";
xmlDoc.loadXML(xmlStr);

return xmlDoc;
};
}
else {
parseXml = function () { return null; }
}

var xml = parseXml(signatureXmlStr);
if (xml) {
return xml;
}
}

////////////////////////////////////////////////////////////////////

D365 client customization's setLookupTypes(["contact"]) doesn't support Connection entity's Connected To field type?

$
0
0

Hi,

I want to restrict the number of entities shown in the

Here's my piece of code -

oConnectionFormCustomization = {
    filterRequiredLookups: function (context) {
        "use strict";
        debugger;
        var con = context.getFormContext();
        //Xrm.Page.getControl("record2id").addPreSearch(oConnectionFormCustomization.addFilter);
        con.getControl("record2id").setEntityTypes(["account", "contact", "systemuser"]);
    }

 
};

I'm calling this method on Load of the Connection form and passing the execution context too as per the v9 standards.

But, when I try this on the Console of DevTools to see where the code is breaking,  I get this -

Any thoughts on what I could be doing wrong?

Thanks.

Converting rdl file to word and upload to azure

$
0
0

Hi,

I have created rdl file. I want to convert it to word format and upload to azure...

I have converted from rdl file to word format and upload to azure.. 

But I am getting the error message: "index was out of range. must be non-negative and less than the size of the collection"

Below are the code

function encodePdf(responseSession) {

var pth, bdy;

var retrieveEntityReq = new XMLHttpRequest();

pth = ServerURL + "/Reserved.ReportViewerWebControl.axd?ReportSession=" + responseSession[0] + "&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=" + responseSession[1] + "&OpType=Export&FileName=Test&ContentDisposition=OnlyHtmlInline&Format=WORD";

retrieveEntityReq.open("GET", pth, true);

retrieveEntityReq.setRequestHeader("Accept", "*/*");

retrieveEntityReq.responseType = "arraybuffer";

retrieveEntityReq.onreadystatechange = function () {

if (retrieveEntityReq.readyState == 4 && retrieveEntityReq.status == 200) {

var binary = "";

var bytes = new Uint8Array(this.response);

for (var i = 0; i < bytes.byteLength; i++) {

binary += String.fromCharCode(bytes[i]);

}

if (bdy != null) {


UploadDocument(bdy);
}

}

};

retrieveEntityReq.send();

}

function UploadDocument(bdy) {

file = bdy;
var formData = new FormData;
formData.append('file', file);
var recordId = parent.window.Xrm.Page.data.entity.getId();
var userId = parent.window.Xrm.Page.context.getUserId();
formData.append('id', recordId);
formData.append('userId', userId);
formData.append('type', 'file');
var req = new XMLHttpRequest();
req.open("POST", getStorageServer() + 'Upload.aspx', true); // Getting the azure site url
req.onreadystatechange = function () {
if (req.readyState === 4 /* complete */) {
req.onreadystatechange = null; //Addresses potential memory leak issue with IE
if (req.status === 200) {
if (req.responseText.startsWith("OK")) {
alert('File content was uploaded.');
}
else {

alert(req.responseText);
}
}
}
};
req.send(formData);


}


Filter Subgrid : Cannot read property 'SetParameter' of undefined

$
0
0

Hi, I'm working on Dynamics CRM 2016 (8.1) on premise, and I'm trying to filter a subgrid on onload form event via fetch xml, but I get this error

My function is:

function filterSubGridsRegBonus() {
    filterSubGrid("Subgrid_1");
    filterSubGrid("Subgrid_2");
}

function filterSubGrid(subgridName) {
    var formContext = Xrm.Page;

    var entityId = formContext.data.entity.getId().replace('{', '').replace('}', '');
    var entityName = formContext.getControl("EntityName").getEntityName();

    var subgrid = window.parent.document.getElementById(subgridName);

    if (subgrid == null) {
        setTimeout(function () {
            filterSubGrid();
        }, 2000);
        return;
    }

    var fetchXml =
        "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" +
        "<entity name='" + entityName + "' >" +
        "<all-attributes/>" +
        "<filter type='and' >" +
        "<condition attribute='param1' operator='neq' value='" + entityId + "' />" +
        "</filter>" +
        "<filter type='and' >" +
        "<condition attribute='param2' operator='neq' value='" + entityId + "' />" +
        "</filter>" +
        "</entity>" +
        "</fetch>";

        subgrid.control.SetParameter("fetchXml", fetchXml);
        subgrid.control.refresh();
}


How can I solve this? Thank you!

Best approach to fire a plugin on a schedule

$
0
0

Hi

I have some code (in a plugin) that I'd like to use to make regular housekeeping updates to my CRM.
I'm not sure a plugin is the best approach but the functionality needs to run at 15minute intervals.
Would it be better to use a Workflow?

Custom javascript modifications in preparation for migration to CRM 2016

$
0
0

Hello,

We are preparing to migrate from CRM2013 onpremise to cloud CRM2016. I know that DOM-accessing javascript is not supported but is there any supported method or alternative to what we were using (to color-code a field background depending on field value). - We were using document.getelementbyid("element").style.backgroundColor =

Like I say I totally appreciate this is unsupported but it WILL work in 2016 if I place "parent."before "document"

Is there any supported way of doing this - i.e. any function which I can replace all usage of "document.getelement.byId" with?

In this case Xrm.page.getAttribue("myattribute").style does not work.

Any suggestions very welcome - thanks.

Changing time for appointment does not work anymore

$
0
0

Hi

I want to create a new appointment in Dynamics, but I cannot change the start and end time anymore. I can change the date, but the time does not change.

How to set default lookup view in Unified Interface (CRM HUB) dynamically based on conditions

$
0
0

How to set default lookup view in Unified Interface (CRM HUB) dynamically based on conditions ?

Can we see SdkmessageprocessingstepImages Images on the server

$
0
0

Hi All,

I have a plugin with a step and an image registered.

On the CRM server I know I can see the plugins in Plugin Assemblies and the steps in Sdkmessageprocessing step. 

But I had a few questions regarding images :

1. Is there a way I can see the list of images in a particular plugin or a step in CRM server(not in Plugin Registration Tool) ?

2. What happens to an image linked to a step when I disable the step?

3. Can I add an image to a particular solution?

Thanks in advance . :)

Activity pointer and mapping to Activity Parties

$
0
0

We replicate from Dynamics 365 CRM 9.x Online to an inhouse SQL server using SCRIBE Online Replication.  We pull the activitypointer table every 15 minutes as this table has a modifiedon date.  Where we are challenged is that a few key columns in this table are activitypartyid lists and we can't replicate the activityparty table given its size and lack of a modifiedon date (can take 18-20 hours to replicate or more). 

What we need to be able to do is determine what accounts or contacts referred to in the activitypointer columns so that we can do appropriate reporting on which sales reps are touching (email, appointment, phone call) which of their clients on a regular basis as part of their comp is tied to touching all of their accounts each quarter.  

In addition to using SCRIBE Online for replication, we have SCRIBE Insight available to us on our local servers and we have SSIS with Kingswaysoft connector for Dynamics 365.  Are there any efficient approaches we might use to retrieve the level of information we need for our reporting?  


Dynamics CRM 2015 On-premise The report execution 4nlzxx55ujf05t55kv0fova5 has expired or cannot be found

$
0
0

Dear, since you update local Dynamics CRM 2015 (On-Premise) to version 7.0.3.0147, none of the reports of reimplemented organizations work.
The error is "The report execution 4nlzxx55ujf05t55kv0fova5 has expired or can not be found"

How can this error be fixed?

Full Stack:

[CrmReportingException: Unable to add entry to ReportExecutionIdCache for ExecutionId: 4nlzxx55ujf05t55kv0fova5]
   at Microsoft.Crm.Caching.ReportExecutionIdCacheLoader.LoadCacheData(String executionId, ExecutionContext context)
   at Microsoft.Crm.Caching.ObjectModelCacheLoader`2.LoadCacheData(TKey key, IOrganizationContext context)
   at Microsoft.Crm.Caching.CrmMultiOrgCacheBase`2.CreateEntry(TKey key, IOrganizationContext context)
   at Microsoft.Crm.Caching.CrmMultiOrgCacheBase`2.LookupEntry(TKey key, IOrganizationContext context)
   at Microsoft.Crm.Web.Reporting.ReportViewerValidationHandler.ValidateReportSessionId(HttpContext context)

[CrmReportingException: The report execution 4nlzxx55ujf05t55kv0fova5 has expired or cannot be found.]
   at Microsoft.Crm.Web.Reporting.ReportViewerValidationHandler.ValidateReportSessionId(HttpContext context)
   at Microsoft.Crm.Web.Reporting.ReportViewerValidationHandler.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)





Microsoft Dynamics CRM 2016 OnPrimise OOB Subgrid

$
0
0

Hello everyone I'm using microsoft dynamics CRM 2016 OnPrimise and I'm having this strange kind of issue.

The 'See the records associated with this view' Button on all OOB Subgrids  is non response means no matter how many times  you click that button its not doing anything (screenshot attached). Please note that its happening on all the subgrids throughout the CRM. Any help would be greatly appreciated. Thanks

Populate multiple values from 1 entity to another using JS

$
0
0

Hi, we are using CRM Online version 9.1.
This is the code I usually use for populating value from one entity to another.

function populateInvoicingDetails()

{
if(Xrm.Page.getAttribute("customerid").getValue()!=null)

//read

var opportunity = Xrm.Page.getAttribute("customerid").getValue()[0].id;

var opportunityId = opportunity.substring(1, 37);

opportunityId = opportunityId.replace('{', '').replace('}', '');
var req = new XMLHttpRequest();

req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v9.1/accounts(" + opportunityId + ")?$select=new_invoicetocontactname", true);
req.setRequestHeader("OData-MaxVersion", "4.0");

req.setRequestHeader("OData-Version", "4.0");

req.setRequestHeader("Accept", "application/json");

req.setRequestHeader("Content-Type", "application/json; charset=utf-8");

req.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");

req.onreadystatechange = function() {

if (this.readyState === 4) {

req.onreadystatechange = null;

if (this.status === 200) {

var result = JSON.parse(this.response);

var oppnumber1 = result["new_invoicetocontactname"];

// Replace with the actual field names of the email address and phone number in custom entity

Xrm.Page.getAttribute("new_invoicetocontactname").setValue(oppnumber1);
} else {

Xrm.Utility.alertDialog(this.statusText);

}

}

};

req.send();

}


I need to populate 6 values from Accounts to Invoice entity. I have created fields and mappings between the fields.

This works perfectly fine for one field.

How can I use this for multiple fields? I tried changing the code but could not make it work.

Thanx.

MS CRM 2013 integration with Outlook web application

$
0
0

Hi All,

I need help to integrate outlook web based  with ms crm 2013. How can i create addin or plugin that will integrate Outlook web and CRM. Is there any app or solution available for free.

Thanks in advance.

Thanks

First Response sent SLA

$
0
0

We currently have  auto response configured for our emails. But we want to use first response sent in Dynamics so that we can determine our SLA for emails. How do we do that? how can we configure first response sent? our email response time sla is >=80% to be responded within 1 hour. I hve found some articles that we need to create a workflow that will trigger the value of first response sent to YES. but i dont know how to do it. Please help. 

Viewing all 46379 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>