Posts

SSO setup where the same salesforce org is used as identity and service provider both.

Image
We got a requirement where the platform users needed access to community and they wanted a seamless access without having to login into community once they have logged into the org as a platform user.  Step 1:  Enable Domain in your Organization Go to Setup –> Administrative Setup –> Domain Management and click on My Domain. On this screen enter a new domain name, and click Check Availability. If the name is available, click the Terms and Conditions check box, then click Register Domain. Deploy to all users.  Step 2:  Enable Identity Provider in  your  Organization (Identity provider) In Identity Provider Salesforce Org, from Setup, enter  Identity Provider  in Quick Find box, than Select  Identity Provider  and Click on  Enable . Once you enable Identity Provider, You will get a screen like below.  Here you will find your domain name mentioned as Issuer and buttons to Download Certificat...

CDC - How to Reconstruct a Field from Its Diff Value

CDC-  Reconstruct a Field from Its Diff Value in Apex The following code sample can be used to reconstruct a long textarea field from its Diff value in a CDC packet. I have written it as a utility method which would need you to parse the CDC JSON packet and query the current value of the field from your DB. This is going to be useful when you are using CDC to keep 2 salesforce orgs in sync. On the listener side you need to implement this as part of CDC packet consumption. The first parameter (oldText) is the current value in the database before applying the CDC packet. The diff string is the parsed value from the CDC packet. For a JSON Node like " Description":{ "diff":"--- \n+++ 682b8747ccdb93b546e7bbe479b27d26ec7c38ccabb76cdd8308c6595492bffc\n@@ -2,1 +2,1 @@\n-Business applications are moving to the cloud. It’s not just a fad—the shift from traditional software models to the Internet has steadily gained momentum over the last 10 years.\n+Bus...