Error executing code: Wrong argument types in variable assignment.

Good day guys,

I have implemented a new button on PurchLineBackOrderListPage which resets all BackOrder Quantity to zero from selected lines. I used a Dialog class to get the selected records from the form using the following code:

private void UpdateBO(Args _args)

{

Counter i;

Dialog dialog;

DialogText dialogTxt;

DialogButton dialogBtn;

FormRun caller;

FormDataSource formDS;

MultiSelectionHelper helper;

PurchLine purchLine;

;

dialog = new Dialog();

caller = _args.caller();

helper = MultiSelectionHelper::createFromCaller(caller);

dialogTxt = dialog.addText(‘Deseja atualizar as quantidades pendentes das linha selecionadas?’);

if (dialog.run())

{

for (i = 1; i <= caller.dataSourceCount(); i++)

{

formDS = caller.dataSource(i);

formDS.name();

if (formDS.name() == ‘PurchLine’)

{

break;

}

}

helper.createQueryRanges(formDS.queryBuildDataSource(), fieldStr(purchLine, RecId));

purchLine = helper.getFirst();

while (purchLine)

{

info(strFmt(’%1’, purchLine.RecId));

purchLine = helper.getNext();

}

}

}

But then I get the following error:

Error executing code: Wrong argument types in variable assignment.

I understand that this error happens on “purchLine = helper.getNext()” but I really don´t understand why. Help please.
If my description is not understandable please tell me.