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

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.

Related

Disable Wagtail "copy" functionality

Is it possible to disable the copy functionality provided in Wagtail?
My team has some logic for a custom page type that is having some issues. We'd like to prevent people from using the copy functionality for a short period of time while we figure out what's going on, and how to fix it.
You could use the before_copy_page hook, e.g. to redirect editors to the listings page with a notification explaining that copying has been temporarily disabled:
https://docs.wagtail.io/en/v2.5/reference/hooks.html#before-copy-page

Oracle ADF - Redirect link is not working

I am developing a simple application using ADF comes with basic CRUD operations (create, read, update, delete). In this case, as you can see, I have dragged a link to the 1st column which is highlighted in yellow.
So whenever I deploy it and click that, it is supposed to redirect me to the Edit page where client will allow to make commit:
I did make sure the Action of link is associated with the Edit page (as highlighted in yellow above). However, the link wouldn't redirect me anywhere, no response.This is the unbounded task flow:
Okay so I have found out the solution. Due to the default setting, the application will be deployed on IE and this message will prompt out. As you can see, the message is mentioning about browser's compatibility. My IE is version 11.6, I'm not sure what's the issue here since my IE is kinda latest version but this message still pops out and affects the redirect link from working. However, simply copy the application URL to Google Chrome and run should fix this issue. Hope this helps in future.
If the two pages in the Unbounded Task Flow, then Add WildCard Control Flow Rule
and connect the two pages with the WildCard.
Or you can use the Popup instead of opening a new page for edit

Modifying salesforce reports before exporting using Apex

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,

How to integrate payment gateway in applications created using javascript frameworks like ExtJs?

Our application is a one-page application created using ExtJs. For any user action, the browser tab is never reloaded and all the actions are performed using ajax. A user can open/close multiple ExtJs windows/panels within the same browser tab, and this way everything remains confined to the same browser tab.
Now, we need to integrate payment gateway in the application, which involves redirecting the user to the bank website and having her brought back to our application.
The issue is that when browser redirects the user, then all the application javascript code along with panels and windows get destroyed, and when the user comes back to the application then she finds it to be different from one she left.
As a solution to this, we were thinking of using following two appraoches:
Option 1. Maintaining the state of application - When user leaves for the bank's website then somehow we maintain the state of application - like which windows are opened carrying what data, which variables have which values etc.. and when user returns back, we generate the same application state for her.
Option 2. Have a browser pop-up window for payment gateway - We intend to provide a button which will open a small pop-up window carrying the transaction details, and in this pop-up window the entire payment gateway process will take place taking care of redirection and everything.
Option 1 is proving to be very cumbersome and complicated as maintaining the exact state is not getting feasible.
For Option 2, we are not sure if this is safe and possible?
Has anyone implemented such an approach earlier. Otherwise, what are the other options which we can go for?
Thanks for any help in advance.
I faced the problem and I implemented it using websocket/polling in the main application while a new window pops up for the payment.
After the payment is successful the main application will be notified.
That way each payment runs in it own sandbox totally unbound from the main application which makes maintenance quite easy. Note that our backend create a new session for each payment using the existing one.
I think it is not uncommon to open new windows for payment that's why I decided to go this.

Salesforce: Adding items to 'Personal Setup' and 'Customize'

I am writing a simple salesforce app that requires app-level and user-level configuration. I have created custom objects for these settings, but cannot figure out how to add links to the Setup page (Personal Setup and Customize) so that the settings can be managed.
Quite a lot of research, and a question on a salesforce board, have left me none the wiser. I have seen a couple of scripts on the web that hack the setup sidebar with javascript (eg http://userscripts.org/scripts/show/95361) ... but this can't be the right way to do it surely?
Thanks
Jim
You are unable to do this without hacking because Salesforce want it so that you don't require over-explicit setup of any app you create - they want you to make it data-independent and in fact it may fail a security review if it is data dependent. It will also likely cause you headaches in correctly unit testing the app.
My suggestion would be to have a set of custom pages which are linked to on the home page for a user which display if they have no current values (so the first thing they see on the home page when they login for the first time is a "Hey, before you use this app you need to do some configuration through this handy wizard" and then block access to other areas of the app (i.e. display warning messages on other pages) if the app has not had this data setup.
That way you are not hacking and are providing a nice user experience around the extra setup.
Paul
DO you just want to add a new TAB on the top menu that links to the Edit page for your new sObject?
If so:
Goto setup https://cs3.salesforce.com/ui/setup/Setup
Click on 'Create' > 'Tab'
Pick the sObject you want the tab edit, the click next until you save the new tab.
There is no supported way to augment the Setup menu.
You should probably be using Custom Settings for what you are describing - they were designed for app-level and user-level configuration, and are available from Setup.
Otherwise, if it really is custom setup that requires fancier logic / UI / etc, you may want to do what many SFDC ISV's do and ship your app with its own configuration tab that's hidden, and/or custom VF page that manages app settings.

Resources