[
  {
    "apiName": "OrderItem",
    "keyPrefix": "802",
    "label": "Order Product",
    "tableType": "standard_object",
    "category": "crm",
    "sharingModel": "ControlledByParent",
    "enableHierarchySharing": false,
    "displayNameField": "Product2Id",
    "description": "Standard Salesforce Order Product \u2014 products on an order; record-level access cascades from Order.",
    "fields": [
      {
        "apiName": "OrderId",
        "label": "Order",
        "type": "reference",
        "required": true,
        "referenceTo": [
          "Order"
        ],
        "relationshipName": "Order",
        "childRelationshipName": "OrderItems"
      },
      {
        "apiName": "PricebookEntryId",
        "label": "Price Book Entry",
        "type": "reference",
        "referenceTo": [
          "PricebookEntry"
        ],
        "relationshipName": "PricebookEntry",
        "childRelationshipName": "OrderItems",
        "validator": "runtime_scoped_lookup",
        "validatorConfig": "{\"filterMappings\":[{\"recordField\":\"OrderId\",\"sourceField\":\"Pricebook2Id\",\"targetField\":\"Pricebook2Id\"}]}"
      },
      {
        "apiName": "Product2Id",
        "label": "Product",
        "type": "reference",
        "referenceTo": [
          "Product2"
        ],
        "relationshipName": "Product2"
      },
      {
        "apiName": "Quantity",
        "label": "Quantity",
        "type": "double",
        "required": true
      },
      {
        "apiName": "UnitPrice",
        "label": "Unit Price",
        "type": "currency",
        "required": true
      },
      {
        "apiName": "CurrencyIsoCode",
        "label": "Currency ISO Code",
        "type": "picklist",
        "default": "USD",
        "options": [
          {
            "label": "Chinese Yuan",
            "value": "CNY"
          },
          {
            "label": "Japanese Yen",
            "value": "JPY"
          },
          {
            "label": "Singapore Dollar",
            "value": "SGD"
          },
          {
            "label": "U.S. Dollar",
            "value": "USD"
          }
        ]
      },
      {
        "apiName": "ListPrice",
        "label": "List Price",
        "type": "currency",
        "createable": false,
        "updateable": false
      },
      {
        "apiName": "TotalPrice",
        "label": "Total Price",
        "type": "currency"
      },
      {
        "apiName": "Description",
        "label": "Description",
        "type": "textarea"
      },
      {
        "apiName": "ServiceDate",
        "label": "Start Date",
        "type": "date"
      },
      {
        "apiName": "EndDate",
        "label": "End Date",
        "type": "date"
      },
      {
        "apiName": "OriginalOrderItemId",
        "label": "Original Order Product",
        "type": "reference",
        "referenceTo": [
          "OrderItem"
        ],
        "relationshipName": "OriginalOrderItem",
        "childRelationshipName": "ChildOrderItems"
      },
      {
        "apiName": "Account__c",
        "type": "reference",
        "label": "Account",
        "referenceTo": [
          "Account"
        ],
        "relationshipName": "OrderItem"
      },
      {
        "apiName": "Discount__c",
        "type": "formula",
        "label": "Discount",
        "formula": "IF(OR(ListPrice-UnitPrice<0,UnitPrice<0),0,1-UnitPrice/ListPrice)",
        "returnType": "percent",
        "formulaMode": "active",
        "createable": false,
        "updateable": false
      },
      {
        "apiName": "OrderProduct__c",
        "type": "string",
        "label": "OrderProduct"
      },
      {
        "apiName": "Net_fees__c",
        "type": "currency",
        "label": "Net Fees"
      },
      {
        "apiName": "QuoteLineItemId",
        "type": "reference",
        "label": "QuoteLineItemId",
        "referenceTo": [
          "QuoteLineItem"
        ],
        "relationshipName": "QuoteLineItem"
      }
    ],
    "managedRelationships": [
      {
        "fieldApiName": "OrderId",
        "parentObject": "Order",
        "isSharingParent": true
      }
    ]
  }
]
