tag:blogger.com,1999:blog-6215355853745600041.post6961733326197472793..comments2023-06-29T06:30:57.142-07:00Comments on A Devotee of Dynamics CRM: Dynamics CRM 2011 - Creating an e-mail activity with PDF format for custom SSRS report as an attachmentAnkit Shahhttp://www.blogger.com/profile/02231940860065519189noreply@blogger.comBlogger162125tag:blogger.com,1999:blog-6215355853745600041.post-46995493752381614422020-04-03T05:28:53.888-07:002020-04-03T05:28:53.888-07:00Dear Srini,
This solution works only with the cus...Dear Srini,<br /><br />This solution works only with the custom SSRS reports. Ankit Shahhttps://www.blogger.com/profile/02231940860065519189noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-16800526681329464962020-04-02T06:25:01.133-07:002020-04-02T06:25:01.133-07:00Hi Ankit,
Can this be used for default reports in ...Hi Ankit,<br />Can this be used for default reports in CRM like Account Distribution and supply the parameters for TopAccounts and GroupBy? I tried it but does not work, how to set these parameters? Any examples if feasible or snippet.Srini RNhttps://www.blogger.com/profile/15679780545698388667noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-67600249466459818852019-04-29T07:19:33.003-07:002019-04-29T07:19:33.003-07:00Hi,
Sorry for the delayed response. I would recom...Hi,<br /><br />Sorry for the delayed response. I would recommend to go with MS Flow instead of using this approach. This is an old way to achieve the need.<br /><br />Thanks,<br />AnkitAnkit Shahhttps://www.blogger.com/profile/02231940860065519189noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-83106976234082161942019-04-23T03:21:34.357-07:002019-04-23T03:21:34.357-07:00i am having the error while calling Create Email M...i am having the error while calling Create Email Method It shows below error,<br /><br />Sdk is not defined at CreateEmail Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-61770408158454241532019-04-12T08:13:50.764-07:002019-04-12T08:13:50.764-07:00Hi,
You can use Microsoft Flow and trigger this J...Hi,<br /><br />You can use Microsoft Flow and trigger this Js with your custom logic.<br /><br />Thanks<br />JayJay Buddhdevnoreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-27090180625999285232017-11-17T23:25:15.561-08:002017-11-17T23:25:15.561-08:00Hello Mahak,
Sorry for the delayed response.
I&#...Hello Mahak,<br /><br />Sorry for the delayed response.<br /><br />I've made some changes in the GetReportingSession()function to get rid of the "Failed load Pdf Document" Error. <br /><br />Thanks,<br />AnkitAnkit Shahhttps://www.blogger.com/profile/02231940860065519189noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-2445056434241792152017-11-17T23:24:36.282-08:002017-11-17T23:24:36.282-08:00Hello Ishu,
Sorry for the delayed response.
I...Hello Ishu,<br /><br />Sorry for the delayed response.<br /><br />I've made some changes in the GetReportingSession()function to get rid of the "Failed load Pdf Document" Error. <br /><br />Thanks,<br />AnkitAnkit Shahhttps://www.blogger.com/profile/02231940860065519189noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-12877623306531242992017-09-22T02:14:09.514-07:002017-09-22T02:14:09.514-07:00Hi Ankit,
Thanks for the great post, , i uesd you...Hi Ankit,<br /><br />Thanks for the great post, , i uesd your code in my dynamics 365 online version , Email and pdf attachment creating successfully , when open attached pdf i got "Failed load Pdf Document" Error How to resolve this issue please help me to do this<br />Dhivahttps://www.blogger.com/profile/04877894936252746002noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-84189893174136363152017-06-09T07:41:40.204-07:002017-06-09T07:41:40.204-07:00Hi Ankit,
Thanks for a gr8 solution.
But my requi...Hi Ankit,<br /><br />Thanks for a gr8 solution.<br />But my requirement is same as many before, need to send a custom report as pdf attachment every night in Dynamics 365. Can you provide a solution for the same.<br />Read through a lot of posts but could find your most apt with the only exception of manual intervention.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-58205346123727601242017-06-08T15:21:09.001-07:002017-06-08T15:21:09.001-07:00Hi Ankit, thanks for sharing your knowlege.
I faci...Hi Ankit, thanks for sharing your knowlege.<br />I facing a problem. My Report is execute in context of quote entity (FetchXML Report), the report is attach to the email activity correctly but when I open the file (pdf) the data in the report is not the data of the entity context but the data of other quote (the first(?)). My report Runs well when execute directly in CRM and show the data of the context quote (prefilter), but when i use the code to generate the email and attach to, the information in the report is not of the conext quote. There is a way to acomplish this in the conext report entity?.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-49413849147136591602017-05-12T04:36:43.262-07:002017-05-12T04:36:43.262-07:00Code for oob Quote.rdl report
function getReporti...Code for oob Quote.rdl report<br /><br />function getReportingSession() {<br /> var reportName = "Quote";<br /> reportID = "262D5F7E-4625-E711-811D-C4346BDD21B1";<br /> var pth = Xrm.Page.context.getClientUrl() + "/CRMReports/rsviewer/QuirksReportViewer.aspx";<br /> var retrieveEntityReq = new XMLHttpRequest();<br /> retrieveEntityReq.open("POST", pth, false);<br /> retrieveEntityReq.setRequestHeader("Accept", "*/*");<br /> retrieveEntityReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");<br /><br /> rptPathString = "id=%7B" + reportID + "%7D"+<br /> "&uniquename=" + Xrm.Page.context.getOrgUniqueName() +<br /> "&iscustomreport=true&reportnameonsrs=&reportName=" + reportName +<br /> "&isScheduledReport=false";<br /><br /> retrieveEntityReq.send(rptPathString);<br /><br /> var x = retrieveEntityReq.responseText.lastIndexOf("ReportSession=");<br /> var ret = new Array();<br /> ret[0] = retrieveEntityReq.responseText.substr(x + 14, 24); //Report session id<br /> x = retrieveEntityReq.responseText.lastIndexOf("ControlID=");<br /> ret[1] = retrieveEntityReq.responseText.substr(x + 10, 32); //Report control id<br /> return ret;<br />}<br /><br />even if we change &iscustomreport=false, it is not working. Giving same error response.Anonymoushttps://www.blogger.com/profile/17128103911372775720noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-44313263268832691762017-05-12T04:32:08.075-07:002017-05-12T04:32:08.075-07:00Ankit,
I am getting above response (retrieveEntit...Ankit,<br /><br />I am getting above response (retrieveEntityReq.responseText) when sending request. Not getting what else you are asking.<br />When i am trying to open the pdf file it is giving below error.<br />Acrobat could not open 'Quote.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).<br />Anonymoushttps://www.blogger.com/profile/17128103911372775720noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-5833989537885130912017-05-12T03:52:32.311-07:002017-05-12T03:52:32.311-07:00Ideally it should not be case I suppose. However c...Ideally it should not be case I suppose. However can you share the error that you're getting?Ankit Shahhttps://www.blogger.com/profile/02231940860065519189noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-88435010192365217392017-05-12T03:03:47.839-07:002017-05-12T03:03:47.839-07:00Actually code is working for custom reports but no...Actually code is working for custom reports but not working for oob reports.Anonymoushttps://www.blogger.com/profile/17128103911372775720noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-84351970625516926242017-05-12T02:46:56.388-07:002017-05-12T02:46:56.388-07:00Hi Mahak,
The given is error handler page URL and...Hi Mahak,<br /><br />The given is error handler page URL and not the actual error. Please provide some more details about an error.<br /><br />Thanks,<br />AnkitAnkit Shahhttps://www.blogger.com/profile/02231940860065519189noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-38814805713048578322017-05-11T00:23:23.735-07:002017-05-11T00:23:23.735-07:00Hello Ankit
I am getting below retrieveEntityReq....Hello Ankit<br /><br />I am getting below retrieveEntityReq.responseText in dynamics 365.<br /><br /><br />window.location.href = '/_common/error/errorhandler.aspx?BackUri=https%3a%2f%2fpragmasys90.crm8.dynamics.com%2fmain.aspx%3fetc%3d1084%26extraqs%3d%253f_gridType%253d1084%2526etc%253d1084%2526id%253d%25257bEE6460EA-6335-E711-811E-C4346BDC6E11%25257d%2526rskey%253d%25257b008FBB15-98E9-4C5D-A81A-E685FF8CCC2C%25257d%26pagemode%3diframe%26pagetype%3dentityrecord%26rskey%3d%257b008FBB15-98E9-4C5D-A81A-E685FF8CCC2C%257d&ErrorCode=0x8004832C&Parm0=%0d%0a%0d%0a&Parm1=%28rsItemNotFound%29&RequestUri=%2fCRMReports%2frsviewer%2fQuirksReportViewer.aspx&user_lcid=1033';<br />ThnaksAnonymoushttps://www.blogger.com/profile/17128103911372775720noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-88000790991148892882017-03-30T02:21:09.558-07:002017-03-30T02:21:09.558-07:00Share the same at ankithimmatlalshah@gmail.comShare the same at ankithimmatlalshah@gmail.comAnkit Shahhttps://www.blogger.com/profile/02231940860065519189noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-78622696453596488582017-03-30T01:57:48.634-07:002017-03-30T01:57:48.634-07:00I am unable to share code with you here, so plz sh...I am unable to share code with you here, so plz share email-id and I am also check both IE and chrome browser, but it was same issue.<br /><br />Anonymoushttps://www.blogger.com/profile/13856693797617762416noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-19390362651595849162017-03-30T00:21:38.645-07:002017-03-30T00:21:38.645-07:00Hi Surya,
Please share your code here. Also, in w...Hi Surya,<br /><br />Please share your code here. Also, in which browser are you validating this? Did you try with Chrome?<br /><br />Thanks,<br />Ankit<br />Ankit Shahhttps://www.blogger.com/profile/02231940860065519189noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-54616748437190858232017-03-30T00:18:38.517-07:002017-03-30T00:18:38.517-07:00Hi,
Great Blog,
Here my issue is that I am using ...Hi,<br />Great Blog,<br /><br />Here my issue is that I am using ms crm online version and every thing is Ok like attachment of PDF file and send an email, but main issue is on opening attached PDF file, It also have taken some size and at the time of opening it will not open.It will show "Format Error"<br /><br />kindly share your suggestion.<br /><br />Anonymoushttps://www.blogger.com/profile/13856693797617762416noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-25682090282353590882017-03-29T23:36:26.260-07:002017-03-29T23:36:26.260-07:00Hi,
I followed your code but i'm facing proble...Hi,<br />I followed your code but i'm facing problem.<br /><br />I want convert an invoice to PDF format using JavaScript and send with an attachment, but main issue on opening PDF file, attachment already done and working properly and PDF file also carry some size. At the time of open an PDF file it show error for opening.Anonymoushttps://www.blogger.com/profile/13856693797617762416noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-80578738702620375562017-03-07T04:46:28.055-08:002017-03-07T04:46:28.055-08:00Hi Kum,
In above code there is a method, named as...Hi Kum,<br /><br />In above code there is a method, named as PrepareActivityParty(), apply change in this method to loop through all parties and prepare a collection and return that collection for TO field of your email.<br /><br />Feel free to ask if you have any further questions.Ankit Shahhttps://www.blogger.com/profile/02231940860065519189noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-51155274014298724222017-02-27T06:49:40.235-08:002017-02-27T06:49:40.235-08:00Hi Ankit,
Really great concept. It worked great f...Hi Ankit,<br /><br />Really great concept. It worked great for me even in latest version of 365 online.<br />But one thing am trying to figure is adding multiple recipients? I tried adding it as as array and entity collection. Its only taking last email address from the loop condition?<br />is there something am missing? <br />Any guidance or direction is greatly appreciated.<br />THanks<br />KumKuma_23https://www.blogger.com/profile/14959505101037851479noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-86925518364061458022016-11-18T05:03:44.228-08:002016-11-18T05:03:44.228-08:00Hi,
One thing can be validated is below code, as ...Hi,<br /><br />One thing can be validated is below code, as your report has no parameters then I would suggest to remove "&p:salesorderid=" + Id + "&p:createdon=1/1/9999"" from the following line,<br /><br />var req = "id=%7B" + reportId + "%7D&uniquename=" + orgUniqueName + "&iscustomreport=true&reportName=" + reportName + "&isScheduledReport=false&p:salesorderid=" + Id + "&p:createdon=1/1/9999";<br /><br /><br />Thanks,<br />AnkitAnkit Shahhttps://www.blogger.com/profile/02231940860065519189noreply@blogger.comtag:blogger.com,1999:blog-6215355853745600041.post-67432461381365825472016-11-16T03:49:28.578-08:002016-11-16T03:49:28.578-08:001. Online, latest version
2. Runs fine from Crm
3...1. Online, latest version <br />2. Runs fine from Crm<br />3. Created using report wizard, could that be the issue?<br />4. No parameters <br />Thanks!KDhttps://www.blogger.com/profile/11470673494829274450noreply@blogger.com