Is Notes from subform possible?
Sunset
Member Posts: 201
Is it possible to get the System-Notes to use the record displayed on the subform as reference? I've tried using the ProviderID, but it gets ignored.
For instance if you are standing in the salesorder, and you want a factbox showing the notes related to the item on the subformline. I know I can code a new page and use that, but I would prefer being able to use the System-Notes as that is what is used everywhere else.
For instance if you are standing in the salesorder, and you want a factbox showing the notes related to the item on the subformline. I know I can code a new page and use that, but I would prefer being able to use the System-Notes as that is what is used everywhere else.
Don't just take my word for it, test it yourself
0
Comments
-
Short answer no. I ran into the same issue.
Long answer is grab a coffee. Replicate the factbox as close as possible for source 2000000068 Record Link, with SourceTableView Type=Note. Have code to convert text from base64 (and I think you need to ignore the first character). Maintain the link to the factbox from subpage to the main page using a Record ID Flowfilter and OnAfterGetRecord triggers. Have the subform link Record ID with your flowfilter, and Company = CONST(%COMPANY%). The %COMPANY% constant replaces the string with current company name.
Here's some code for the factbox:
Var:
NoteText BigText
OnAfterGetRecord()
CALCFIELDS(Note);
IF Note.HASVALUE THEN BEGIN
Note.CREATEINSTREAM(InStr);
NoteText.READ(InStr);
NoteText.GETSUBTEXT(NoteText,2);
END ELSE
CLEAR(NoteText);
LOCAL WriteNoteText(NoteText : BigText;VAR RecordLink : Record "Record Link")
Local Vars:
SystemUTF8Encoder DotNet System.Text.UTF8Encoding.'mscorlib'
SystemByteArray DotNet System.Array.'mscorlib'
OStr OutStream
s BigText
lf Text
x Integer
y Integer
i Integer
c1 Char
c2 Char
s := NoteText;
SystemUTF8Encoder := SystemUTF8Encoder.UTF8Encoding;
SystemByteArray := SystemUTF8Encoder.GetBytes(s);
RecordLink.Note.CREATEOUTSTREAM(OStr);
x := SystemByteArray.Length DIV 128;
IF x > 1 THEN
y := SystemByteArray.Length - 128 * (x - 1)
ELSE
y := SystemByteArray.Length;
c1 := y;
OStr.WRITE(c1);
IF x > 0 THEN BEGIN
c2 := x;
OStr.WRITE(c2);
END;
FOR i := 0 TO SystemByteArray.Length - 1 DO BEGIN
c1 := SystemByteArray.GetValue(i);
OStr.WRITE(c1);
END;
<\code>
Good luck!1 -
Thank you for the suggestion Mark. But like I said, I would prefer to avoid coding the whole thing. Mostly because I want the feeling of it being the notes box instead of something where I have extra buttons to create notes.
Also as a comment for your suggestion for coding in the factbox; have a look at how RecordLinkNote is handled in Codeunit 10 and use that instead
Don't just take my word for it, test it yourself0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions