Discovery and Synchronization
Discovery and Synchronization is the process of identifying what the backend is capable of and the data(s) structure/shapes. Once discovered, the process of downloading data such as all products and appointments within data range starts.
Discovery
The first time a user signs into the app, the backend is queried to get the following settings. This process can manually be triggered again by going to Settings > User Preferences > Reload Company Settings
- Figure out what connector (MarketSharp, Salesforce) and adapter (i360 Classic and i360 Lightning) to use
- Get version of API
- Get Current User
- Get schema, shape of the data
- Appointments
- Attachments
- Documents
- Events
- Marketing Opportunities
- Notes
- Products
- Projects
- Project Activities
- Prospects (Contacts)
- Quotes
- Quote Items
- Quote Templates
- Receipts and Adjustments
- Sales
- Sale Items
- Staff
- Tasks
- Get API limits, other information about the API being consumed (requests used today/total requests allowed)
- Get Custom Settings applied to current user
Once the discovery is complete, the synchronization process begins
Synchronization
For offline mode support, data needs to downloaded (all fields for entity and sub queries) during full data sync and ad hoc entity refreshes.
- When the app has been in the background for 10 minutes or longer, next time the user brings the app to the foreground, the synchronization process will run to refresh the users information.
- i360 Custom Objects are queried based on the Staff Record lookup. Salesforce native/standard objects are queried by the User field.
- All date ranges are days in the past and future. Thus if range is 90, it gets 90 days in the past and 90 days in the future.
MarketSharp
Discovery
- Get company information (timezone and company tax rate)
- Get current user (display name, username, and profile picture)
- Get drop down options
- Get schema, shape of the data
- Appointments
- Attachments
- Company
- Contacts
- Employee
- Jobs
- Payments (Job Financials)
- Quotes
- Quote Items
Synchronization
- Get appointments by date range (defaults to
90
days) - Get activities by due date range (defaults to
90
days) - Get Contacts related to the appointments retrieved
- Get Calendar Events by date range (defaults to
90
days) - Geocodes inquiry addresses that do not have a lat/long
- Get all products
- Get all quote templates
- Get all Proposals
- Get all employees
For offline mode support, data needs to downloaded (all fields for entity and sub queries) during full data sync and ad hoc entity refreshes.
- Current user profile picture is pulled in upon login.
- If the user switches profile picture, the user will need to log out and log back in in order to see the new uploaded profile picture.
- All date ranges are days in the past and future. Thus if range is 90, it gets all appointments 90 days in the past and 90 days in the future.
- Download all appointments in date range assigned to the Sales Rep
- Date range is using the defaults to
90
days - Appointments do not have an end date/time. Only a start date/time.
- Displays current user appointments for today
- Date range is using the defaults to
- The contacts with appointments in the date range of
90
days are downloaded - Company timezone and company tax rate is set in General Setup in admin
- Appointment dates/times do not shift if the user is in a different timezone than the company set.
Salesforce Classic and Lightning
- Get current Salesforce API version (current version minus 1). i.e. If users for is currently on version 50, use version 49. This is so the user is using an up to date version but not cutting edge.
- Determine if user is a Salesforce Classic or Lightning user by seeing what objects are available
- Get the current signed in user profile information
- Get the Organizations API Limits
- Get the user Page Layouts for all required objects and any necessary Custom Settings.
- Completes the data sync base on what type of user is signed into. See sections below for more details
- Cleans up any old data (i.e. Appointments no longer assigned to the sales rep)
Salesforce Classic
- Download all appointments in date range assigned to the Sales Rep
- Date range based on:
i360__Public_System_Settings__c.i360__Mobile_Appointments_Days_Back__c
or defaults to365
days - Appointments must have a Start Time set. If only the Start Date and Duration are set, the Computed Start Time cannot be calculated and will not show up in the mobile app (Invalid Date Times can't be queried).
- Date range based on:
- Download all Prospects based on appointments in the date range
- Attachments for the prospects
- Gets all Marketing Opportunities and Lead Sources if they are in the Page Layout under Related Lists
- Download all prospect details for appointments
- Download all Project Activities assigned to the current staff record
- Date range based on:
i360__Public_System_Settings__c.i360__Mobile_Project_Activities_Days_Back__c
or defaults to365
days - Note: May eventually download Project Activities related to the Sales Rep
- Date range based on:
- Based on Project Activities downloaded, get all related Projects for the needed Project Activities.
- Download all tasks that are:
- Assigned to the current user,
OwnerId
/Assigned To
field AND - That have a due date +/- days user preference OR that is not "Completed" status, where its due date is not set
- Date range based on:
i360__Public_System_Settings__c.i360__Mobile_Tasks_Days_Back__c
or defaults to365
days
- Assigned to the current user,
- Download Salesforce Standard Events
- Gets events based on OwnerId field but date range.
- Date range based on:
i360__Public_System_Settings__c.i360__Mobile_Tasks_Days_Back__c
or defaults to365
days
- Download all staff that are
Active
- Download all Products that are
Active
- Download all Quote Templates and Quote Template Items
- Total number of supported quote template items: 200 (happens via sub-select on Quote Templates)
- Attachments should be downloaded only once and cached
- Downloads attachments for Appointments
- Documents
- Files in Folder Named
- Mobile Docs
- Templates-Quote
- Templates-Sale
- Files Named
- CompanyLogo.jpg
- Note: the file name must be an exact match in order to have company logo downloaded and displayed in mobile app
- CompanyLogo.jpg
- Files in Folder Named
Salesforce Lightning
- Get all Sales Appointments assigned to Sales Rep 1 or Sales Rep 2 whose Appointment_Date_Time__c is +/-
365
days from today.- Gets related Contacts for the Sales Appointments
- Gets related Sales Opportunities for Sales Appointments
- Get all Salesforce Standard Tasks that match all of the following conditions.
- OwnerId is current signed in user
- ActivityDate is +/-
365
days from today. - Status is not `Completed`
- Get all Salesforce Standard Events
- Gets events based on OwnerId field by date range
365
days from today.
- Gets events based on OwnerId field by date range
- Download all Project Activities assigned to the current staff record
- Date range based on:
i360__Public_System_Settings__c.i360__Mobile_Project_Activities_Days_Back__c
or defaults to365
days - Note: May eventually download Project Activities related to the Sales Rep
- Date range based on:
- Download all staff that are
Active
- Download all Products that are
Active
- Download all Quote Templates and Quote Template Items
- Total number of supported quote template items: 200 (happens via sub-select on Quote Templates)
- Attachments should be downloaded only once and cached
- Downloads attachments for Appointments
- Documents
- Files in Folder Named
- Mobile Docs
- Templates-Quote
- Templates-Sale
- Files Named
- CompanyLogo.jpg
- Note: the file name must be an exact match in order to have company logo downloaded and displayed in mobile app
- CompanyLogo.jpg
- Files in Folder Named