|
Home > Archive > Commerce Server General > April 2005 > Blank OrderAddress in PurchaseOrder
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 |
Blank OrderAddress in PurchaseOrder
|
|
| Craig Boland 2005-04-17, 5:52 pm |
| I've come across an issue with CS2002 SP2 whereby creating an OrderAddress
and adding it to a Basket results in the OrderAddress having empty data.
If I create an new OrderAddress instance, assign it to the Basket by calling
Basket.Addresses.Add and Basket.SetBillingAddress methods, then populate the
address (FirstName, LastName, etc.), the address will be blank in the
PurchaseOrder (from Basket.SaveAsOrder method). However, if I populate the
address _before_ assigning it to the Basket, the address will be correct in
the PurchaseOrder. Below are examples of this issue. I've yet to install SP3,
so this may have been fixed.
// Results in blank address
OrderAddress billAddr = new OrderAddress("default", Guid.NewGuid.ToString());
myBasket.Addresses.Add(billAddr);
myBasket.SetBillingAddress(billAddr.ID);
billAddr.FirstName = "Joe";
// Results in correct address
OrderAddress billAddr = new OrderAddress("default", Guid.NewGuid.ToString());
billAddr.FirstName = "Joe";
myBasket.Addresses.Add(billAddr);
myBasket.SetBillingAddress(billAddr.ID);
| |
| Tomas Vera 2005-04-18, 5:51 pm |
| I don't think that this is a CS error.
It seems logical that calling "Add" will create and add a copy of the
address to the basket.
If it simply copies over a "pointer" to your address, your could
delete the address and corrupt the basket.
-tomas vera
On Sun, 17 Apr 2005 13:51:16 -0700, Craig Boland
<CraigBoland@discussions.microsoft.com> wrote:
>I've come across an issue with CS2002 SP2 whereby creating an OrderAddress
>and adding it to a Basket results in the OrderAddress having empty data.
>
>If I create an new OrderAddress instance, assign it to the Basket by calling
>Basket.Addresses.Add and Basket.SetBillingAddress methods, then populate the
>address (FirstName, LastName, etc.), the address will be blank in the
>PurchaseOrder (from Basket.SaveAsOrder method). However, if I populate the
>address _before_ assigning it to the Basket, the address will be correct in
>the PurchaseOrder. Below are examples of this issue. I've yet to install SP3,
>so this may have been fixed.
>
>// Results in blank address
>OrderAddress billAddr = new OrderAddress("default", Guid.NewGuid.ToString());
>myBasket.Addresses.Add(billAddr);
>myBasket.SetBillingAddress(billAddr.ID);
>billAddr.FirstName = "Joe";
>
>// Results in correct address
>OrderAddress billAddr = new OrderAddress("default", Guid.NewGuid.ToString());
>billAddr.FirstName = "Joe";
>myBasket.Addresses.Add(billAddr);
>myBasket.SetBillingAddress(billAddr.ID);
/*-------------------------------
* Tomas Vera
* tomas (at) sbcglobal (dot) net
*-------------------------------
*/
|
|
|
|
|