PCF – Email Report

I created this PCF to allow users to create an email record and automatically generate and attach a SSRS report. You can download the managed solution here.

Link to the PCF Gallery here.


Setup


To add the PCF component to a form, create a new field of type of a ‘Single Line of Text’ and then find the control ‘Email Report’.

Remember to add the control to the devices you want.


The PCF component should appear like below on the form.


Field Properties


  • Subject – This determines what is populated in the subject field when the email record is created.
  • Description – This determines what is populated in the description field when the email record is created.
  • Report Name – This is the name of the report you will be executing. Example – (MainReport.rdl).
  • Report GUID – This is this GUID of the report you will be executing. You can find this GUID in the URL when searching for your report using advanced find.
  • Attachment File Name – This determines what the attachment file name will be when the email is created.
  • Automatically Send Report – This determines if the email will be automatically sent or not.
    • True – The email and attachment will automatically be created and sent.
    • False – The email record form will be opened with the report attached giving the user the option to manually send the email.
  • From Entity Type – The logical entity name of the from record. You can select from the entities below.
    • systemuser
    • queue
  • From – The GUID of the record you want to set the From field in the email.
  • To Entity Type – The logical entity name of the from record. You can select from the entities below.
    • contact
    • account
    • systemuser
    • entitlement
    • lead
    • queue
    • knowledgearticle
  • To – The GUID of the record you want to set the To field in the email.
  • Report Parameter Name – This is the SSRS report parameter name that is set for ‘enableprefiltering’ query. An example of this can be found here
  • Report FetchXML – This is where you create the FetchXML for running the report against. Example – If you are running the report against ‘bookableresourcebooking’, then you construct the XML like so:
    • <fetch version=’1.0′ output-format=’xml-platform’ mapping=’logical’ distinct=’false’><entity name=’bookableresourcebooking’><all-attributes/><filter type=’and’><condition attribute=’bookableresourcebookingid’ operator=’eq’ value='{0}’ /></filter></entity></fetch>
  • Record Id – This is the GUID of the record you are running the report against. This GUID will be added to the Report FetchXML above where the ‘{0}’ is added in the XML.
  • Regarding Object Id – The record Id for the regarding object field.
  • Regarding Object Entity Name – The entity logical name for the regarding object field.

Details


This PCF control works on the web and on mobile but only in online mode.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.