Modifying salesforce reports before exporting using Apex - salesforce

I am struggling to find where to start w.r.t my following problem.
In SFDC reports, there is an "export details" button to export a user chosen report into csv or xls formats. I want to modify this xls file (for example, encrypt it) before user downloads it.
I guess I can achieve this using Apex triggers. My questions are:
How can I add an Apex trigger which is triggered upon a user clicking this "export details" button?
How can I access the xls contents in this Apex trigger code where I want to encrypt them?
I extensively searched in Apex user guide and many other sources. I can not find how to add triggers to standard SFDC buttons.
Thank you very much in advance.

How can I add an Apex trigger which is triggered upon a user clicking
this "export details" button?
This isn't currently possible. First triggers are related to database actions and not user interface events. You can override the behavior for a lot of buttons using a view override, but unfortunately that's also not available for report buttons.
Workarounds
While you can't alter the behavior of the standard report experience, there is a new Reporting API that was just released by Salesforce that allows you to programmatically get the contents of a report. Using that you could build your own "encrypted report download" tool to accomplish this.
For more information, checkout this answer on Salesforce Stackexchange on accessing reports through the api. And in the future, post to Salesforce Stackexchange first!! That's where the community is these days ;)

Trigger can only be called when you do some dml operation in salesforce, clicking a button has no concern with the trigger calling,

Related

Using apex Code How to create Listview on Sobject, Having standard and custom fields

Anyone having idea about how to create Custom ListView on Standard Sobject, that can have both standard as well as custom fields.
Please share your knowledge.
Cheers!
Navigate to the tab for the custom object in you are in Classic salesforce click the "Create New View" link next to the list view droplist if in Lightning click the Cog to the right top of the UI then click the "New" menu option. Select the Standard and Custom fields that you want to appear in the list view, I believe up to 10 fields, and the criteria for the view and who can see the listview, then save.
You can create this via code using the metadata API. You would have to download one of the wsdl files, use the wsld to Apex generator to create a wrapper for it and use that to create a soap envelope with the request. It might be easier to use https://github.com/financialforcedev/apex-mdapi where he did the work already, see this posth

Pre-populate recipients list on Docusign for Salesforce Lightning

I know this feature is available for the old Salesforce UI, but couldn't find anywhere how to pre-populate recipients using Docusign Lightning component.
Has anybody been able to solve it?
With SalesForce "classic" you could use a JavaScript button to prepopulate recipient info when the DocuSign Envelope is created. However, it appears that SalesForce Lightening does not support JavaScript buttons.
To customize "Send with DocuSign" behavior in SalesForce Lightening, you might try the following approach:
Create a Visualforce page that launches an APEX class controller that opens a URL.
Create a class to define that controller.
Create a new action on the opportunity and associate the Visualforce page to the action.
Add the Action to the appropriate area on the Opportunity page layout.
You can find a code sample for this type of implementation on this thread in the SalesForce Developer forum: https://developer.salesforce.com/forums/?id=906F0000000BWr4IAG. And, this other SO post shows an attempt to implement this approach to customize the Send with Docusign behavior: Customize "Send With Docusign" in Salesforce Lightning.
Note: I'm not a SalesForce developer and this answer is simply recommending an approach that others seem to have used in the scenario you've described.

How to auto generate a webpage after user submits form

I am looking for some initial direction on this one because I cannot seem to find my way with it. Let me explain...
I am developing a website wherein a logged in site member (Joomla 1.6) can fill out a simple form and attach a pdf to be uploaded upon submission. The user then clicks the submit button and the page will refresh to a new and unique web page.
User Submits data on http://www.examplesite.com and then after submission a new web page is generated that is called http://www.examplesite.com/userSubmittedValue
This newly generated web page would come from a template that is specified by the administrator and, most important, it will display all of the information that the user submitted. Also, there would be a link to download the pdf they uploaded. The user could then view a list of all the pages they have created in this manner via their profile.
I have seen this all over, but I am at a loss for how to generate this. Any help is much appreciated.
This is not something you will be able to easily do or get a detailed answer for here. If you just wanted to do the submission form with a thank you page that shows the data submitted you could use any number of form wizard type extensions - http://extensions.joomla.org/extensions/contacts-and-feedback/forms
If you just needed a way for users to upload PDfs and have access to them you could use one of the file management extensions that offer front end upload features - http://extensions.joomla.org/extensions/directory-a-documentation/downloads
If the additional data that is being submitted is simply data related to the file - title, description, etc then one of the file download components should work fine for you. The choices are limited in 1.6 at this time though so you might have to go with 1.5 to get the extension that works best for your needs.
So this probably isn't the best way to do it if your using Joomla but it just might help.
I would use PHP and inside of you're directory have a file like "template.html". Then I would create some php to handle the task of....
Opening "template.html"
Finding and replacing the values that the user passed you
Save the "template.html" under a new name (userSubmittedValue.html)
Again, I never really use Joomla. If you were to try this I'd suggest checking out php's file system functions (http://us2.php.net/manual/en/ref.filesystem.php).
Hope this helps a bit.

SSRS- How can I eliminate page breaks within an email body?

I have several SSRS '08 reports that look great when viewed as a web page or exported to the various formats. Recently, someone wanted a data driven subscription to go out for the report. No prob. They were adamant that they did not want the report attached to the email or to link to the report from the email. No prob. Unfortunately, the email body containing the report contents has page breaks at regular intervals. Problem.
Is there a way to conditionally have page breaks, so that I can prevent them from showing up in the email?
Thanks for any tips. (I googled for a solution, but if there is one, I didn't use the right search terms.)
-Kevin
The MHTML rendering extension (probably the one you're using if you're embedding reports in emails) supports the disabling of soft page breaks using the "interactive height" report property.
Have a peek at this question for more details:
Single page display in HTML rendering : SSRS
Actually this is a question related to this: They were adamant that they did not want the report attached to the email or to link to the report from the email.
How do I do this? How do I include the report in the email body?
Can this be done in SSRS 2005?

How can I disable the Publish button in EPiServer's content editor?

I have an EPiServer project which is using the sequential workflow to validate content changes. This works fine, however we have a slight issue where content reviewers are just clicking Publish when they are happy with an editor's work. What they should be doing is using the workflow task window and indicating their approval through that.
To enforce this behaviour I would like to disable the Publish button in the content editor under certain circumstances (i.e. when there is an outstanding workflow task linked to the current page).
Does anyone have any ideas how I can do this, or even an alternative solution to the problem altogether?
Actually, I think you may want to revisit your workflow logic.
If a user with publishing rights publishes a page: that should be considered an approval. You could easily hook up to the Published event to see if the page is part of a currently running workflow.

Resources