Set Up Baucore Opportunity Sync Service
This article covers setup for V1 (single Opportunity per Project). If you’re setting up Opportunity Management for a new org, use V2 instead — see Setup Options for Opportunity Management V2.
Even when users manage their projects through Opportunities, all Baucore processes and calculations run on a Project record behind the scenes. Baucore delivers a sync service to keep Opportunity and Project data in sync — for every Opportunity record, there is also a corresponding Project record.
Enable the Opportunity2Project Sync Service
Go to Setup → Custom Metadata Types → Baucore Settings → Manage Records → Edit → Enable Opportunity2Project Sync and set the value to true.
Set up the fields to sync
Before adding mappings, adapt the page layout to show the corresponding fields.
- Go to Setup → Custom Metadata Types → Baucore Sync Field Mapping → Edit on Page Layouts.
- Put these fields on the layout: Source Object, Source Field, Target Object, Target Field, Target Field Default Value, Target Field String, PicklistMapping, Reverse, Inactive.
- Go to Setup → Custom Metadata Types → Baucore Sync Field Mapping → Manage Records → New to create a mapping.
| Field | Description |
|---|---|
| Label | Any label as a string. |
| Custom Metadata Record Name | Any record name as a string. |
| Source Object | Select Project. |
| Source Field | Select the Project field to map from. |
| Target Object | Select Opportunity. |
| Target Field | Select the Opportunity field to map to. |
| Target Field Default Value | Default value used if the target field is empty. |
| Target Field String | If Target Field is a compound field, enter the actual field name here. |
| PicklistMapping | If the field is a picklist that needs value mapping, set to true and provide the mapping in Baucore Sync Picklist Mapping. |
| Reverse | The mapping is done from Opportunity to Project instead. |
| Inactive | Marks the mapping as inactive. |
Picklist mapping
Use Baucore Sync Picklist Mapping to map picklist values used in the Opportunity2Project sync.
- Go to Setup → Custom Metadata Types → Baucore Sync Picklist Mapping → Edit on Page Layouts, and put these fields on the layout: Picklist Source Value, Picklist Target Value, Sync Field Mapping, Inactive.
- Go to Setup → Custom Metadata Types → Baucore Sync Picklist Mapping → Manage Records → New to create a mapping.
| Field | Description |
|---|---|
| Label | Any label as a string. |
| Baucore Sync Picklist Mapping Name | Any name as a string. |
| Picklist Source Value | API name of the picklist value on the source field. |
| Picklist Target Value | API name of the picklist value on the target field. |
| Sync Field Mapping | The Baucore Field Mapping record this mapping applies to. |
| Inactive | Marks the mapping as inactive. |
Create the batch job
- Go to Setup → Apex Classes → Schedule Apex Class.
- Enter Sync opportunities as the job name.
- Select syncProject_Schedule as the Apex class.
- Choose the execution frequency and click Save.
Relevant fields for the sync process
| Object | Field API name |
|---|---|
| Project | ibsbaucore__Opportunity__c |
| Participants | ibsbaucore__Opportunity__c |
| Opportunities | ibsbaucore__Bauobjekt__c, ibsbaucore__Sync_Last_Date__c, ibsbaucore__Sync_Status__c, ibsbaucore__TriggerSync__c |
| Contact Role | ibsbaucore__Bauobjekt__c, ibsbaucore__Beteiligte__c, ibsbaucore__Sync_Last_Date__c, ibsbaucore__Sync_Status__c, ibsbaucore__TriggerSync__c |
Synchronization settings
Under Setup → Custom Metadata Types → Baucore Sync Setting → Manage Baucore Sync Settings:
| Setting | Description |
|---|---|
| Stop Sync | If set to true, all background sync processes stop. |
| Sync Batch Size | The size of the batches processed at once. |
Field mapping: Project Lead → Opportunity
The mapping settings for Project Closed on and Project Project Phase require manual setup before use.
Project Phase
No default picklist mapping is delivered for Project Phase — set this up manually.
Project Closed on
Since an Opportunity record needs a “Closed On” date to be created, but that date isn’t known on the Project until later, set a default value to automatically date the Opportunity a certain time in the future. Enter a number in Target Field Default Value — the number of months the date is moved forward from the current date.
Error notifications
Custom notifications can be shown and/or emailed if an error occurs during this process.
- In-app notifications: go to Setup → Custom Metadata Types → Baucore Sync Setting → Manage Baucore Sync Settings → Custom Notification. Set Value to true to enable, false to disable.
- Email notifications: same path, but the Email Notification record. Set Value to true to enable, false to disable.
- The notification and email titles are configured through the custom labels
sync_service_error_notification_titleandsync_service_error_notification_message. Go to Setup → Custom Labels, open the label, and add the translation for the desired language.
If an error occurs during this process, it’s stored on the Sync_Error__c field on both the Project and Opportunity records. This field isn’t on either page layout by default, but an administrator can add it.