Commerce Server General - PurchaseOrder Address Bug ?

This is Interesting: Free IT Magazines  
Home > Archive > Commerce Server General > August 2005 > PurchaseOrder Address Bug ?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author PurchaseOrder Address Bug ?
BeerBoy

2005-08-01, 8:09 am


I am saving my basket as an order - this all works and in Bizdesk I can
see my saved order with the correct shipping and billing addresses.

However, if I load the PurchaseOrder (to change it's status) then
resave it one of the addresses disappears !?!?

i.e if I do

num_of_addresses = currentOrder.Addresses.Count;
currentOrder.save();
num_of_addresses = currentOrder.Addresses.Count;

Before the save num_of_addresses = 2 but after the save it is 1 !!!

Has anyone else experienced this ? or know of a work around ?

Note that currentOrder.OrderForms[0].BillingAddress is always correct
as are 'ShippingAddress' fields in the LineItems.

Thanks

Jim

Nihit Kaul [MSFT]

2005-08-02, 6:03 pm

Hi Jim,

I tried this scenario with the following code snippet on CS 2002 FP1 and am
not able to repro this:

OrderContext orderCtx = CommerceOrderModule.OrderContext; // get order
context
Guid userID = Guid.NewGuid();

Basket tmpBasket = orderCtx.GetBasket(userID);
OrderAddress oaBill = new OrderAddress("OA1",
Guid.NewGuid().ToString());
OrderAddress oaShip = new OrderAddress("OA2",
Guid.NewGuid().ToString());

tmpBasket.Addresses.Add(oaBill);
tmpBasket.Addresses.Add(oaShip);

//Add LineItems
tmpBasket.OrderForms.Add(new OrderForm());
LineItem li1 = new LineItem("Adventure Works Catalog", "AW200-12", "2",
3);
LineItem li2 = new LineItem("Adventure Works Catalog", "AW200-12", "3",
5);
li1.ShippingAddress = oaShip.ShippingAddressID;
li2.ShippingAddress = oaBill.ShippingAddressID;

li1.ShippingMethodID = li2.ShippingMethodID =
"{00000000-0000-0000-0000-006784003486}";
li1.ShippingMethodName = li2.ShippingMethodName = "sm1";

tmpBasket.OrderForms[0].LineItems.Add(li1);
tmpBasket.OrderForms[0].LineItems.Add(li2);

//Set the Billing and Shipping addresses AFTER adding the lineItems
tmpBasket.SetBillingAddress(oaBill.ID);
tmpBasket.SetShippingAddress(oaShip.ID);

tmpBasket.Save();

PipelineInfo basketPipeline = new PipelineInfo("basket");
PipelineInfo totalPipeline = new PipelineInfo("total");
PipelineInfo checkoutPipeline = new PipelineInfo("checkout");

tmpBasket.RunPipeline(basketPipeline);
tmpBasket.RunPipeline(totalPipeline);
tmpBasket.RunPipeline(checkoutPipeline);

PurchaseOrder po = tmpBasket.SaveAsOrder();

//po.Addresses.Add(oa1);
int beforeCount = po.Addresses.Count;

po["order_status_code"] = 32;

po.Save();

int afterCount = po.Addresses.Count;

beforeCount and afterCount are both same for me.

Could you give more details about how you are setting the BillingAddress /
ShippingAddress etc.? I think it might be due to some address not being
used as a Billing or Shipping Address.

Thanks,

Nihit Kaul[MSFT]
Commerce Server
http://blogs.msdn.com/nihitk

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--------------------
From: "BeerBoy" <jim.macaulay@framfab.com>
Newsgroups: microsoft.public.commerceserver.general
Subject: PurchaseOrder Address Bug ?
Date: 1 Aug 2005 04:03:04 -0700
Organization: http://groups.google.com
Lines: 24
Message-ID: <1122894184.410381.18310@o13g2000cwo.googlegroups.com>
NNTP-Posting-Host: 194.201.25.93
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1122894189 1770 127.0.0.1 (1 Aug 2005 11:03:09
GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 1 Aug 2005 11:03:09 +0000 (UTC)
User-Agent: G2/0.2
Complaints-To: groups-abuse@google.com
Injection-Info: o13g2000cwo.googlegroups.com; posting-host=194.201.25.93;
posting- account=TWSkKQ0AAACFRajyPiOqNaeuW33_VRZN

Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!news.glorb.com!postnews.google.com!o13g2000cwo.googlegroups.com!not-fo
r-mail
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.commerceserver.general:3123
X-Tomcat-NG: microsoft.public.commerceserver.general


I am saving my basket as an order - this all works and in Bizdesk I can
see my saved order with the correct shipping and billing addresses.

However, if I load the PurchaseOrder (to change it's status) then
resave it one of the addresses disappears !?!?

i.e if I do

num_of_addresses = currentOrder.Addresses.Count;
currentOrder.save();
num_of_addresses = currentOrder.Addresses.Count;

Before the save num_of_addresses = 2 but after the save it is 1 !!!

Has anyone else experienced this ? or know of a work around ?

Note that currentOrder.OrderForms[0].BillingAddress is always correct
as are 'ShippingAddress' fields in the LineItems.

Thanks

Jim


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com