You need to sign in to do that
Don't have an account?
Richard Zenkevich
Lightning sync with Google calendar for events generated by apex code
Hello everyone,
I just had set up Lightning Sync (with Google Calendar) and it works pretty well with events manually created by user. But it refuse to synchronize events created from apex code.
For example if I create new event from anonimous apex, or process builder for some user – it will appear in his calendar on Salesforce org, but it would not be synchronized with users Google calendar.
But if user select this new event, click edit and then save (even without changes) – this event will be synchronized just us other manually created events.
Lightning Sync Error Report doesn't show any errors (events created by user sunc just fine).
Any ideas how to sync "syntetic" events?
I just had set up Lightning Sync (with Google Calendar) and it works pretty well with events manually created by user. But it refuse to synchronize events created from apex code.
For example if I create new event from anonimous apex, or process builder for some user – it will appear in his calendar on Salesforce org, but it would not be synchronized with users Google calendar.
But if user select this new event, click edit and then save (even without changes) – this event will be synchronized just us other manually created events.
Lightning Sync Error Report doesn't show any errors (events created by user sunc just fine).
Any ideas how to sync "syntetic" events?
Why events created though Apex code doesn't sync to Google Calendar using Lightning sync because its designed in such a way that when such events either created or edited from LEX/S1 the only sync.
to have LEX Only common functionality enforced, so such events will show if they have been created/edited from LEX/S1 or not and based on that check it gets synced.
Thanks,
Nagendra
I wasn't able to solve this so we decided to make it work another way - save event on Google side (usin Google Calendar API) and then let it sync to Salesforce. In our case it's ok to make it work that way.
Unfortunatelly Google has no ready-to-use implementation of Google API integration for Apex so I developed one for our usecase but now it works.
Would you be willing to share the Apex Google API you created? I suspect a lot of people will need to work around this Lightning Sync limitation (including me). :)
Hi, G Fudala,
I'm sorry, it's not my intellectual property so I can't share it now but you can follow my steps and get the same results.
Here is useful a talk where was made something similar (but with Google Sheets): https://www.salesforce.com/video/1758915/;
and here are some repositories from this tallk: https://github.com/jpescador/google-force and https://github.com/jpescador/google-force-demo .
But there is an issue with this demo (from repositories above) - they manually share the Google Sheet table to email from Google API token file, it was not an option in my case. To make it work for all of employees from your G Suit you need to get OAuth2 session token for your admin account and you are good to go (because G Suit admin has access to all of the calendars), so no need to share all the calendars to some service email.
Read this for more info: https://developers.google.com/identity/protocols/OAuth2ServiceAccount