Start a new topic

Updating the value for a UDF (user defined field)

Starting with Spire 3.2, it i now possible to update values in existing UDF fields using the Spire API.   This extends the ability to modify existing values in Spire records, to UDF fields created by a third party.


To update the UDF value of an existing item, visit the items end point (based on it's id);

 

https://localhost:10880/api/v2/companies/SuperCo/inventory/items/1							 



...and performs a PUT, submitting the following JSON;


{"id":1,"udf":{"altdescription":"WIDGET-XYZ"}}

 

The JSON indicates the id of the item to be updated, the fieldname of the UDF field to be updated (altdescription), and the value to be updated in the field (WIDGET-XYZ).


When adding a new part number, a UDF field values can also be provided.  To add a new inventory item.   To add a new inventory item, use the inventory collection.

 

https://localhost:10880/api/v2/companies/SuperCo/inventory/items/ 

 Perform a POST, using the following JSON.


 

{"partNo":"FR-27-B","description":"High frequency radio","pricing":{"EA":{"sellPrices":["10","9"]}},"currentCost":"1.00","udf":{"altdescription":"Hi-Fi Radio"}}

 This creates a new item, with the UDF value provided as part of the item creation.


image







2 people like this idea
Login or Signup to post a comment