Skip to main content
Answer

Trouble updating values on custom table

  • March 22, 2023
  • 3 replies
  • 133 views

Forum|alt.badge.img+1

Hello-

I have created a custom table and have then created a view under ProjectEntry ext graph. However, when I try to run a script to update the values- it will not, for the life of me, update the values- I’m perplexed- I’ve never had issues with base detail tables on the ProjectEntry graph.. but now that I have a custom table it is really not liking it. See below for view that I created and then the action that I call to update the value in the cache based on a static value (just for testing). I have simplified the code down a lot for testing and de-bugging purposes, but for all intents and purposes, the same logic applies.

View:

public PXSelect<BlyIconPMBudget> BlyIconPMBudgetView;

Action:

        public PXAction<PX.Objects.PM.PMProject> UpdateBalances;
[PXButton(CommitChanges = true)]
[PXUIField(DisplayName = "Update Balances")]
protected void updateBalances()
{
foreach (BlyIconPMBudget b in BlyIconPMBudgetView.Select())
{
b.GrossRevAct = 45;
BlyIconPMBudgetView.Cache.Update(b);
}
}

Secondly, I would like for this to execute whenever anyone enters the page because the balances might have changed since they last entered the screen.. I essentially want to mock the native project balances, but if I can’t get that, I’m ok with it being executed via a button.

Best answer by rhooper91

@aaghaei - I was attempting to simplify my question to get the concept across in the attempt to get a quick answer, I apologize if it was hard to follow. A lot of what you suggested was in my base code- I just simplified to try and rule out other things out for why it might not be triggering.

I found a work around using rowpersisting and it got the job done.

3 replies

aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • March 22, 2023

 

  1. Pal not sure what you are trying to achieve and based on what logic your summary should be updated but I see nothing in your code which is meant to do so. What event should trigger the refresh? When? On what ground? What is the logic?
  1. there are some considerations like setting Parent-child relationships between the parent and detail tables like PXParent and defining child key fields that I see nothing here.
  2. your view definitely is wrong as it is not referring to current project. It in fact referring to ALL projects not current one.

You will need to raise clear questions with use case and proper input so people can help you.


Forum|alt.badge.img+1
  • Author
  • Varsity III
  • Answer
  • March 27, 2023

@aaghaei - I was attempting to simplify my question to get the concept across in the attempt to get a quick answer, I apologize if it was hard to follow. A lot of what you suggested was in my base code- I just simplified to try and rule out other things out for why it might not be triggering.

I found a work around using rowpersisting and it got the job done.


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • March 27, 2023

Thank you for sharing your solution with the community @rhooper91 !