Can you give me an example of how to add notes to order checklist?
I tried the following code and got acces member exception.
If strNote <> "" Then
Dim iNote
iNote = DirectCast(spsOrder, IOrder).CreateNew("Note") 'oTask.Note.CreateNew()
iNote.Text = strNote
iNote.IsInternal = True
'iNote.CreatedOn = DateTime.SpecifyKind(System.Convert.ToDateTime(strNoteDate), DateTimeKind.Local)
oTask.Notes.Add(iNote)
End If
DirectCast(DynOrder("Tasks"), IList).Add(oTask)
Notes for OrderChecklist.
-
- Posts: 89
- Joined: Wed Nov 16, 2011 11:51 am
Re: Notes for OrderChecklist.
The below example shows one way to add a Note to an Order:
Code: Select all
Using order As IOrder = OrderStore.NewOrder()
Try
Dim DynOrder As Object = order
Dim newNote As IOrderItem = order.CreateNew("Note")
newNote.SetProperty("Text", "My First Note")
newNote.SetProperty("IsInternal", True)
Dim notes = DynOrder.Notes.Add(newNote)
OrderStore.ApplyChanges(order)
MsgBox(String.Format("Order has been created: {0}", DynOrder.Number))
Catch ex As Exception
MsgBox(String.Format("An error occured: {0}", ex.Message))
End Try
End Using