Step 2: Creating Classes for MYOB Acumatica Entities
You need to create classes for the MYOB Acumatica entities to be synchronized with the external system through the connector. For details about the classes, see Classes for MYOB Acumatica Entities.
1. Identifying the MYOB Acumatica Entities to Be Used
- On the Web Service Endpoints (SM207060) form, open the
eCommerce/20.200.001 endpoint and identify the entities and their
fields that you need to use, including the key fields. For example, for the
Case
entity, you may need to use theCaseID
,Subject
,Description
, NoteID, andLastModifiedDateTime
fields. - Identify the default classes for MYOB Acumatica entities (which are available in the PX.Commerce.Core.API
namespace) that you can use in your connector. Note: If the default classes are enough for your implementation, skip the instructions in the following section.
For the WooCommerce connector in this example, you will use the default Customer entity.
2. Creating Classes for MYOB Acumatica Entities
- If you need to implement your own classes for MYOB Acumatica entities, in the Visual Studio project of the extension library, create a
class with the name of an MYOB Acumatica entity that you want to process in the connector. In this example, you are
creating the
Case
class. Make sure that you have done the following:- Defined only the properties that correspond to the fields of the contract-based API entity that you identified on the Web Service Endpoints form, including the key fields. The names of the properties must be the same as the names of the fields.
- Assigned the Description attributes to the class and its properties, as shown in the following code. The names that are specified in these attributes will be used as the names of the MYOB Acumatica objects and fields on the mapping and filtering tabs of the Entities (BC202000) form.
Tip: You can see this code on GitHub.using PX.Commerce.Core.API; using PX.Api.ContractBased.Models; using PX.Commerce.Core; [CommerceDescription("Case")] public partial class Case : CBAPIEntity { public GuidValue NoteID { get; set; } public DateTimeValue LastModifiedDateTime { get; set; } [CommerceDescription("CaseCD")] public StringValue CaseCD { get; set; } [CommerceDescription("Subject")] public StringValue Subject { get; set; } [CommerceDescription("Description")] public StringValue Description { get; set; } }
- Repeat the previous instruction for each MYOB Acumatica entity that you need to use in your connector.
- Build the project.