Using arcpy.da.InsertCursor, what is the best way to capture the ObjectId value of the row that was just inserted?
<SPAN class="keyword token">with</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>SearchCursor<SPAN class="punctuation token">(</SPAN>finalFC<SPAN class="punctuation token">,</SPAN> fieldnames<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'OBJECTID = {}'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>oid<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> fscur<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">for</SPAN> fsrow <SPAN class="keyword token">in</SPAN> fscur<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">with</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>InsertCursor<SPAN class="punctuation token">(</SPAN>scratchFC<SPAN class="punctuation token">,</SPAN> fieldnames<SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> icur<SPAN class="punctuation token">:</SPAN>
icur<SPAN class="punctuation token">.</SPAN>insertRow<SPAN class="punctuation token">(</SPAN>fsrow<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">#I need to capture the OBJECTID value of the row that was just inserted in the line above</SPAN>
<SPAN class="keyword token">del</SPAN> icur<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>