Dynamics Ax 2012 Bring all Record except 1 - filter

I made a new form and add grid. Add Datasource to grid to show records but I want to show all records without Enum::No so (All Records - Enum Value No One)
Thanks

You need overwrite the init method of your datasource and add this
Option 1
this.query().dataSourceTable(tablenum(YourDataSource)).addRange(fieldnum(YourDataSource, YourField)).value(strfmt('!%1',enum2str(YourEnum::YourOption)));
Option 2
this.query().dataSourceTable(tablenum(YourTable)).addRange(fieldnum(YourTable, YourField)).value(enum2Str(Enum::Yes));

I wrote this in the init method of Form
MYTABLE_ds.query().dataSourceTable(tableNum(MYTABLE)).addRange(fieldNum(MYTABLE,MYFÄ°ELD)).value(strFmt("!%1",enum2str(ENUM::No)));
This solution worked too

Related

Power Automate - Flow adding duplicate entries

I have 2 SharePoint sites (SiteA and SiteB) In siteA I have an excel file called LocationA, when this file is edited (rows added, rows edited or rows deleted) I want to reflect these changes in another excel file called LocationB which is stored in SiteB (I have not added the delete operation yet but suggestions on how I might do so are welcomed).
The issue is that the flow is adding rows instead of updating the existing rows in LocationB.
Please find my flow below (it is running without errors but the output is the problem)
Note
The expression in the filter array is string(items('Apply_to_each')?['ID']) which changes the ID field to String
The expression in condition 2 is empty(body('Filter_array')) this condition checks if the list item exists in excel
Because you are using the action to add a row in the power automate, you need to change the action for example, Update a row. That will work.

how to change columns position in vb6?

I am working with a spread designer in visual basic 6 and am looking to change the display index of my table. I am adding extra columns and I need to rearrange them to match another form.
I am using visual basic 6 with spread designer 6.0
I have tried the below when loading the form:
lstTheLines.Col(1).DisplayIndex = 1
lstTheLines.Columns(25).DisplayIndex = 2
does anyone know how to do this without having to delete and re-add all columns?
The best way I found so far was to add the columns in the place I want using the spread designer and create an Enum in the code for each column index. This way I can give the columns a name and use that instead when populating the data. The benefit to this is that I can now rename the columns or add new ones and I just need to change the names around in the Enum given that the column type is correct.

GWT (smartgwt) grid sort selected records top

I have a grid where the user can select records via checkbox in front of every record. Now I have a requirement to sort the records based on their selection, so that all selected records should be placed top, followed by the not selected ones.
Is there any standard function to achieve this? As an alternative I thought of saving the selection state as an attribute on every record and sort based on the attribute.
The code for the column is:
gridRealmDt.setSelectionType(SelectionStyle.SIMPLE);
gridRealmDt.setSelectionAppearance(SelectionAppearance.CHECKBOX);
I try to describe the code I use as the affected code is deeply nested in our own framework classes.
gridRealmDt is a subclass of smartgwt ListGrid. In my Dialog a create an instance of the grid which creates an instance of a database bound datasource. When the dialog is loaded the records are fetched from the database and after that a registered an dataArrivedHandler where I select the records which match records from another table.
I tried to place the selection attribute in an extra field and use that for sortig before my other sort criteria, but this does not work. Here is the code for the field I am using.
ListGridField txtSelected = new ListGridField(SELECTED, "");
txtSelected.setHidden(true);
txtSelected.setSortByDisplayField(true);
txtSelected.setCanSortClientOnly(true);
When I do not set the canSortClientOnly property the order by is sent to my database resulting in an error, as the table does not contain that field, so I set the property. Now I get following error
Removing field from the sort Specifier array because it specifies canSort Client Only: true and all data is not yet client-side.
I also tried to use a sortNormilizer on the Name field which is my main sort criteria, but the normalizer is called before the selection value is set to the record.
record.setAttribute(CARealmDS.SELECTED,selected ? "a" : "b");
I also cannnot find a way to call the normalizer when selection changes.
Currently we are using Smart GWT Version 6.0p.
I don't think there is any standard function. Just use grid store update. Place checked items first.

Slickgrid - get only updated/changed columns

I am using Slickgrid first time for CRUD table.
I am calling a rest service for data update from the function
grid.onCellChange.subscribe(function (e));
In this function, I want to get only changed columns/data.Right now, I am getting all of the data/columns for that row.
I am sure it is possible but I don't seem to find any method :(
This solved my problem:
item[grid.getColumns()[col].field]

changing JQgrid column name dynamically

I just need to rename JQgrid column dynamically as per user selection from a list of options. How can I do that?
You can use this syntax:
jQuery("#grid1").jqGrid('setLabel', 0, 'NewLabel');
This will change first column name to NewLabel in your grid with id=grid1.
The latest version of jqGrid (4.1+ - possibly earlier) no longer appears to support the column index based setLabel approach described by Galichev, a columnName based approach is provided instead:
jQuery("#grid1").jqGrid('setLabel', 'columnName', 'NewLabel');
See the jqGrid Methods wiki for more information.
I've left the previous answer unedited as this approach may be valid in versions prior to 4.1.
According to the jqGrid Documentation, colNames cannot be changed after the grid is created.
However, you might be able to simulate a column name change by using several columns. Then you can hide all of them except a single one which will be shown to the user. When the user selects another, just swap in the selected column. For example, if valid columns are [A, B, C, D] you might start by only showing A. Then if the user chooses C, hide A and show C. The main disadvantage to this approach is that you will need to copy the same data to many columns, however.
Update
Per Galichev's answer, you can use the setLabel method to rename a column header.
*setLabel : * colname the name of the column (this parameter can be a number (the index of the column) beginning from 0
However the index param does not work with version 4.1 and above.
Jqgrid uptop version 4.0
$(tableId).jqgrid("setLabel", 0, "BBBBB");
Jqgrid version 4.1 and above
Try using these
$(tableId).setLabel("ColumnName", "AAAAA");
or
$(tableId).jqgrid("setLabel", "ColumnName", "BBBBB");
JQGrid1.Columns.FromDataField(ColumnName).HeaderText = ColumnName;
I gave my column name a div
'<div id="DateDivId">Date</div>'
Then I just changed it the normal way, getElementById, change contents.

Resources