The proposal covers the one way integration between the Netsuite and Google calendar. The event should be created/updated in the Google Calendar based on the datas stored in the customer record.
Requirement
The requirement is to sync the Netsuite data to the Google calendar. The Sales planner adds the information about the appointments in the customer record. Based on the information in the customer record, an appointment event should be created in the Google Calendar for the sales representative. If the appointment details are canceled/moved/changed in the customer record, then the same changes should be reflected in the Google Calendar. There should be one way sync from Netsuite to the Google Calendar when a customer record is created/edited.
Our Solution
The requirement can be achieved by integrating Netsuite and google calendar using API. The user will add the appointment details in the customer record manually. Based on the details, the appointment event should be created/updated in the Google calendar. So there should be a sync to the Google Calendar for on the save of the Customer record.
The appointment details should be available in the following fields:
- Customer ID —> entityid
- Appointment Date/ Time —> custentity_jj_lead_appointment
- Address —> defaultaddress
- Sales Rep —> salesrep
- Phonenumber Home —> phone
- Email —> email
- Lead Source —> leadsource
- Sales Planner Sales Rep —> custentity_sales_planner
- Notes Lead —> custentityopmerkingen_lead_ilse
The mentioned netsuite field values should be sourced to the corresponding fields in the calendar event:
The sync from the Netsuite to the Google calendar will be triggered only if the mentioned netsuite field has values. If any of the fields doesn’t have values the sync won’t happen and the event will not be created.
We will not sync the Google Calendar for every save action of the customer. The sync will happen only if the event is not created for the customer or any of the mentioned fields has changed.
We will save the created Event id of the google calendar in a new field of the customer record.
If there is any change in the mentioned fields, then we will check the saved Event id present in the Google Calendar by sending a request with Event Id. If a corresponding event is not present in the Google Calendar then a new event will be created with the details available in the fields of the customer record. And if the calendar event is present for the event id , then that particular event will be updated with new changes in the Netsuite customer fields.
We will delete the event in the Google calendar, if no values are present in any of the mentioned customer fields.
So basically sync will happen on the create/edit action of the Customer record based on the field changes of the mentioned customer record fields.
Prerequisites :
- User-consent should be required for every save of the customer record for integrating with the Google calendar. While integration, if the user is trying to create Event appointments, reminder then the user has to enter the Google credentials every time to authenticate.So if we integrate the Google Calendar on every save of the customer record, the user consent should be required for the event creation. This won’t be appropriate for our requirement.
We can avoid user consenrviceaccount.comrviceaccount.com- In the Domain wide delegation pane, select Manage Domain Wide Delegation.
- Click Add new.
- In the Client ID field, enter the service account’s Client ID. You can find your service account’s client ID in the Service accounts page.
- In the OAuth scopes (comma-delimited) field, enter the list of scopes that your application should be granted access to. For example, if your application needs domain-wide full access to the Google Calendar API, enter: https://www.googleapis.com/auth/calendar.
- Click Authorize.
- We need Calendar Id of the Sales Rep to create the event creation for specifying the calendar.
Assumptions
- We need Calendar Id of the Sales Rep to create the event creation for specifying the calendar. So we need to store the Calendar Id in the sales rep record.
- We are assuming that the calendar Id of the Sales Rep will be the email of the Sales Rep.
- We will assume that if there are no values present in the fields of the customer record and an event is already created for the same customer record , then we will delete the Event from the Google Calendar.
- Since we are planning the one- way integration, there won’t be any sync from the Google Calendar to the Netsuite. Any changes in the Google calendar will not be reflected in the Netsuite.
- We are assuming that the company is using the G Suite domain and Sales Reps are using the G Suite accounts.
Total Efforts: 40hr