Hello, friends
Could you provide a code example of how to access particular table notes in attachment? For example I have added notes to one of the purchase orders in PurchTable and I need to access them from code in another table.
Kind regards,
Roberts
In which version of AX? Please always attach a version tag, such as AX 2012 or D365FO, when creating a new thread.
How will you find the particular note? (A single order may have many attached notes.)
Sorry, I m talking about DFO365. Yes, I would need particular note.
All right, I’ve attached “D365FO” tag for you.
Regarding the other question, I didn’t ask if you meant your requirement seriously. I asked how you want to find the particular note. Let’s say that the order has five attached notes. How will you decide which one of these five notes is “the particular”?
I would need the first note from the list (the oldest one).
You’ll need to think harder about your requirements. You don’t seem to realize that there may be different kinds of notes.
Anyway, this is something that should help you:
DocuRef docuRef;
select firstOnly docuRef
where docuRef.RefCompanyId == 'dat'
&& docuRef.RefTableId == tableNum(PurchTable)
&& docuRef.RefRecId == purchTable.RecId;
&& docuRef.TypeId == 'My note type';
info(docuRef.Notes);