1
votes

Using Acumatica 17.210.0034 and API endpoint 17.200.001, I'm doing a PUT including custom fields, but the custom field values are not being set in the db. Any help would be appreciated. The same thing happens with an insert and an update. The data is added, but the custom field values are not set.

PUT url:

http://localhost/acuroyalbay172100034/entity/Default/17.200.001/StockItem?%24custom=InventoryItemExt.UsrSquareFTG%2cInventoryItemExt.UsrDispPerPallet%2cInventoryItemExtension.UsrItemClassCD%2cInventoryItemAMExtension.AMReplenishmentSource%2cInventoryItemAMExtension.AMLotSize%2cInventoryItemAMExtension.AMMaxOrdQty%2cInventoryItemAMExtension.AMMinOrdQty%2cInventoryItemAMExtension.AMLowLevel%2cInventoryItemAMExtension.AMMRPItem%2cInventoryItemAMExtension.AMMFGLeadTime%2cInventoryItemAMExtension.AMGroupWindow%2cInventoryItemAMExtension.AMConfigurationID%2cInventoryItemAMExtension.AMReplenishmentSourceOverride%2cInventoryItemAMExtension.AMSafetyStockOverride%2cInventoryItemAMExtension.AMSafetyStock%2cInventoryItemAMExtension.AMMinQtyOverride%2cInventoryItemAMExtension.AMMinQty%2cInventoryItemAMExtension.AMQtyRoundUp

Request Body:

{
  "AverageCost": {
    "value": 0.0
  },
  "BaseUOM": {
    "value": "EA"
  },
  "COGSAccount": {
    "value": "50000"
  },
  "COGSSubaccount": {
    "value": "CON000"
  },
  "CurrentStdCost": {
    "value": 0.0
  },
  "DefaultIssueLocationID": {
    "value": "R1S1"
  },
  "DefaultPrice": {
    "value": 0.0
  },
  "DefaultReceiptLocationID": {
    "value": "RECEIVING"
  },
  "DefaultWarehouseID": {
    "value": "WHOLESALE"
  },
  "Description": {
    "value": "tonyitem153"
  },
  "DimensionVolume": {
    "value": 0.0
  },
  "DimensionWeight": {
    "value": 0.0
  },
  "InventoryAccount": {
    "value": "12100"
  },
  "InventoryID": {
    "value": "RGTONYIT153"
  },
  "InventorySubaccount": {
    "value": "CON000"
  },
  "IsAKit": {
    "value": false
  },
  "ItemClass": {
    "value": "CONSUMER  200FITNESS"
  },
  "ItemStatus": {
    "value": "Active"
  },
  "ItemType": {
    "value": "Finished Good"
  },
  "LandedCostVarianceAccount": {
    "value": "52400"
  },
  "LandedCostVarianceSubaccount": {
    "value": "CON000"
  },
  "LastCost": {
    "value": 0.0
  },
  "LastModified": {
    "value": "2018-09-11T12:36:15.483-04:00"
  },
  "LastStdCost": {
    "value": 0.0
  },
  "LotSerialClass": {
    "value": "NOTTRACKED"
  },
  "Markup": {
    "value": 0.0
  },
  "MaxCost": {
    "value": 0.0
  },
  "MinCost": {
    "value": 0.0
  },
  "MinMarkup": {
    "value": 0.0
  },
  "MSRP": {
    "value": 0.0
  },
  "PackagingOption": {
    "value": "Manual"
  },
  "PackSeparately": {
    "value": false
  },
  "PendingStdCost": {
    "value": 0.0
  },
  "POAccrualAccount": {
    "value": "20100"
  },
  "POAccrualSubaccount": {
    "value": "CON000"
  },
  "PostingClass": {
    "value": "CON"
  },
  "PurchasePriceVarianceAccount": {
    "value": "52300"
  },
  "PurchasePriceVarianceSubaccount": {
    "value": "CON000"
  },
  "PurchaseUOM": {
    "value": "EA"
  },
  "ReasonCodeSubaccount": {
    "value": "CON000"
  },
  "SalesAccount": {
    "value": "40000"
  },
  "SalesSubaccount": {
    "value": "CON000"
  },
  "SalesUOM": {
    "value": "EA"
  },
  "StandardCostRevaluationAccount": {
    "value": "52110"
  },
  "StandardCostRevaluationSubaccount": {
    "value": "CON000"
  },
  "StandardCostVarianceAccount": {
    "value": "52100"
  },
  "StandardCostVarianceSubaccount": {
    "value": "CON000"
  },
  "SubjectToCommission": {
    "value": false
  },
  "TaxCategory": {
    "value": "TAXABLE"
  },
  "ValuationMethod": {
    "value": "Average"
  },
  "custom": {
    "InventoryItemExt": {
      "UsrSquareFTG": {
        "type": "CustomDecimalField",
        "value": 5.0
      },
      "UsrDispPerPallet": {
        "type": "CustomIntField",
        "value": 6
      }
    },
    "InventoryItemExtension": {
      "UsrItemClassCD": {
        "type": "CustomStringField",
        "value": "CONSUMER  200FITNESS"
      }
    },
    "InventoryItemAMExtension": {
      "AMReplenishmentSource": {
        "type": "CustomStringField",
        "value": "Purchase"
      },
      "AMLotSize": {
        "type": "CustomDecimalField",
        "value": 0.0
      },
      "AMMaxOrdQty": {
        "type": "CustomDecimalField",
        "value": 0.0
      },
      "AMMinOrdQty": {
        "type": "CustomDecimalField",
        "value": 0.0
      },
      "AMLowLevel": {
        "type": "CustomIntField",
        "value": 0
      },
      "AMMRPItem": {
        "type": "CustomBooleanField",
        "value": true
      },
      "AMMFGLeadTime": {
        "type": "CustomIntField",
        "value": 0
      },
      "AMGroupWindow": {
        "type": "CustomIntField",
        "value": 0
      },
      "AMConfigurationID": {
        "type": "CustomStringField"
      },
      "AMReplenishmentSourceOverride": {
        "type": "CustomBooleanField",
        "value": false
      },
      "AMSafetyStockOverride": {
        "type": "CustomBooleanField",
        "value": false
      },
      "AMSafetyStock": {
        "type": "CustomDecimalField",
        "value": 0.0
      },
      "AMMinQtyOverride": {
        "type": "CustomBooleanField",
        "value": false
      },
      "AMMinQty": {
        "type": "CustomDecimalField",
        "value": 0.0
      },
      "AMQtyRoundUp": {
        "type": "CustomBooleanField",
        "value": false
      }
    }
  }
}

Response:

{
    "id": "2299727f-c471-46de-a8ac-9dcfe1a2a09f",
    "rowNumber": 1,
    "note": null,
    "ABCCode": {},
    "AutoIncrementalValue": {},
    "AverageCost": {
        "value": 0
    },
    "BaseUOM": {
        "value": "EA"
    },
    "COGSAccount": {
        "value": "50000"
    },
    "COGSSubaccount": {
        "value": "CON000"
    },
    "Content": {},
    "CurrentStdCost": {
        "value": 0
    },
    "DefaultIssueLocationID": {
        "value": "R1S1"
    },
    "DefaultPrice": {
        "value": 0
    },
    "DefaultReceiptLocationID": {
        "value": "RECEIVING"
    },
    "DefaultWarehouseID": {
        "value": "WHOLESALE"
    },
    "DeferralAccount": {},
    "DeferralSubaccount": {},
    "Description": {
        "value": "tonyitem153"
    },
    "DimensionVolume": {
        "value": 0
    },
    "DimensionWeight": {
        "value": 0
    },
    "DiscountAccount": {},
    "DiscountSubaccount": {},
    "ImageUrl": {},
    "InventoryAccount": {
        "value": "12100"
    },
    "InventoryID": {
        "value": "RGTONYIT153"
    },
    "InventorySubaccount": {
        "value": "CON000"
    },
    "IsAKit": {
        "value": false
    },
    "ItemClass": {
        "value": "CONSUMER  200FITNESS"
    },
    "ItemStatus": {
        "value": "Active"
    },
    "ItemType": {
        "value": "Finished Good"
    },
    "LandedCostVarianceAccount": {
        "value": "52400"
    },
    "LandedCostVarianceSubaccount": {
        "value": "CON000"
    },
    "LastCost": {
        "value": 0
    },
    "LastModified": {
        "value": "2018-09-11T12:56:47.843-04:00"
    },
    "LastStdCost": {
        "value": 0
    },
    "LotSerialClass": {
        "value": "NOTTRACKED"
    },
    "Markup": {
        "value": 0
    },
    "MaxCost": {
        "value": 0
    },
    "MinCost": {
        "value": 0
    },
    "MinMarkup": {
        "value": 0
    },
    "MSRP": {
        "value": 0
    },
    "PackagingOption": {
        "value": "Manual"
    },
    "PackSeparately": {
        "value": false
    },
    "PendingStdCost": {
        "value": 0
    },
    "POAccrualAccount": {
        "value": "20100"
    },
    "POAccrualSubaccount": {
        "value": "CON000"
    },
    "PostingClass": {
        "value": "CON"
    },
    "PriceClass": {},
    "PriceManager": {},
    "PriceWorkgroup": {},
    "ProductManager": {},
    "ProductWorkgroup": {},
    "PurchasePriceVarianceAccount": {
        "value": "52300"
    },
    "PurchasePriceVarianceSubaccount": {
        "value": "CON000"
    },
    "PurchaseUOM": {
        "value": "EA"
    },
    "ReasonCodeSubaccount": {
        "value": "CON000"
    },
    "SalesAccount": {
        "value": "40000"
    },
    "SalesSubaccount": {
        "value": "CON000"
    },
    "SalesUOM": {
        "value": "EA"
    },
    "StandardCostRevaluationAccount": {
        "value": "52110"
    },
    "StandardCostRevaluationSubaccount": {
        "value": "CON000"
    },
    "StandardCostVarianceAccount": {
        "value": "52100"
    },
    "StandardCostVarianceSubaccount": {
        "value": "CON000"
    },
    "SubjectToCommission": {
        "value": false
    },
    "TaxCategory": {
        "value": "TAXABLE"
    },
    "ValuationMethod": {
        "value": "Average"
    },
    "VolumeUOM": {},
    "WeightUOM": {},
    "custom": {
        "InventoryItemExt": {
            "UsrSquareFTG": {
                "type": "CustomDecimalField",
                "value": null
            },
            "UsrDispPerPallet": {
                "type": "CustomIntField",
                "value": null
            }
        },
        "InventoryItemExtension": {
            "UsrItemClassCD": {
                "type": "CustomStringField",
                "value": null
            }
        },
        "InventoryItemAMExtension": {
            "AMReplenishmentSource": {
                "type": "CustomStringField",
                "value": "Purchase"
            },
            "AMLotSize": {
                "type": "CustomDecimalField",
                "value": 0
            },
            "AMMaxOrdQty": {
                "type": "CustomDecimalField",
                "value": 0
            },
            "AMMinOrdQty": {
                "type": "CustomDecimalField",
                "value": 0
            },
            "AMLowLevel": {
                "type": "CustomIntField",
                "value": 0
            },
            "AMMRPItem": {
                "type": "CustomBooleanField",
                "value": true
            },
            "AMMFGLeadTime": {
                "type": "CustomIntField",
                "value": 0
            },
            "AMGroupWindow": {
                "type": "CustomIntField",
                "value": 0
            },
            "AMConfigurationID": {
                "type": "CustomStringField",
                "value": null
            },
            "AMReplenishmentSourceOverride": {
                "type": "CustomBooleanField",
                "value": false
            },
            "AMSafetyStockOverride": {
                "type": "CustomBooleanField",
                "value": false
            },
            "AMSafetyStock": {
                "type": "CustomDecimalField",
                "value": 0
            },
            "AMMinQtyOverride": {
                "type": "CustomBooleanField",
                "value": false
            },
            "AMMinQty": {
                "type": "CustomDecimalField",
                "value": 0
            },
            "AMQtyRoundUp": {
                "type": "CustomBooleanField",
                "value": false
            }
        }
    },
    "files": []
}
3

3 Answers

2
votes

Normally the custom key word is part of the Parameter for retrieving record as shown in this help article.

If you want to set values to these field then you will need to add the field to the endpoint first.

Here are some link on how to create an extended endpoint:

Custom Endpoints and Endpoint Extensions

Custom Fields

1
votes

It appears that the answer is that you have to extend an endpoint in order to update data with a PUT. Using the GET data structure which includes custom fields as a collection doesn't work.

0
votes

The problem of your request body is here:

"custom": {
  "InventoryItemExt": {
    "UsrSquareFTG": {
      "type": "CustomDecimalField",
      "value": 5.0
    },
    "UsrDispPerPallet": {
      "type": "CustomIntField",
      "value": 6
    }
  },
 ...
 }

Custom fields collection should have another format and key.

To get correct json schema of entity with its custom fields you can use get request to address http://localhost/acuroyalbay172100034/entity/Default/17.200.001/StockItem/$adHocSchema

it will returns you json that includes custom fields. You can use it as template for your request bodies. see also Help