When I try to calculate a new field with:
idx = layer.fieldNameIndex(attributeName)
I receive the following error:
AttributeError: 'QgsVectorLayer' object has no attribute 'fieldNameIndex'
What´s the problem? I'm using QGIS 3.0.1 64x in Windows.