How to hide record in Form grid based on display method value? - forms

I have a simple Form, in my DataSource I created a classic displayMethod (named calculateAmount) and use this metodod to show the value in Form's grid.
So It's possible to show only record having a specific value from calculateAmount , for example I want to show only record having calculateAmount() > 0 , other record with calculated calculateAmount() < 0 not show.
So if I can't mix Query and displayMethod, possibly where I can insert the condition (for example active executeQuery etc) ?
Thanks in advice.

Consider the following sequence:
Execute query is called and the AOT query is translated into SQL query
Results are fetched from SQL server after executeQuery()
Display method is called for each record and then the values are shown on grid
So you cannot add query range on execute query based on display method value.
One thing you can do:
Duplicate your datasource table and set its Table Type property to TempDB
In executeQuery method write the logic to fill this new created table
Here you can add this condition like this:
if ([your data source].calculateAmount() > 0)
{
// do not add the record in temp table
}
else
{
// add the record in temp table
}
Set your temp table as the datasource to your grid.
Hope this helps!!

Related

How to collect all the id values for a yadcf filtered table

I'm using datatables and yadcf to filter a table. Now I'd like to take all the table row id values, for example, and use those as arguments in a POST request. How can I "collect" the values of these ids from the result of the filters that have been applied? I've seen this example, which doesn't seem to apply to yadcf, but is similar to my use-case.
I was able to get the information I wanted using the answer found here. I didn't realize that jQuery will select only the visible elements, which is what I want. So, after applying the yadcf filter to my table it's simple to select all the tr.id values resulting from the filter.
Yes, the submit content is only the visible row with datatables.
If you have 5 rows and after filter 2 rows, if you click on submit button with the active filter only 2 rows will be submitted.
And if, conversely, you still wanted to submit all the elements of the table despite the filtering, on the onsubmit there is a yadcf function that you just have to execute which deactivates all active filtering to submit the entire table like this :
var table = $('#mytable').DataTable( {}) ;
document.onsubmit = function(){
yadcf.exResetAllFilters(table) ;
};

How to update rows / set row data in server side row model type in ag grid?

My data model looks like this. Array of objects containing title and created_date.
{
title : String
created_date: Date
}
I have defined a column definition which only renders the title. However, I'd like to sort the rows based on the created_date, without creating a created_date column. There will be an external button detached from the table, which will call the api to get the data. I am using row model type serverSide. I have the sorted data from the backend. I just need to update the data / refresh the data. How can I achieve this ? I have so far tried setRowData(updatedRows). but its giving me an error saying cannot call setRowData unless using normal row model. Is there any way to update my rows in this serverSide row model type settings ?
Calling this.gridApi.setServerSideDatasource(myDataSource); and passing in your dataSource will do the trick. Check here for details

APEX 4.0 - How to load items when using select

I have a question about APEX, I have the problem that when I try to select a value from a selectbox, no value shows in the other items. What I have tried to do is loading data from the database to the items when I select a code from the selectbox with PL/SQL. How do I do this? Selecting a code from a selectbox and filling all the other items?
Vid
Ok if i understand you right you need a List of Values.
If you create this shared Object. Use a dynamic list.
There you have a dialog you can put a PL/SQL or SQL Code snippet into.
You must return a 2 column list. The first Column is the field name in you later select box and the second is you reference.

SAPUI5 table: get none-displayed values of selected row?

I have a SAPUI5 (OpenUI5) application with a table. This table is bound to a (JSON) model and display the name of the entity and some other attribute - but not the technical key.
The user should have the opportunity to select multiple lines in the table and the application should then be able to get the technical keys of the selected lines (probably using the underlying model).
How would I do such a thing?
Thanks in advance!
The rowSelectionChange event has a rowContext attribute. A better approach would be
rowSelectionChange: function(oEvent) {
console.log(oEvent.getParameters().rowContext.getProperty("your_key"));
}
to obtain the value of your key (or any field in the selected row by adapting the getProperty value accordingly)
when you will select a row in a table, there is a event called "rowSelectionChange". Use this event and getSelectedInedx of row.
Using the index value loop over your json and get values selected row.

Axapta: Programmatically switch records in a form

In Dynamics AX 2009, how do you programmatically change to a different record in a form?
My form contains a treeview and a group of bound data fields. When clicking on a record in the tree (the data value for each item in the tree is the RecId of the item I'd like to edit in the form) I'd like to change the form to that record.
I've been using sysSetupForm as an example for working with a tree, but I'm having trouble isolating where the call to change records occurs in their code.
Thanks
Some example:
some_table table;
;
table = some_table:find(recid);
table_ds.findRecord(table); // it's a form datasource method