Microsoft Developer Network > Forums Home > Commerce Server Forums > Commerce Server 2007 > Created date value from purchaseOrder table of transaction db looks different in business user application +urgent
Ask a questionAsk a question
 

AnswerCreated date value from purchaseOrder table of transaction db looks different in business user application +urgent

  • Friday, October 30, 2009 2:22 AMManjushree Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    Whenever the order is saved in purchase order table value for created column is set. When i search for this order in customer and order manager (Business user application) I see the data for created column is different. The diffence is of 4hrs. Is it something to deal with timezone on which server or services are?
    When we insert data in purchase order table which value for created column pipeline method takes while executing? Is it SQl server getdate() or system date in which website is hosted or commerce server is hosted?

    Thanks for the help in advance.
    Manjushree

Answers

  • Friday, October 30, 2009 9:52 AMRavi Kanth KoppalaMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    I am assuming the value is set from commerce server. Here are the reasons for this.

    *   SPI_Ord_PurchaseOrder stored procedure which inserts data in PurchaseOrder table is expecting created date as input parameters and there is no default value set for the column in the table.

    *   If you observe basket class - Created and LastModified properties are get properties (not set) - that means commerce server is taking control on these dates while inserting values in to database.

    Hope this helps.

    Regards,
    -Ravi Kanth Koppala


    http://techblog.ravikanth.net (If this post answers your question - Either Mark this post as the answer or vote as being useful.)
  • Friday, October 30, 2009 11:11 PMGael DuhamelMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Hi,

    If you have a look at: http://msdn.microsoft.com/en-us/library/microsoft.commerceserver.runtime.orders.ordergroup.created.aspx
    OrderGroup.Created: A DateTime containing the local time when the order group was created.

    Created is set during the initial construction of the current order object. It is not updated during storage loads.

    When Created or other DateTime fields are stored or loaded back from the computer that is running SQL Server, the resolution has to be lower than that with TickCount.


    http://gaelduhamel.spaces.live.com; http://www.twitter.com/GaelDuhamel; http://www.itcreme.com
    • Marked As Answer byManjushree Sunday, November 15, 2009 7:05 AM
    •  
  • Monday, November 02, 2009 8:41 PMGael DuhamelMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    The TickCount (http://msdn.microsoft.com/en-us/library/system.environment.tickcount(VS.80).aspx) is often used for time measurement. So here, it means that the Created date has to be lower than the other datetime fields and for calculate it, the API use the tickcount.


    http://gaelduhamel.spaces.live.com; http://www.twitter.com/GaelDuhamel; http://www.itcreme.com
    • Proposed As Answer byGael DuhamelMVPMonday, November 02, 2009 8:42 PM
    • Marked As Answer byManjushree Sunday, November 15, 2009 7:05 AM
    •  

All Replies

  • Friday, October 30, 2009 9:52 AMRavi Kanth KoppalaMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    I am assuming the value is set from commerce server. Here are the reasons for this.

    *   SPI_Ord_PurchaseOrder stored procedure which inserts data in PurchaseOrder table is expecting created date as input parameters and there is no default value set for the column in the table.

    *   If you observe basket class - Created and LastModified properties are get properties (not set) - that means commerce server is taking control on these dates while inserting values in to database.

    Hope this helps.

    Regards,
    -Ravi Kanth Koppala


    http://techblog.ravikanth.net (If this post answers your question - Either Mark this post as the answer or vote as being useful.)
  • Friday, October 30, 2009 11:11 PMGael DuhamelMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Hi,

    If you have a look at: http://msdn.microsoft.com/en-us/library/microsoft.commerceserver.runtime.orders.ordergroup.created.aspx
    OrderGroup.Created: A DateTime containing the local time when the order group was created.

    Created is set during the initial construction of the current order object. It is not updated during storage loads.

    When Created or other DateTime fields are stored or loaded back from the computer that is running SQL Server, the resolution has to be lower than that with TickCount.


    http://gaelduhamel.spaces.live.com; http://www.twitter.com/GaelDuhamel; http://www.itcreme.com
    • Marked As Answer byManjushree Sunday, November 15, 2009 7:05 AM
    •  
  • Monday, November 02, 2009 4:05 PMManjushree Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    Thanks for the replies. I did not understand what do you mean by the resolution has to be lower than that with TickCount.?
    Will you please explain it?

    Thanks,
    Manjushree
  • Monday, November 02, 2009 8:41 PMGael DuhamelMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    The TickCount (http://msdn.microsoft.com/en-us/library/system.environment.tickcount(VS.80).aspx) is often used for time measurement. So here, it means that the Created date has to be lower than the other datetime fields and for calculate it, the API use the tickcount.


    http://gaelduhamel.spaces.live.com; http://www.twitter.com/GaelDuhamel; http://www.itcreme.com
    • Proposed As Answer byGael DuhamelMVPMonday, November 02, 2009 8:42 PM
    • Marked As Answer byManjushree Sunday, November 15, 2009 7:05 AM
    •