Skip to main content
Solved

How to refresh screen after updating a customer object

  • Jul 21, 2025 10:54 AM UTC
  • 11 replies
  • 239 views
  • Translate All

Forum|alt.badge.img

I’m trying to refresh the screen AR303000 after I updated the customer status via REST-API. This is my API-Call (PUT):

{
"CustomerID": {
"value": "XXXX"
},
"Status": {
"value": "A"
}
}

Right now the user has to manually refresh the screen to see the new status value. If the user changes the customer data without hitting refresh he receives an error.

Is there any possibility to refresh the screen after the customer object is updated by the REST call?

 

Best answer by Abhishek Niikam

​Hello, @BEXJens 


What's Not Supported

  • There's no native REST API call or hook to trigger a screen UI refresh.

  • The Acumatica UI is not real-time reactive to back-end updates done via API or outside the current session context.

Recommendation

For now, the best practice is:

  • Either inform users to refresh manually,

  • Or implement a small customization to auto-reload the record on certain triggers (e.g., on focus or save attempt).

I hope it helps!

View original

11 replies

Forum|alt.badge.img+5

​Hello, @BEXJens 


What's Not Supported

  • There's no native REST API call or hook to trigger a screen UI refresh.

  • The Acumatica UI is not real-time reactive to back-end updates done via API or outside the current session context.

Recommendation

For now, the best practice is:

  • Either inform users to refresh manually,

  • Or implement a small customization to auto-reload the record on certain triggers (e.g., on focus or save attempt).

I hope it helps!

Translate

Forum|alt.badge.img
  • Author
  • Freshman II
  • Jul 21, 2025 12:04 PM UTC

Thanks for your response!

Could you tell me the possibilities to inform the users to refresh the screen? 

Translate

Forum|alt.badge.img+5

​@BEXJens , You can 

 

1. Show an Inline Warning Message

Use RaiseExceptionHandling to display a warning near the Status field, like this:

Base.Caches<BAccount>().RaiseExceptionHandling<BAccount.status>( customer, customer.Status, new PXSetPropertyException("Customer status changed. Please click 'Refresh Customer' to update.", PXErrorLevel.Warning) );

This will alert the user that the data may be stale and prompt them to refresh.

 

2. Add a "Refresh Customer" Button 

You can add a simple custom button that reloads the customer record from the database when clicked, ensuring the latest data is shown without needing a full screen refresh.

 

I hope it helps!

Translate

Forum|alt.badge.img
  • Author
  • Freshman II
  • Jul 21, 2025 12:22 PM UTC

Hi Abhishek, 

thanks for the reply.

To inform the user to refresh manually i still need an event that is triggered after the customer object ist updated by the rest api. A button wouldn’t solve this problem.

How can I use the exception to solve my problem?

 

Thanks in adavance.

Translate

Forum|alt.badge.img+5

​@BEXJens You may use this approach:
 

use this in RowSelected:

protected void _(Events.RowSelected<BAccount> e)
{
if (e.Row == null) return;

var latest = PXDatabase.SelectSingle<BAccount>(
new PXDataField("Status"),
new PXDataFieldValue("BAccountID", PXDbType.Int, e.Row.BAccountID)
);

if (latest != null && latest.ToString() != e.Row.Status)
{
Base.Caches<BAccount>().RaiseExceptionHandling<BAccount.status>(
e.Row,
e.Row.Status,
new PXSetPropertyException("Status may be changed. Please refresh the screen.", PXErrorLevel.Warning)
);
}
}

This shows a warning icon on the Status field & good for gentle reminders.

Translate

Forum|alt.badge.img
  • Author
  • Freshman II
  • Jul 21, 2025 2:28 PM UTC

​@Abhishek Niikam 

Will the “RowSelected” be triggered when the status is updated by the rest api?

Translate

Forum|alt.badge.img+5

​@BEXJens Yes , you are right it will not until user interact manually, I confirmed that!

I think the JavaScript will work in this situation. I’m trying with it & If I find something i will share it.

Translate

Forum|alt.badge.img
  • Author
  • Freshman II
  • Jul 21, 2025 3:20 PM UTC

​@Abhishek Niikam 

Thank you! I’m looking forward to your solution.

Translate

Forum|alt.badge.img
  • Author
  • Freshman II
  • Jul 25, 2025 11:46 AM UTC

​@Abhishek Niikam

Could you figure out how to solve the problem with javascript?

Translate

Forum|alt.badge.img
  • Author
  • Freshman II
  • Sep 12, 2025 8:36 AM UTC

@Abhishek Niikam

Could you please give me some feedback on that?

Translate

Forum|alt.badge.img+5

​@BEXJens there’s no built-in way for a REST update to auto-refresh the AR303000 screen. The change will only show after the user manually refreshes. To avoid concurrency errors, you can add a small graph extension that compares the record’s tstamp with the database and, if it’s stale, forces an automatic reload on the next user action. This way, instead of getting the “record changed” error, the screen reloads and shows the updated status.
 

Translate