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.
I sit here at the end of my first proper holiday in nearly a decade, my long awaited honeymoon and a trip to a place that has literally been the land of the rising sun for my entertainment since I have been a child.
and what did I think of it?
Japan did not disappoint in any way, the culture, the people, the city’s, everything lived up to my dreams
I could have wandered forever through the country and indeed never have I more wanted to pack up a ruck sack and travel as I did after seeing the green of my first bamboo forest.
The Japanese have taken so much of the west to their heart, but they have made it brighter and more Kawaii and in doing so have made it theirs, all the time maintaining their own gorgeous traditional culture.
Some of the things that made Japan so amazing could only exist in Japan as frankly we in the west sometimes just cant have nice things as we demand our right to screw them up, and thus we cant do crowding without pushing or have clean trains that don’t stink, I’m aware that I might find it hard to live with some of the rigged social normals the Japanese do, but its still a wonderful country.
We WILL go back