How to use Note and NoteType  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

How to use Note and NoteType

Postby mribbons » Tue Sep 02, 2014 12:45 pm

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?
Regards,
Mike Ribbons
Micro Pacific Pty Ltd
http://www.micropacific.com.au
mribbons
Occasional Contributor
Occasional Contributor
 
Posts: 13
Joined: Mon Sep 01, 2014 12:02 pm

Re: How to use Note and NoteType  Topic is solved

Postby Mike.Sheen » Tue Sep 02, 2014 3:51 pm

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})
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: How to use Note and NoteType

Postby mribbons » Tue Sep 02, 2014 5:20 pm

Thanks.

Sorry I can't see how to mark the question as answered.
Regards,
Mike Ribbons
Micro Pacific Pty Ltd
http://www.micropacific.com.au
mribbons
Occasional Contributor
Occasional Contributor
 
Posts: 13
Joined: Mon Sep 01, 2014 12:02 pm

Re: How to use Note and NoteType

Postby Mike.Sheen » Thu Sep 04, 2014 12:13 pm

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 2286 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 2 guests