Specifying the replacementFieldGroup doesn't help either, but actually i am more close to the issue now:
I just wrote a simple job with one dialog field. This does actually work fine, as expected
Dialog dialog = new Dialog();
dialog.addField(identifierStr(SalesTaker));
dialog.run();
The difference is, that in DialogField\init FormBuildControls are used. So i just modified the init like this:
public void init()
{
FormBuildReferenceGroupControl buildCtrl;
buildCtrl = element.form().addControl(FormControlType::ReferenceGroup, 'tmp');
buildCtrl.extendedDataType(extendedTypeNum(SalesTaker));
super();
}
That does actually work, BUT if i try to modify the control after super(), the control isn't updated.
public void init()
{
FormBuildReferenceGroupControl buildCtrl;
FormReferenceGroupControl ctrl;
buildCtrl = element.form().addControl(FormControlType::ReferenceGroup, 'tmp');
buildCtrl.extendedDataType(extendedTypeNum(SalesTaker));
super();
ctrl = element.design().controlName('tmp');
ctrl.extendedDataType(extendedTypeNum(DirPartyRecId));
//ctrl.resolveReference();
}
Calling resolveReference() does open the correct lookup, but lookupReference() results in an infolog message.
There seems to be no way to update the reference or i didn't find it yet :(