[Vtigercrm-developers] Creating Inventory records via Webservice

Alan Lord alanslists at gmail.com
Tue Oct 6 12:39:40 GMT 2020


Try calling vtsw_describe for both the Inventory module you are creating 
AND for the "LineItem" module ;-)

It will show you which fields are mandatory etc:...

> vtws_describe for LineItem
> Array
> (
>     [label] => LineItem
>     [name] => LineItem
>     [createable] => 1
>     [updateable] => 1
>     [deleteable] => 1
>     [retrieveable] => 1
>     [fields] => Array
>         (
>             [0] => Array
>                 (
>                     [name] => parent_id
>                     [label] => parent id
>                     [mandatory] => 
>                     [type] => Array
>                         (
>                             [refersTo] => Array
>                                 (
>                                     [0] => Invoice
>                                     [1] => Quotes
>                                     [2] => PurchaseOrder
>                                     [3] => SalesOrder
>                                 )
> 
>                             [name] => reference
>                         )
> 
>                     [nullable] => 1
>                     [editable] => 1
>                 )
> 
>             [1] => Array
>                 (
>                     [name] => productid
>                     [label] => productid
>                     [mandatory] => 1
>                     [type] => Array
>                         (
>                             [refersTo] => Array
>                                 (
>                                     [0] => Products
>                                     [1] => Services
>                                 )
> 
>                             [name] => reference
>                         )
> 
>                     [nullable] => 1
>                     [editable] => 1
>                 )
> 
>             [2] => Array
>                 (
>                     [name] => sequence_no
>                     [label] => sequence no
>                     [mandatory] => 
>                     [type] => Array
>                         (
>                             [name] => integer
>                         )
> 
>                     [nullable] => 1
>                     [editable] => 1
>                 )
> 
>             [3] => Array
>                 (
>                     [name] => quantity
>                     [label] => quantity
>                     [mandatory] => 1
>                     [type] => Array
>                         (
>                             [name] => double
>                         )
> 
>                     [nullable] => 1
>                     [editable] => 1
>                 )
> 
>             [4] => Array
>                 (
>                     [name] => listprice
>                     [label] => listprice
>                     [mandatory] => 
>                     [type] => Array
>                         (
>                             [name] => double
>                         )
> 
>                     [nullable] => 1
>                     [editable] => 1
>                 )
> 
>             [5] => Array
>                 (
>                     [name] => discount_percent
>                     [label] => discount percent
>                     [mandatory] => 
>                     [type] => Array
>                         (
>                             [name] => double
>                         )
> 
>                     [nullable] => 1
>                     [editable] => 1
>                 )
> 
>             [6] => Array
>                 (
>                     [name] => discount_amount
>                     [label] => discount amount
>                     [mandatory] => 
>                     [type] => Array
>                         (
>                             [name] => double
>                         )
> 
>                     [nullable] => 1
>                     [editable] => 1
>                 )
> 
>             [7] => Array
>                 (
>                     [name] => comment
>                     [label] => comment
>                     [mandatory] => 
>                     [type] => Array
>                         (
>                             [name] => text
>                         )
> 
>                     [nullable] => 1
>                     [editable] => 1
>                 )
> 
>             [8] => Array
>                 (
>                     [name] => incrementondel
>                     [label] => incrementondel
>                     [mandatory] => 
>                     [type] => Array
>                         (
>                             [name] => autogenerated
>                         )
> 
>                     [nullable] => 
>                     [editable] => 
>                     [default] => 0
>                 )
> 
>             [9] => Array
>                 (
>                     [name] => id
>                     [label] => lineitem id
>                     [mandatory] => 
>                     [type] => Array
>                         (
>                             [name] => autogenerated
>                         )
> 
>                     [editable] => 
>                     [nullable] => 
>                     [default] => 
>                 )
> 
>             [10] => Array
>                 (
>                     [name] => tax1
>                     [label] => VAT
>                     [mandatory] => 
>                     [type] => Array
>                         (
>                             [name] => double
>                         )
> 
>                     [nullable] => 1
>                     [editable] => 1
>                 )
> 
>             [11] => Array
>                 (
>                     [name] => tax2
>                     [label] => Sales
>                     [mandatory] => 
>                     [type] => Array
>                         (
>                             [name] => double
>                         )
> 
>                     [nullable] => 1
>                     [editable] => 1
>                 )
> 
>             [12] => Array
>                 (
>                     [name] => tax3
>                     [label] => Service
>                     [mandatory] => 
>                     [type] => Array
>                         (
>                             [name] => double
>                         )
> 
>                     [nullable] => 1
>                     [editable] => 1
>                 )
> 
>             [13] => Array
>                 (
>                     [name] => image
>                     [label] => image
>                     [mandatory] => 
>                     [type] => Array
>                         (
>                             [name] => string
>                         )
> 
>                     [nullable] => 1
>                     [editable] => 1
>                 )
> 
>             [14] => Array
>                 (
>                     [name] => purchase_cost
>                     [label] => purchase cost
>                     [mandatory] => 
>                     [type] => Array
>                         (
>                             [name] => double
>                         )
> 
>                     [nullable] => 1
>                     [editable] => 1
>                 )
> 
>             [15] => Array
>                 (
>                     [name] => margin
>                     [label] => margin
>                     [mandatory] => 
>                     [type] => Array
>                         (
>                             [name] => double
>                         )
> 
>                     [nullable] => 1
>                     [editable] => 1
>                 )
> 
>         )
> 
>     [idPrefix] => 33
>     [isEntity] => 
>     [labelFields] => 
> )



On 06/10/2020 13:34, Martin Allen wrote:
> Has anyone been able to successfully create a 
> Quote/Invoice/SalesOrder/PurchaseOrder record via WebService? If so what 
> data structure does it require?
> 
> I am trying and keep getting a blank 200 response - I know that I need 
> to add a 'LineItem' array but have no idea what fields need to be in it?
> 
> Can't find any documentation on this...
> 
> Martin Allen
> 
> *01392 248692 - Main Office
> 01392 690659 - Direct Line*
> 
> *signature2*
> 
> Have you visited our website recently? http://www.clystnet.com 
> <http://www.clystnet.com/>
> 
> 
> The information in this email is confidential If you are not the 
> intended recipient, you must not read or use that information. This 
> email and any attachments are believed to be virus free however no 
> responsibility is accepted by Clystnet for any loss or damage arising in 
> any way from receipt or use thereof. Clystnet Ltd (company reg number 
> 7164503) is based at Silverdown Park, Fair Oak Close, Clyst Honiton, EX5 2UX
> 
> 
> _______________________________________________
> http://www.vtiger.com/
> 


More information about the vtigercrm-developers mailing list