being a salesforce jedi

26
Author Audition @patlatus www.patlatus.wordpress.com SALESFORCE DEVELOPMENT TEAM LEAD SALESFORCE CERTIFIED FORCE.COM ADVANCED DEVELOPER Bohdan Dovhan Being Salesforce Jedi: Salesforce Forbidden and Advanced Techniques Headshot optional

Upload: bohdan-dovhan

Post on 14-Jan-2017

369 views

Category:

Self Improvement


0 download

TRANSCRIPT

Page 1: Being A Salesforce Jedi

Author Audition

@patlatus www.patlatus.wordpress.com

S A L E S F O RC E D E V E LO P M E N T T E A M L E A D S A L E S F O RC E C E RT I F I E D F O RC E . C O M A D VA N C E D D E V E LO P E R

Bohdan Dovhan

Being Salesforce Jedi:Salesforce Forbidden and Advanced Techniques

Headshot optional

Page 2: Being A Salesforce Jedi

Author Audition

 Advanced techniques used by Salesforce Jedi Screen scraping, URL hacking Debugging gacks, Reverse engineeringOverview

Page 3: Being A Salesforce Jedi

Author Audition

Forbidden or advanced techniques

* Screen scraping: “Please Don’t Screen Scrape Visualforce!”Screen scraping is the most fragile integration you can imagine.If there is a better option, screen scraping should not be used* Debugging gacks (internal Salesforce Errors): gack id ( stack trace id)sometimes it is possible to fix the issue without Salesforce Support* Reverse engineering of Managed Package to workaround MP bugs* URL hacking: prepopulating field values on standard interface* Salesforce UI Requests Automation

Page 4: Being A Salesforce Jedi

Author Audition

URL hacking: prepopulating field values

To create arbitrary record follow the url: /{SObject prefix}/e?To populate standard fields: ?{standard field name}={value}To populate custom non-lookup fields: ?{custom field id}={value}To populate custom lookup field: ?CF{custom field id}_lkid={lookupId}&CF{custom field id}={lookup.Name}

Page 5: Being A Salesforce Jedi

Author Audition

URL hacking: easy FLS copy

1. Inspect request which is sent on FLS save on source field (which you want to copy FLS Settings from )2. Replace field Id with the desired field id3. Open that URL in browser

4. => PROFIT!

Page 6: Being A Salesforce Jedi

Author Audition

Screen Scraping Use Case: Get TotalLicenses

1. No “good” way to obtain “TotalLicenses” on Salesforce User License2. There is a pilot feature which is not available for APEX queries even when enabled, and client needs to ask Salesforce to turn that feature and write complex logic to retrieve that field value3. Instead, we can just screen scrape User Licenses page and transform it into custom object records. I implemented this in a ULETAS Gamma managed package4. Custom object records can be used for easy further integration, they are accessible through APEX queries

Page 7: Being A Salesforce Jedi

Author Audition

Page 8: Being A Salesforce Jedi

Author Audition

Page 9: Being A Salesforce Jedi

Author Audition

Page 10: Being A Salesforce Jedi

Author Audition

Salesforce UI Requests Automation

Never say never. Nothing is impossible for those who believe.Even if some piece of functionality is not exposed through Standard Objects, Apex Queries, REST API, SOAP API, Metadata API, Tooling API, Bulk API, it doesn’t mean that it is not possible to write integration on it.Using combination of Screen Scraping, URL hacking, Requests Reverse Engineering it is possible to integrate ANY functionality which is exposed through Salesforce UI.Such integration won’t be reliable and will be the most fragile integration you can ever imagine, however, it exists at least if you can’t achieve that by any other means.

Page 11: Being A Salesforce Jedi

Author Audition

Page 12: Being A Salesforce Jedi

Author Audition

Salesforce UI Requests Automation: Smart S2S

If you are tired to perform some tasks manually, you can implement Salesforce UI Requests Automation using combination of Screen Scraping, URL hacking, Requests Reverse Engineering.Use case: reconnect S2S connection of sandboxes after monthly refresh.1. Particular implementation for the current client (hardcoding templates there)2. General implementation for arbitrary pair of source and destination connectionsGeneral integration I am going to present as Smart S2S managed package

Page 13: Being A Salesforce Jedi

Author Audition

Salesforce UI Requests Automation: Smart S2S

Page 14: Being A Salesforce Jedi

Author Audition

Salesforce UI Requests Automation: Smart S2S

Page 15: Being A Salesforce Jedi

Author Audition

Page 16: Being A Salesforce Jedi

Author Audition

Salesforce UI Requests Automation: Smart S2S

Page 17: Being A Salesforce Jedi

Author Audition

Salesforce UI Requests Automation: Smart S2S

Page 18: Being A Salesforce Jedi

Author Audition

Page 19: Being A Salesforce Jedi

Author Audition

Page 20: Being A Salesforce Jedi

Author Audition

Salesforce UI Requests Automation: Smart S2S

Page 21: Being A Salesforce Jedi

Author Audition

References

1. https://developer.salesforce.com/blogs/developer-relations/2011/10/please-dont-screen-scrape-visualforce.html

2. http://salesforce.stackexchange.com/questions/4692/screen-scrape-salesforce-with-rest-get-call-from-apex

3. http://stackoverflow.com/questions/7841998/treat-salesforce-visualforce-page-as-an-external-widget

4. https://developer.salesforce.com/blogs/engineering/2015/02/gack.html5. http://www.salesforceben.com/salesforce-url-hacking-tutorial/

Page 22: Being A Salesforce Jedi

Author Audition

 Now you should have deeper understanding of how Salesforce works and how you can do impossible things with Salesforce You should also understand how you can automatize some routine tasks in Salesforce  You can now use provided information to build some unique application or integration

Summary

Page 23: Being A Salesforce Jedi

Author Audition

Q & A? Questions?

Page 24: Being A Salesforce Jedi

Author Audition

Page 25: Being A Salesforce Jedi

Author Audition

Page 26: Being A Salesforce Jedi

Author Audition

AND FINALLY: MAY BE THE FORCE.COM WITH YOU...