HTH,
--
Jeffry van de Vuurst
CWR Mobility
www.cwrmobility.com
--
"Rosh" <Ro...@discussions.microsoft.com> wrote in message
news:6A014B22-F0C7-4DBF...@microsoft.com...
> Am attempting to add a product using web services. Code is quite strait
> forward but I am stuck on one thing.
>
> In the product base there are two required fields of type
> uniqueidentifier.
> These are defaultuomid and defaultuomscheduleid.
>
> Although I have copied the values direct form the source table ID fields,
> I
> get the following error when I run the code.
>
> Exception Details: System.NullReferenceException: Object reference not set
> to an instance of an object.
>
> Line 27: product.defaultuomid.Value = new
> guid("25B37C23-5E94-DA11-8CC2-000C412218DC")
>
> My code looks like this
> 23 Dim product as new product
> 25 product.name = "test"
> 26 product.productnumber = "test"
> 27 product.defaultuomid.Value = new
> guid("25B37C23-5E94-DA11-8CC2-000C412218DC")
> 28 product.defaultuomscheduleid.Value = new
> Guid("24B37C23-5E94-DA11-8CC2-000C412218DC")
>
> Dim productGuid As Guid = service.Create(product)
>
> There must be something I don't understand about guid's
>
> Can somebody lead me in the right direction?
> Help is most appreciated
>
cocde ended up like
product.defaultuomid = new Lookup()
product.defaultuomid.Value = new guid("25B37C23...")
product.defaultuomid.type = "uomBase"