Page 1 of 1

How to use Note and NoteType

PostPosted: Tue Sep 02, 2014 12:45 pm
by mribbons
Get ready for the questions Mike :)

I'm upgrading our interfaces from Jiwa 6.00.53 to Jiwa 7.

I am unclear on how to assign the Note.NoteType member. There doesn't seem to be an enumeration or factory method anywhere.

Previously I got away with this:

jiwaSalesOrder.AddNote(jiwaSalesOrder.SystemSettings.DefaultNoteTypeKey, jiwaSalesOrder.StaffID, cNotesText);

But now it looks like I have to create a Note and add it to jiwaSalesOrder.SalesOrder.Notes()

Can you provide an example?

Re: How to use Note and NoteType  Topic is solved

PostPosted: Tue Sep 02, 2014 3:51 pm
by Mike.Sheen
mribbons wrote:I am unclear on how to assign the Note.NoteType member. There doesn't seem to be an enumeration or factory method anywhere.

Previously I got away with this:

jiwaSalesOrder.AddNote(jiwaSalesOrder.SystemSettings.DefaultNoteTypeKey, jiwaSalesOrder.StaffID, cNotesText);

But now it looks like I have to create a Note and add it to jiwaSalesOrder.SalesOrder.Notes()

Can you provide an example?


Sure - the following demonstrates this:
Code: Select all
Dim note As New JiwaApplication.Notes.Note
note.NoteText = "test"

' Set the note type to be the default
note.NoteType = SalesOrder.Notes.DefaultNoteType

' Find a note type with a particular description
For Each noteType As JiwaApplication.Notes.NoteType In SalesOrder.Notes.NoteTypeCollection
   If noteType.Description = "Instructions" Then
      note.NoteType = noteType
      Exit For
   End If
Next

note.LastModifiedByStaffMember = SalesOrder.Staff

SalesOrder.Notes.Add(note)


Edit: For those wanting a terse solution - this is the one line version:
Code: Select all
SalesOrder.Notes.Add(New JiwaApplication.Notes.Note With {.NoteText = "test", .NoteType = SalesOrder.Notes.DefaultNoteType, .LastModifiedByStaffMember = SalesOrder.Staff})

Re: How to use Note and NoteType

PostPosted: Tue Sep 02, 2014 5:20 pm
by mribbons
Thanks.

Sorry I can't see how to mark the question as answered.

Re: How to use Note and NoteType

PostPosted: Thu Sep 04, 2014 12:13 pm
by Mike.Sheen
mribbons wrote:Thanks.

Sorry I can't see how to mark the question as answered.


There should be a icon to the top right of the posts with a green tick - click that on the post you think answered the topic:
marksolved.PNG
marksolved.PNG (3.93 KiB) Viewed 2306 times