Skip to main content
Solved

Setting the SOLine notes via code is not working

  • February 17, 2025
  • 2 replies
  • 29 views

  • Jr Varsity I
  • 5 replies

Hi Everyone,
I’m creating a processing form to process SOLines based on some functionality, a part of the code is to set the Line note for each SOLine. i tried joining the SOLine to Note table on NoteID. and tried a second way to update the Note table on the database:

 

var note = PXSelect<Note,
                         Where<Note.noteID, Equal<Required<Note.noteID>>>>
                         .Select(graph, soLine.NoteID)
                         .FirstOrDefault()?.GetItem<Note>();

var lineNoteText = "...........";

note.NoteText = lineNoteText;

a “Null Object reference” raised for the note variable. so i thought to use the seconde one:

 

PXDatabase.Update<Note>(
        new PXDataFieldAssign<Note.noteText>(lineNoteText),
        new PXDataFieldRestrict<Note.noteID>(soLine.NoteID)
    );

none of them worked…

any thoughts?

Best answer by stephenward03

If you want to work with the notes against a record try using PXNoteAttribute 

PXNoteAttribute.SetNote(graphProjectEntry.RevenueBudget.Cache, item, n.NoteText);

string s = PXNoteAttribute.GetNote(this.Base.Products.Cache, cROpportunityProduct);

Cheers
Steve

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+1
  • Varsity I
  • 93 replies
  • Answer
  • February 17, 2025

If you want to work with the notes against a record try using PXNoteAttribute 

PXNoteAttribute.SetNote(graphProjectEntry.RevenueBudget.Cache, item, n.NoteText);

string s = PXNoteAttribute.GetNote(this.Base.Products.Cache, cROpportunityProduct);

Cheers
Steve


  • Author
  • Jr Varsity I
  • 5 replies
  • February 17, 2025

@stephenward03 Thank you Steve, i tried it before but i was missing something. you made it!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings