Skip to main content
Solved

Trouble updating values on custom table

  • 22 March 2023
  • 3 replies
  • 58 views

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.

3 replies

Userlevel 7
Badge +9

 

  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.

Userlevel 4
Badge +1

@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.

Userlevel 7
Badge

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

Reply