while playing around with push upgrades I also investigating how to deal nice with "manual" upgrades.
Background: I found it difficult in the past, to get the feature PUSH-MAJOR-Upgrades (https://developer.salesforce.com/releases/release/Winter13/PUSH+Major+Upgrade?language=en) enabled before passing security review... But I need it especially in development phase, BEFORE passing the review, to keep the testers up to date without annoying them. And even if PUSH-MAJOR is enabled, in some scenarios manual upgrades are better. BUT there is a problem: clients won't be notified when you publish a new version. So I thought it should be easy to check and provide a hint in the app. Like most desktop apps do it: check for updates. Not easy in SF... (or I did not found it)
My goal is:
- A: dynamically get the current installed version of a package
- B: dynamically get the most recent version (details-tab @ appexchange-listing)
- C: if(installed version < most recent version) offer clients to make an update
actually all but C seems hard in SF... so even A seems not to be supported out ouf the box. Being sad, I found a hackish solution I can live with for a while:
PageReference p = new PageReference('/0A3');
String html = p.getContent().toString();
I parse the html and I got it in the end. If you are interested in the full code: I'll happy to provide, but its not beautiful. If anyone has a better solution for that, it would be very welcome!
But B seems to be harder... I am looking for a way to determine the most recent available package displayed at the Details-Tab https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000B5SYEEA3 A clean way using an API I was not able to find. Very sad and going hackish again, it is not possible to reuse the trick form A, because the Detail-Tab will be loaded by AJAX here. Now way to get it with getContent() Sniffed also a bit into the POST of the ajax call. They use Viewstate :-( to submit params and wierd A4J.AJAX.Submit() calls to get the tab. Also the use Sarissa (abiss.gr) which I have no experience with. But the response of the ajax contains exactly what I need...
So is there a better approach to get info about package versions? If not, anyone crunched it the hard way?
Or has (in the end) anyone experience in how to convince Salesforce to enable PUSH-MAJOR before passed security review?
Thanks Uwe