---
title: "Object: Object Mapping"
canonical: "https://help.fieldbuddy.com/space/FBDOCS/2078310804/Object%3A%20Object%20Mapping"
format: markdown
---
Object Mapping is an custom object, that stores information about what is synchronised and in which direction on entity level 

| Fields | Description |
| --- | --- |
| Object Mapping Name | Name field, if created via Map |
| Description |  |
| Service Provider | Link to [Service Provider](https://upperdeck.atlassian.net/wiki/spaces/FBDOCS/pages/2078310877) |
| Language | Allows to specify Language in case if external service supports it |
| Record Type |  |
| Sync Direction |  |
| Operation Type | 1. Insert: the data retrieved from the external system will be inserted into Salesforce. In case of a duplicate, the system will error.
2. Update: the data retrieved from the external system will be updated in case there's a match (based on External Id), no match results in no update
3. : the data retrieved from the external system will be updated and if no match is found (based on External Id), an insert is done. |
| Execution Order |  |
| Maximum Page Requests | The number of **requests** are performed in one batch job to external service.<br>> ℹ️ For example, if objects per page is set to to 25 records, and Maximum Page Request is set to 1000000, then SF will not be able to fetch more hant 25 millions of records from external server. That has been done to add some "stop" action during testing as part of development (aka fetch only 500-600 records, and not entire dataset). In real world, it should be very high number, to ensure that entire table is synced into salesforce |
| Object Per Page Request | The number of **records** are returned via single callout to external service. Objects per page requests mean how much records will be **requested** from external endpoint.<br>> ℹ️ For example, there are 1000 records. If Objects per page is set to 25  and batch size is set to 5, then it will do 40 requests (callouts) to external server, obtain all records , and start inserting them in chunks by 5 records. That will spawn a batch job with 200 chunks. |
| Batch Size | The number of **records** are processed (inserted in SF) in execution of batch job after those are queried from external endpoint.Batch size means number of records that will be **inserted in salesforce** in single statement |
| Filter Criteria | 1. In case of inbound, use SOQL filtering (more about it - [https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_conditionexpression.htm](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_conditionexpression.htm) )
2. In case of outbound, use: oData. See EON rest documentation reference: [https://start.exactonline.nl/docs/HlpRestAPIResources.aspx?SourceAction=10](https://start.exactonline.nl/docs/HlpRestAPIResources.aspx?SourceAction=10) |
| Salesforce-side Filter Criteria | For Inbound Sync Direction, internal filters can be applied by creating a formula field style filter criteria with Boolean return type. Records NOT matching the criteria are excluded from sync. |
| Is Active | Determines if it is active. If not  - Inbound Scheduled sync will not sync the object, and Outbound sync will not trigger on respective |
| Last Successful Sync Date Time |  |
| Use Last Successful Sync DateTime | When synchronising an Object Mapping via Service Provider for the second time it adds a filter with the created time and the modified time.You can view this filter when you open the Audit Trail in the field 'Request Param':<br>```
$filter=(Created gt DateTime'2016-03-25T16:18:23' or Modified gt DateTime'2016-03-25T16:18:23')
```<br>Some objects of Service Providers (for example some Exact Online Objects) do not have fields Created Time or Modified Time available. Therefore, it is possible to enable or disable this filter per Object Mapping. By selecting TRUE, the admin is enabling the filter. |
| Project Object Mapping | Lookup to Object Mapping to indicate that the current Object Mapping is a child of another Object Mapping.<br>E.g. Object Mappings for objects Work Order and Work Order Line Item. The Work Order Object Mapping is the parent and the Work Order Line Mapping Object Mapping is the child by filling the Parent object mapping field with a lookup to the Work Order Object Mapping. |
| Is Required | Used for outbound sync only,  when the current Object Mapping has a parent (see Parent object mapping).<br>When this checkbox is checked, it is required that the parent record has a child. Otherwise the records are not synchronized.<br>For example, when outbound sync is configured for objects **Work Order** and **Work Order Line Item**. Work Order is the parent and **Work Order Line Item** is the child. If the checkbox is checked on the Work Order Part Object Mapping, it is required that the **Work Order** has a **Work Order Line Item**. If the Work Order does not have a Work Order Line Item that is matching, it is not synchronised. |
| Internal Object | For parent object mapping - API name of sObject that is being synchronised (like Account, or FIELDBUDDY__Work_Order__c)<br>For child object mapping for outbound sync for exact online and another providers - relationship field (API name, so Contacts or FIELDBUDDY__Work_Order_Line_Items__r) of the record that is related to the object in sync for parent object mapping |
| Internal Field for External ID | Internal field in which the ID of the external field is stored. This field should be created on the Salesforce object. E.g: External_Id__c. |
| Last Sync DateTime API | Field that is used to save the DateTime of the last successful sync (should be a DateTime type of field). This field should be created on the Salesforce object |
| Sync Check API | Field that is used to indicate whether a record has been synced (should be a checkbox field type).  
This field should be created on the Salesforce object. |
| External Object |  |
| External ID Field |  |
| Endpoint URI | E.g. . When you are logged into Exact Online, you can also get the url from [https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?id=9](https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?id=9). |
| Extension Classes | an Apex Class name that implements a callable interface that can apply custom actions on the retrieved data<br>works only for inbound sync<br>Example of apex class:<br>```
global class cls_FlexConnect_Inbound_Filter implements Callable {
    global Object call(String action, Map<String, Object> args) {
        Map<String,Object> response = new Map<String, Object>();
        switch on action {
            when 'applyInboundCustomProcessing' {
                List<SObject> records =  this.applyInboundCustomProcessing(
                        (List<sObject>)args.get('parsedRecords'),
                        (FBCONNECT__Object_Mapping__c)args.get('objectMapping'),
                        (List<FBCONNECT__Field_Mapping__c>) args.get('fieldMappings'),
                        (HttpResponse) args.get('rawResponse')
                );
                response.put('parsedRecords', records);
                return response;
            }
            when else {
                return null;
            }
        }
    }

    public List<sObject> applyInboundCustomProcessing(List<sObject> parsed_records, FBCONNECT__Object_Mapping__c current_object_mapping, List<FBCONNECT__Field_Mapping__c> field_mappings, HttpResponse rawResponse) {
        // Apply any filtering here if needed
        return parsed_records;
    }

}
``` |
| Queueable Job Delay | Delay (in minutes) before the queueable job dispatched during **outbound** sync is executed. Number field, whole minutes only, accepted range **1–10**.<br>When left blank, the job is enqueued immediately with no delay. Values are capped between 0 and 10 minutes. Applies to the outbound queueable jobs for the relevant providers. |