Skip to main content
Question

Trying to refresh the grid on Incoming Documents (AP301110) after adding or updating a Note

  • Nov 27, 2026 5:01 PM UTC
  • 1 reply
  • 26 views
  • Translate All

Joe Schmucker
Captain II
Forum|alt.badge.img+3

The customer wants to show the text in a custom field on the grid of the AP301110 Incoming Documents screen.  This saves them from having to open the note on each row to inspect the note text.

I add a custom unbound field UsrNote to the grid.

When the screen is loaded or refreshed, it displays the note text properly.

 

When you open the note and change it to Joe2 and click OK, it saves the note, but the value on the grid is not updated.

I think the goal is to click the Refresh action on the screen after you click OK on the Note popup.

Since this is a processing screen, the persist to the DB happens outside of the events that are firing in the IncomingDocumentsProcess graph, and no events are fired on the graph extension. 

After you click OK on the note, no events fire on the graph other than RowSelected.  If I try to get the new value saved in the DB on that event, it just brings up the previous notetext value, not the new value.

I am using the FieldSelecting event to get the DB value for the current record and set the custom field to the NoteText value.  This works correctly.

What can I do on this graph extension to cause the screen to refresh when the note is saved to the DB?  The RowPersisted on Note table is not fired.

I’ve tried hundreds of things to try to catch the update to the Note that was saved but I cannot find any way to do it.

Here is my code at this time.  I’ve left off the hundreds of commented out lines that did not work.

	public class IncomingDocumentsProcess_Extension : PXGraphExtension<IncomingDocumentsProcess>
{

protected virtual void _(Events.RowPersisted<Note> e)
{
if (e.Row == null || e.TranStatus != PXTranStatus.Completed) return;

// Only react to inserts or updates
if (e.Operation != PXDBOperation.Insert && e.Operation != PXDBOperation.Update)
return;

Note updatedNote = e.Row;

// Find the matching grid row in IncomingDocumentsProcess
// Note: Check the exact view name in your version (commonly Base.Records)
RecognizedRecord matchingRow = Base.Records.Select()
.RowCast<RecognizedRecord>()
.FirstOrDefault(r => r.NoteID == updatedNote.NoteID);

if (matchingRow != null)
{
// Your custom logic here (e.g., updating a custom flag or refreshing the grid)
Base.Records.Cache.SetValueExt<SCGCRecognizedRecordExt.usrNote>(matchingRow, true);
Base.Records.View.RequestRefresh();
}
}

//return current value to the custom field in the grid
//works properly
protected virtual void _(Events.FieldSelecting<RecognizedRecordForProcessing, SCGCRecognizedRecordExt.usrNote> e)
{
var row = (RecognizedRecordForProcessing)e.Row;
if (row == null) return;

string noteText = PXNoteAttribute.GetNote(e.Cache, e.Row);
if (noteText == null) return;
e.ReturnValue = noteText;
}

//HUNDREDS of lines below here that are commented out

 

1 reply

Forum|alt.badge.img+5

Hello ​@Joe Schmucker I tried several approaches as well and came up with this workaround. You need to make the following changes:
 

1. Graph Extension Changes (as you said already working)

  • Add FieldSelecting event for the unbound UsrNote field.

  • Retrieve the latest note text directly from the Note table using the record's NoteID.

  • Assign the retrieved text to e.ReturnValue.

  • This ensures the grid displays the latest note whenever the field is selected or refreshed.

2. ASPX.cs Changes

  • Find the grid control recursively because it is inside the MasterPage's ContentPlaceHolder.

  • Subscribe to the grid's NoteSave event.

  • When the user clicks OK in the Note dialog:

    • Get the updated note text from ev.Note.

    • Escape special characters for JavaScript.

    • Use PXCallbackManager.RegisterJavaScript to update the UsrNote cell.

    • Call grid.refresh() after a short delay.

I hope this help.
 

Translate