System name in dialog

When we add field in dialog like :

dSchemeCode = dialog.addField(extendedTypeStr(SchemeCode), “Scheme ccode”);

we get a system generated name like Fld1_1 for this control .

Is possible to change this System name to SchemeCode ?

Not without a change in DialogField class, especially in fieldName() method.

Please explain how to use fieldName() method in order to give ID to a field located inside a dialog.

You can see that fieldName() is what defines the control name:

str fieldname(int arrIdx = 1)
    return #PrefixField+int2str(fieldNo)+'_'+int2str(arrIdx);

You will have to return another name from there. You’ll also need a way how to pass the required name to DialogField, store it in an instance variable and extend #CurrentList so the variable is packed/unpacked properly.