Order Notes

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
lbrewerandassoc
Ensign (ENS)
Ensign (ENS)
Posts: 13
Joined: Wed May 27, 2009 4:17 pm

Order Notes

Post by lbrewerandassoc » Wed Dec 09, 2009 8:28 pm

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?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Order Notes

Post by mazhar » Thu Dec 10, 2009 3:28 am

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.

lbrewerandassoc
Ensign (ENS)
Ensign (ENS)
Posts: 13
Joined: Wed May 27, 2009 4:17 pm

Re: Order Notes

Post by lbrewerandassoc » Thu Dec 10, 2009 5:13 pm

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.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Order Notes

Post by mazhar » Fri Dec 11, 2009 5:24 am

Here is the note type enum values list with their friendly names

Code: Select all

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

lbrewerandassoc
Ensign (ENS)
Ensign (ENS)
Posts: 13
Joined: Wed May 27, 2009 4:17 pm

Re: Order Notes

Post by lbrewerandassoc » Fri Dec 11, 2009 6:31 am

Great. Thank you.

Where is this information found?

Do you have same for ac_OrderItems.OrderItemTypeId?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Order Notes

Post by mazhar » Fri Dec 11, 2009 6:35 am

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 />");

Post Reply