Page 1 of 1

Order Notes

Posted: Wed Dec 09, 2009 8:28 pm
by lbrewerandassoc
If I want to only pull out comments entered by the Customer, then how can I do this? What does the ac_OrderNotes..NoteTypeId column represent? It seems as though customer comments have NoteTypeId=0 versus private system comments which have NoteTypeId=3. What does the 1 & 3 represent?

Re: Order Notes

Posted: Thu Dec 10, 2009 3:28 am
by mazhar
You can access all this information via commerce builder API code. For example have a look at following code

Code: Select all

        OrderNoteCollection notes = OrderNoteDataSource.LoadForOrder(orderId);
        foreach (OrderNote note in notes)
        { 
            switch(note.NoteType)
            {
                case NoteType.Private:
                    
                    break;
                    
                case NoteType.Public:
                                      
                    break;
                    
                case NoteType.SystemPrivate:
                    
                    break;
                    
                case NoteType.SystemPublic:
                    
                    break;
            }
        }
Where for orderId you will provide the actual id of order for which you want to view order notes.

Re: Order Notes

Posted: Thu Dec 10, 2009 5:13 pm
by lbrewerandassoc
Thank you.

But I'm writing code to pull data directly from the database & I was trying to find documentation that assures me what NoteTypeId & OrderItemTypeID represent. Does documentation exist somewhere that states

ac_OrderNotes..NoteTypeId
value = 0 is Public
value = 1 is private
etc.

ac_OrderItems.OrderItemTypeId
value = 0, Product
value = 3, Tax
value = 1, Shipping
etc.

Re: Order Notes

Posted: Fri Dec 11, 2009 5:24 am
by mazhar
Here is the note type enum values list with their friendly names

Code: Select all

Public = 0
Private = 1
SystemPublic = 2
SystemPrivate = 3

Re: Order Notes

Posted: Fri Dec 11, 2009 6:31 am
by lbrewerandassoc
Great. Thank you.

Where is this information found?

Do you have same for ac_OrderItems.OrderItemTypeId?

Re: Order Notes

Posted: Fri Dec 11, 2009 6:35 am
by mazhar
I simply ran following ASP.NET script to find this

Code: Select all

Response.Write("Private = " + ((Int16)NoteType.Private).ToString());
Response.Write("<br />");

Response.Write("Public = " + ((Int16)NoteType.Public).ToString());
Response.Write("<br />");

Response.Write("SystemPrivate = " + ((Int16)NoteType.SystemPrivate).ToString());
Response.Write("<br />");

Response.Write("SystemPublic = " + ((Int16)NoteType.SystemPublic).ToString());
Response.Write("<br />");