Forgive me - I am a newbie, still trying to get to grips with AwareIMt.
I have a number of calculated fields on a grid. Some of the factors in the calculations are attributes of the same business object as the calculated attributes and the user wants to edit these values and immediately see the result. This I can do and it's fine.
However there are a number of additional factors which affect the calculation which are attributes of the parent business object. Idealy these would be shown in the same form and when a value was changed it would recalculate all the instances in the grid.
I have tried a number of techniques to get AwareIM to do this without success.
An acceptable compromise would be for there to be a 'Refresh' button on the form, so that the user could refresh the calculated attributes if they made changes to the parameters held in the parent business object. Whereas I could easily get all the instances into the Context, any calculation process uodated every instance with the same figures. In retrospect, hardly surprising, but worth a try when desperate.
Can anyone help me please by either telling me that what I am tryig to do just can't be done or suggesting a mechanism which would achieve the desired result. I would be most grateful.
Colin Parker
Refreshing Calculation in a grid with parameters help in a different business object
Refreshing Calculation in a grid with parameters help in a different business object
Colin
------------------------------------------------------------------------------------------------------------------------
AwareIM 8.7 (Build3012) Windows Virtual Server Derby
------------------------------------------------------------------------------------------------------------------------
AwareIM 8.7 (Build3012) Windows Virtual Server Derby
-
- Posts: 2401
- Joined: Mon Jul 02, 2012 12:24 am
- Location: Ulaanbaatar, Mongolia
Re: Refreshing Calculation in a grid with parameters help in a different business object
Have you set the Autorefresh on the grid that include the Parent BO and the Child BO and any Process you are using?
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Re: Refreshing Calculation in a grid with parameters help in a different business object
Thank you for your response.
As I understand it Auto-Refresh will refresh the results of the query to select the instances shown in the grid. There seems to be four methods to trigger a refresh and I was already using the second to refresh the query if a new instance of the business object shown in the grid was created. On your suggestion I tried the third, to refresh if a process was run, I created an empty process to test this. It refreshed the results of the query to populate the grid, but it did not force a recalculation of the calculated attributes.
Perhaps there is some Rule I could place in the process which would do this?
As I understand it Auto-Refresh will refresh the results of the query to select the instances shown in the grid. There seems to be four methods to trigger a refresh and I was already using the second to refresh the query if a new instance of the business object shown in the grid was created. On your suggestion I tried the third, to refresh if a process was run, I created an empty process to test this. It refreshed the results of the query to populate the grid, but it did not force a recalculation of the calculated attributes.
Perhaps there is some Rule I could place in the process which would do this?
Colin
------------------------------------------------------------------------------------------------------------------------
AwareIM 8.7 (Build3012) Windows Virtual Server Derby
------------------------------------------------------------------------------------------------------------------------
AwareIM 8.7 (Build3012) Windows Virtual Server Derby
Re: Refreshing Calculation in a grid with parameters help in a different business object
I have made some progress with this.
I found an ACTION called UPDATE which will invoke evaluation of rules attached to the specified Business Object. So now I have a (HTML) button on my form called 'Refresh' which calls a process called test_refresh and passes the instance of the BO. This process first gets the mulitple instances of the Business Object I want to update and calls for the UPDATE first of the instance of the BO passed to the process and then of the instances queried. I have added this process to the Auto-Refresh triggers in the grid properties.
We are almost there. When I run the form I can alter the Selling Price of the Product, click on my Refresh Button, AwareIM will ask me if I want to keep the changes. I click on Yes and the revised Gross Profit is displayed against each instance in the grid.
I can see from the testing log that it does seem to be working fine.
My problem now is what happens when I change the Selling Price for a second time and click on my Refresh button. This time I am not asked to save any changes and the Selling Price on the form merely reverts to the value before the change. The testing log indictaes that all the rules have been invoked, but all using (I assume) the previous value, so the resulting value is not changed.
Perhaps I should start a new log as this has changed so much
kind regards
I found an ACTION called UPDATE which will invoke evaluation of rules attached to the specified Business Object. So now I have a (HTML) button on my form called 'Refresh' which calls a process called test_refresh and passes the instance of the BO. This process first gets the mulitple instances of the Business Object I want to update and calls for the UPDATE first of the instance of the BO passed to the process and then of the instances queried. I have added this process to the Auto-Refresh triggers in the grid properties.
We are almost there. When I run the form I can alter the Selling Price of the Product, click on my Refresh Button, AwareIM will ask me if I want to keep the changes. I click on Yes and the revised Gross Profit is displayed against each instance in the grid.
I can see from the testing log that it does seem to be working fine.
My problem now is what happens when I change the Selling Price for a second time and click on my Refresh button. This time I am not asked to save any changes and the Selling Price on the form merely reverts to the value before the change. The testing log indictaes that all the rules have been invoked, but all using (I assume) the previous value, so the resulting value is not changed.
Perhaps I should start a new log as this has changed so much
kind regards
Colin
------------------------------------------------------------------------------------------------------------------------
AwareIM 8.7 (Build3012) Windows Virtual Server Derby
------------------------------------------------------------------------------------------------------------------------
AwareIM 8.7 (Build3012) Windows Virtual Server Derby
Re: Refreshing Calculation in a grid with parameters help in a different business object
Colin .. the User Guide should have some info on different button figurations if my memory serves me right. Seems like you need a button with a SAVE function.
Tom - V8.8 build 3137 - MySql / PostGres
Re: Refreshing Calculation in a grid with parameters help in a different business object
I might not understand your issue, but it seems like you have some editable fields in a BO that are used to compute a calculated field with the calculation also using some attributes from a parent BO.
If so, you can create a rule in the child BO where you check off DYNAMIC and the rule would look like:
IF Child.attr1 WAS CHANGED THEN
Child.calcField = Child.attr + Child.linkToParent.parentAttribute (or Child.shortcutToParentAttribute)
Bruce
If so, you can create a rule in the child BO where you check off DYNAMIC and the rule would look like:
IF Child.attr1 WAS CHANGED THEN
Child.calcField = Child.attr + Child.linkToParent.parentAttribute (or Child.shortcutToParentAttribute)
Bruce
Re: Refreshing Calculation in a grid with parameters help in a different business object
Many thanks to all those who responded to this cry for help.
With your imput I am half way to solving the problem. I stated a new BSV to test what I wanted to do and it works perfectly. There must be a something, somwhere which is not set correctly. It is just a question of finding it.
My very grateful thanks again
With your imput I am half way to solving the problem. I stated a new BSV to test what I wanted to do and it works perfectly. There must be a something, somwhere which is not set correctly. It is just a question of finding it.
My very grateful thanks again
Colin
------------------------------------------------------------------------------------------------------------------------
AwareIM 8.7 (Build3012) Windows Virtual Server Derby
------------------------------------------------------------------------------------------------------------------------
AwareIM 8.7 (Build3012) Windows Virtual Server Derby