Hi Guys,
currently, I try to expand the work order list view (WorkOrdersListView.page) with additional functions.
For this, I added a counter (SimplePropertyCell) to this page and added a rule for the attribute "Value" to count all parts (work order components) for the current filtered list.
Right now, the code of the counter rule is analogue to the rule PartsCount.js and thus, if I initially enter the WorkOrdersListView.page, a query is built, but since my binding (clientAPI.getPageProxy().binding) is empty, I cannot extend my QueryBuilder with filters. Therefore, my result will always take all parts of all work orders and count them and if I navigate with the action PartsListViewNav.action, I will also see all parts of all work orders.
1. So my first question is, how I would access the information of my filter query in case I set a filter in the WorkOrdersListView.page. If I e.g. consider the method PartsCount.js, it is called, when entering WorkOrderDetails.page. As binding I have the information about the work order I selected from the list of WorkOrdersListView.page. These information can be used to build the QueryBuilder to filter for the parts of the currently selected work order. In my scenario, however, after calling the binding with clientAPI.getPageProxy().binding, I do not have any result. That is why I somehow have to access the query result of all work orders (workOrderId) to filter for their parts.
2. My second question would be, how I would trigger the recalculation of the counter in case I return to the screen after filtering the list of WorkOrdersListview.page. After debugging the code, I recognized, that the counter rule is only triggered for the initial loading of the screen, but the rule assigned to the attribute "Value" of the SimplePropertyCell, in which I set the counter, is never executed again. Is there a way to do that with the current version of the Asset Manager?
Thank you in advance for your answers!
BR,
Sher-Chan Kodirov
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
Sher-Chan,
While you can't set the value directly from OnReturning you can trigger a redraw which will rerun the value rule to get the new value.
--Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For #2, try looking at the OnReturning property in Pages. Not sure if it will work with merely filtering but worth a look.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael,
thank you for your answer! I actually tried to use the OnReturning property.
However, I wanted to set the value of the Value-attribute of the SimplePropertyCell, but it seems that it is not intended to set the value (setValue-method) of a SimplePropertyCell, since it has no "Name"-attribute to get the control proxy of this element (getControlProxy function of the CommonLibrary).
For my issue #1, I just used the filter result I got from the already existing "WorkOrderListViewCaption.js"-file, which is defined as rule in OnReturning of the WorkOrdersListView.page. With this result, I built my own query to get the correct count of required materials for the filtered work orders.
If you have any further ideas on how to solve the issue I described above, I would appreciate, if you could share it!
BR,
Sher-Chan Kodirov
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.