Translated the program from Delphi 7 to Delphi Berlin
Hi All,
Our team translated the program from Delphi 7 to Delphi Berlin. After that, some of the functions in the TestComplete that worked on Delphi 7 now do not work. There is a function that searches for a column in the grid, and then remembers the value of the field in that column.
function GetGridVal_alt(mgrid: OleVariant; colname: WideString): WideString; var FldName: string; i: integer; GridView, a: OleVariant; begin //для DevExpress if mgrid.WndClass = 'TcxGrid' then begin GridView:= mgrid.Views[0]; for i := 0 to GridView.ColumnCount-1 do // Check the column caption if GridView.Columns[i].Caption = colname then begin FldName:= GridView.Columns[i].DataBinding.FilterFieldName; Result:=GridView.Columns[i].DataBinding.DataController.DataSet.FieldByName(FldName).AsString; Exit; end; end; end;
The required column is found by the function. But at the output of the value it stops with an error. This derivation of the value from the grid corresponds to this line:Result:=GridView.Columns[i].DataBinding.DataController.DataSet.FieldByName(FldName).AsString;
We need to rewrite it somehow, that she would work for Delphi Berlin. Help me please.
It sounds like, then, the control has changed in some way with the translation so that the "FieldByName" property/method is not longer available under the data set. What to use instead... I don't know. Here is where you need to drop a breakpoint on that line in TestComplete and use the Evaluation tool (https://support.smartbear.com/testcomplete/docs/testing-with/debugging/general-info/dialogs/evaluate.html) to see if you can find what property/Method is available.