I created a python add-in which makes analyses like spatial join, update cursor and make feature layer. But when editing is open for a layer. I get this error.
Line 289, in onClick for rec in recs:
RuntimeError: The operation is not supported within an edit session.
targfields3 = ['SHAPE', 'yapi_id', 'mahalle_id', 'YOL_ID', 'Yol_id_butun', 'YOL_ADI'] with arcpy.da.UpdateCursor('KAPI selection', targfields3) as recs: for rec in recs: keyval = rec if joindict3.has_key(keyval): rec = joindict3[keyval] rec = joindict3[keyval] rec = joindict3[keyval] rec = joindict3[keyval] rec = joindict3[keyval] else: rec = 0 rec = 0 rec = 0 rec = 0 rec = 0 recs.updateRow(rec) del rec, recs
This is the operation mentioned in error.
While making this analyses manually, when edit is open on arcmap, I get no error.
I have to work with this python add-in while edit is on. So, solving this error is crucial for me.