Field Service

Get Involved. Join the Conversation.

Topic

    Wagner De Magalhães Cunha
    Empty fields value creating new resource inventory
    Topic posted July 13, 2018 by Wagner De Magalhães Cunha, last edited July 13, 2018, tagged API / Integration, Inventory / Parts 
    57 Views, 3 Comments
    Title:
    Empty fields value creating new resource inventory
    Content:

    Hello, 

    We are trying to create new Resource Inventory using the API REST, but when we send the data, the fields Quantity, InventoryType, Inventory model (Custom field) are shown as empty on TOA Resource Inventory interface.

    We are following the documentation:

    https://docs.oracle.com/cloud/august2017/fieldservicecs_gs/CXFSC/op-rest-ofscCore-v1-resources-%7BresourceId%7D-inventories-post.html

    A new register containing the resource inventory is created to the Resource, but the quantity field only shows the value: 1, different of the original sent value, the other fields empty.

    Someone can help?
    Thanks in advance

    Comment

     

    • Zsolt Tolgyesi

      Hi Wagner,

      Just some tips:
      - quantity reason can be if the equipment is serialized;
      - first try to add the same equipment on Manage for a Resource, maybe some equipment configuration is missing.
      Newest documentation can be found https://docs.oracle.com/en/cloud/saas/field-service/18b/cxfsc/op-rest-ofsccore-v1-resources-resourceid-inventories-post.html

      Regards,
      Zsolt

    • Hardik Gupta

      Hi Wagner,

       

      I think you might be making a small mistake somewhere in your request.

      Please try the following request. I have just tried and it is working correctly.

      POST:: https://api.etadirect.com/rest/ofscCore/v1/resources/1101/inventories
       
      1101 - Resource Id
      {
       
      "inventoryType": "cables",
      "status":"resource",
      "quantity": 3
      }
       
      The above is Non-serialized inventory.
       
      Response:: 
      {
          "inventoryId": 2,
          "status": "resource",
          "inventoryType": "cables",
          "quantity": 3,
          "resourceId": "1101",
          "resourceInternalId": 4,
          "links": [
              {
                  "rel": "canonical",
                  "href": "https://api.etadirect.com/rest/ofscCore/v1/inventories/2"
              },
              {
                  "rel": "describedby",
                  "href": "https://api.etadirect.com/rest/ofscCore/v1/metadata-catalog/inventories"
              }
          ]
      }
      Regards,
      Hardik
    • Dima Buldakov

      Regarding the quantity - quantity other then 1 is only available for "non-serialized" inventory. Please make sure that you have resource type properly configured.

      Also, general recommendation - create inventory manually and use Get resource inventories to read the inventory form OFSC. The response to the get call will provide a good idea what would be a proper payload for "Create Inventory".

      BTW What is "TOA Resource Inventory interface"?