Editing an email that is generated via an Saleforce email template BEFORE it is sent is something that I have had a few clients grumble over, the feature is baked into the Quote object which makes sense, but you try telling clients they cant have it for Order objects….
So this is a basic solution that gets round this problem and is the basic set-up for expanding it to solve all the issues, in this case I am solving the most common issue I have come access, in that you are generating a order recept or delivery note pdf using the ‘renderAs=”PDF”’ option in an email template and want to send the email with a custom message to one or more people that you decide at the time of sending.
To do that we are going to create a new visual force page that resembles a normal email and use it to fill in the details before we generate the email template
This is just a basic object with the fields we need for the email, and a lookup field to the parent Order
Note: For brevity I’m leaving out the creation of the layout for the custom object and the adding of the related list to the Order Layout
These are the temporary fields that we are using to actually send the template email, resist the urge to set the To/CC/BCC as email fields as that will stop you having multiple recipients.
Obviously these fields have to be editable to all but not part of the order layouts so they don’t show up.
This page is as simple or complex as you can want it, my one here takes email address separated by a comma but yours can be a really posh contact lookup
I have just put comments on the code, as its not complex and follows the flow chart at the top of the blog.
Now update your email templates to use the “le_Body__c” and “le_Subject__c” fields for their email contents,
So PDF’s generated by Email templates in Salesforce are not saved and you cant get hold of them, so we are not saving them in the custom email object, if you do need that, then you will need to convert your email templates to visual force pages then render as PDFs and save them in the custom objects.
I have been doing a lot of cloud dev in recent months, not Internet facing work (been doing that for over a decade), but proper work on various cloud platforms (4+ of them) and they have turned out to require a shifting of mental gears, not from a technical aspect nor from a platform or paradigm shift (saas) but from dealing with a different type of client point of view.
Now that seems odd, sure your cloud clients are nearly all the business rather than IT, but lots of my work is direct with the business and it is often a relief to do so as you can deliver a product that best matches the exact needs of the people that use it.
After a lot of head scratching and reviewing of the projects I have come up with the following reasons
Sales before IT: With cloud based projects the sales team have very often just finished with the customer, so the customer arrives with the expectation that the platform is a PERFECT fit for everything they might want and it might just needs a tiny update to match their needs and that the update will only take a hour or 2…. but as is always true the devil it in the details, so when we look at their requirements and say that it’s going to take a week of hard work and then they will have to spend time testing, you have suddenly upset both their time frames and budgets. 1
Client reflexes: A lot of the cloud clients are sales/marketing people or from another branch where haggling and negotiations are built-in, these people live in a fast moving world and have never liked the iterative and somewhat slow moving nature of traditional IT projects “I just want it to work how I want”. for such people paying “not a penny more” and getting more than you paid for are Good Things. A side-effect of this is that such clients are quick to anger when they require a change that will take more money or time. Small changes are non-stop with cloud projects where the client can see the work as it is done: I have heard phrases like “Just one more thing”, “It will only take 5 minutes”, “I had assumed” and — my absolute favourite — “It’s just common sense, it should do XXX,” more over the last six months than I have in the previous six years combined.
They have already paid: Decent cloud services are not cheap and the clients have often already paid a fair lump before they get to customising their environment, so every penny you want is money they feel is an extra, very much like someone at a hotel, we all enjoy the extra stuff but are really unhappy to see it on our bill. 2
Re-tooling: All of the new cloud platforms are feature rich and do a lot of things very quickly but that is often within the boundaries of a given tool or feature, I can see why this is so 3, you are aiming for the old 80/20 rule , so when a customer says “I just need it to do xxxxx” and you simply can’t make the tool do that, have then used a different tool and spent a load of time reconfiguring the new tool to look like the old one so you can add the one missing feature. it does not matter how clever that is or how hard you have worked, from a clients point of view you have turned a simple 5 min job into a 5 day job you and are from their point of view are not providing value for money 4.
Client rapport: Most cloud customisations are quick things, as a developer you have had very little time to get to know the client, what they mean vs what they say, what pressures they are under, if they have budget for these changes etc etc, and they often just view you as someone just getting in the way of their shiny new cloud platform.
These relatively new changes in the client developer relationship mean you have to change your way of dealing with clients
This is the hard bit, I have laid awake at night for a number of nights, wondering hard how to fix this, my time honoured method of working my guts off having failed me.
So far I have come up with:
Make it human: Try and make the relationship one between humans, site visit if possible, Skype video if not, so clients feel that they are working with people and more importantly people who’s professional opinion they can trust.
Speed up interactions: Not speed up coding as that has actually not got much faster with the new platforms, but speed-up the feedback you give clients, a quick Agile Scum with a client each morning can head a lot of bad things off and make them feel far more in the loop 5, use this to also keep them informed on how much the client has used / left in their bank / project pool, even it they have pushed for a fixed price, addionally the clients can cut their losses if a small change is going to take a long time.
Be firm: I’m rubbish at this part but with cloud clients there is an underlying expectation that you get loads for free, and that includes any changes they might want to make after a spec has been agreed, there is a middle groud between “nickle and diming” and being used as a doormat, try and get a rapport with your client so that you both know where that is.
Any one else got any good ideas?
One thing that I have found after multiple quotes, is that honesty works even less with cloud based quotes than it does with traditional IT quotes, I have had at least 3 occasions where I was genuinely puzzled that a quote I had done had not got picked for a spec, and a much cheaper quote was accepted, on all occasions I questioned the ability to deliver on a quote that low (even using offshore staff) and have been told each time that the competition just use the quote to get in the door then nickle and dime the project to death…. I hate that, I really hate it >:( ↩
Hell I’m one of the co-developers of a cloud platform and when we are coding new stuff it always with an eye to “how can we spend our time on stuff that will get the most use”. ↩
BTW the phrase “I’m trying to do what you asked” does not help here. ↩
But be firm that the meeting is only of keeping everyone on track, it is not a place to add a few new requirements in to the spec every day (ohhh boy don’t they love to try that), and that each person does only get 2-5 mins, if they want a longer meeting, book it later in the day. ↩
Where to start….
I should have done a proper blog after IBM Connect 2016, but its been so busy I did not make time, however a number of the points here that were just supposition at Connect have now been turned into facts.
Theo Heselmans who for all intents and purposes IS Engage, managed to do the impossible and top last years conference, firmly establishing Engage as the best event after Connect, with a huge array of varied content and no subject taboo, all that is required is that the content is GOOD!!, there were a number of times when I really would have liked to be in two places at the same time and that has not happened at a conference in ages.
The venue was the crazy Evoluon in Eindhoven which seemed custom built for such event (if they could get a grip on the wifi)
In a cheeky moment Theo did a backpack give away (because Connect did not this year for the first time)
We went live with LDC Via one year ago at the last Engage so it holds a special place for us, in that year a lot has happened and we have delivered tons more, but we got a lot more attention this year and found that we even have some competition, in this last year we have become established in peoples minds and people realise we offer a great product, all 4 of us were there and did not seem to have a quiet second, as always the speed sponsoring was exhausting and Julian did a great job on the 30 second new speed sponsoring to the whole conference, Matt White was bogged down with cold but still fought his way through the conference and drove us both there and back while at the same time giving his flipping cold to the rest of us.
This years give away “Colin” did sterling work and won the unofficial “best conference give-away” from a number of sources.
We tried a different tack with the sponsor session, showing how many ways you could integrate LDC Via into different frameworks (slide deck below)
Well bugger me… Inhi Cho Suh really impressed us all, from the little we saw of her at Connect (she was only introduced to the community right at the end of the conference) we guessed that she might not only be sane but sane and HUMAN and it turned out that she was!!, far more than we had all dared to hope, no “two tassel talk”1, she had fresh new ideas and had already started acting on them (such as moving Connect to San Francisco in 2017), we had a proper round table event where she dealt well with the hysterical gibbering we blasted her with and left us feeling that it might actually be possible to finally turn things around and start IBM ICS again (somebody pinch me)
On that note being a champion meant something at Engage and made me really think that I must buck my ideas up and start delivering far more.
Sadly I was doing another round of late night work while I was there so missed out on the parties and such (hence no photos), but judging from the state of my fellow LDC Via colleagues, the events and evenings were great fun and even members who were no longer in the IBM world turned up to revive past glories.
Gabriella Davis got me this totally apt t-shirt (which has since been pinched by my wife)
The session I luckily got accepted for was with Paul Mooney and was on Salesforce, a relatively new skill set for me and we were standing room only (mainly due to Paul), but people liked it and we were asked lots of good questions.
Other than that, it was mayhem, I had terrible client overflow and was running around all over the place stressing every second, but frankly I would not change it for the world. roll on next year.
“two tassel talk” : This is the long stream of corporate platitudes (sort of the corporate version of what politicians say) that you get off senior managers that are just marking time in their current role before they hope to be promoted away. ↩
As we ramp up for Connect 2016, we decided to do a quick introduction to LDC Via. this means that if you see something you want to ask questions about or a feature that is a must have we can sit down over a drink at Connect and see if we can solve them.
This is more an aide memoire than anything else (in case of a phone rebuild), but it is the list of essential software I have on my phone at the end of 2015
Google Play Music (so much better than Spotify for play lists and radio)
Dog Catcher (for podcasts)
Music Folder Player Full (the only decent player for displaying audio as it is laid out in the filesystem)
Slack (a truly amazing team chat)
Twitter (The stock version is actually the best)
Games (I tend to not play games on my phone as I have a Nvidia Shield Tablet)
Sorcery 1 (or any choose your own adventure game)
Moovit (best for London bus times)
Plus mobile banking and mobile ISP provider’s app.
It seems the need for hacks has not gone away with the move to cloud, but you do have to be more careful, as I have already found out Salesforce can break your custom code at will.
So that being true one of the things that SalesForce does not seem to have that every other framework does is a simple an powerful “hide when”, IMHO this feature should be present in every line button and object on every page and most platforms do,
It is the most requested feature for customisation that I have come across, and this is the hack that I use for read mode documents or forms (which strangely is where the request is most often made) (and yes it is a hack)
Lets break it down
We have to do a wait loop that keeps looking for the object till it finds it (then stops), because SalesForce adds button objects in after the page loads so they wont be there when it first opens
So we put this code into a Page
This insert that page into the layout Object layout we want it to effect.
that would normally give a big white space where the inserted form lives, so we make the page a 1% by 1px block
And that’s it, just save the layout, the button/”what ever” will hide when the page loads, a hack but a simple reliable hack
Now as always “hide when” is not security, remember to make sure that you don’t leave functions exposed and think this kind of thing covers you.
I was doing some fixes on a classic domino web app that uses bootstrap datepicker when an issue was raised. turns out its a bugger to get the jquery datapicker and domino date format to agree with each other for different countires ie mm/dd/yyyy or dd/mm/yyyy or dd.mm.yyyy
So we cheated, we replaced the “format:” parameter in the date picker below:
with some computed text with the following formula:
I find the best way is to put this in the default setting meaning you only have to do it once
Simple, worked fine with a wide variety of date formats and kept everything in sync with what ever format Domino ended up picking.
As @devinthecloud points out in his Blog post Salesforce Winter 16 wrecked C3 charts on the pages he and I had developed. he found the removal of <apex:form> fixed the issue on his pages, but on my page the charts were still broken, so instead of this:
You get this
I stripped the page down to a bare minimum that you can use to recreate the issue, see below,
This let me narrow it down to the Salesforce header.
when you set showHeader=”true” it breaks
if you set showHeader=”false” it starts working
As this is obviously and provably down to a change in winter 16 I can raise it with Salesforce and get a fix.
“At times, Client Side JS conflict with SFDC header JS will collide with already defined functions with the same name.”
Ah it’s nice to see that young Internet companies have the same grasp of customer service as the traditional IT companies and thus it falls back on consultants to fix, in this case with an Iframe, I’m not a fan of Iframes normally but as Salesforce use them themselves there is precedent
And so we now split our single page into 2 pages, an inner content and an outer Iframe wrapper
First we take out the existing page (it was called “chart_test”), rename it to “chart_test_inner” and set showHeader=”false”
Then we put in a Iframe wrapper with the old name and a bit of CSS to make it size properly then point it to the inner content
And now instead of a broken
We have a working
For this blog I use Statamic, a very nice website CMS bassed on Markdown and using flat files which makes it perfect for the way I work in that I can link a Drop box account to the cheap AWS server I use for hosting and then edit blogs via mobile on a wide variety of machines with just a test editor.
Anyway the site has been rock solid for ages (5500+ hours) when I suddenly realised I wanted to upgraded the Statamic version to take advantage of some new features, that’s an easy job, you just replace a couple of directories in the httpd WWW directory, but I got a couple of errors and realised that I had an old version of PHP53 on the server and I had not patched it for a while (wince). also it had been so long since I had even logged on to the box that I could not remember what to do, so this is just an aide-memoire for those in the same situation
as I’m on Linux you need to make sure your AWS pem is secure sooo
Then connect to the box with SSH
Now first things first, lets do a full update
Once that is done, we have to remove http and php to update them all (yes you will get an outage)
This will uninstall the server its self (but not your website), lets install the new version
If you notice I added “php55-gd” to the install as you will need this for some of the new Statamic features such as the file and gallery features. Quick start the server before anyone notices
You will find that the site seems to work fine, but as soon as you attempt to go to a individual blog you will find it gives you a 404, this is because the htaccess files in Statamic are being ignored so you will have to go back and tell httpd to not ignore them. so you need to edit the httpd.conf file
So first lets go to the httpd config directory
And edit the httpd.conf file ( a good cheat sheet to vi is Here )
change the instances of “AllowOverride None” to “AllowOverride All”
once that is saved you just restart httpd
And you should be all done.
A very hectic Icon UK has just passed in a blur, leaving a hangover and a sense of satisfaction.
Tim Clark put on great display aided by a number of brave souls, with great content and facilities (ignoring the on site WIFI) and amazing after event social times.
As always the IBM community put on its best and came out with a wide variety of vendors and attendees (most of them long time friends that I get to see far too infrequently) all very positive and with fresh new ideas.
But for me the highlight of the conference was the arrival of IBM Marketing’s Penny Hill and the IBM champion manager Amanda Bauman , marketings absence has been a long bug bear and to finally meet someone and be able to offer help to and get help in return was wonderful ( so Penny or Amanda if you are reading this, I was serious about just yelling if there was anything I could do to help and I suspect that applies for a lot of the community.) I also must not forget the none marketing branches of IBM who also came out, took criticism and came back with excellent answers, well done all round.
LDC Via was taken far more seriously by attendees then in previous conferences (well it seemed so to me), with us having the highest turn out of all the vendor sessions, so much so that we ran out of Gin and Pimms (and no we did not tell people before the session that we would be serving drinks) and a good stream of people with serious questions and excellent use case scenarios, leaving use with a ton of leads to follow up and a bunch of new features to go Gold with.
Chris Harris was taking the good pictures this time around and did a great one of the LDCVia team. The proper serious one will appear on the official LDC Via blog for the event but in the mean time here is one of the silly ones.