In this code I'm trying to create a join in ArcGIS Pro between two separate feature layers. Then look for changes in the data between the two layers and do something when it finds the changes. However, when I try to do the join in the Script, the join doesnt work, BUT if i run that same piece of code for the join in the Python window in ArcGIS Pro the join work. The Script does not fail either it says it successfully completed, but there is no join.
I'm sure it's something simple. Hope someone can help!
# Brings in data to map
#sets the map and project location
aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.listMaps("Map4")
#Adds the downloaded parcels
arcpy.AddJoin_management("NEW", "APN", "testingg_3", "APN", "KEEP_COMMON")
#arcpy.management.AddJoin("NEW", "APN", "testingg_3", "APN", "KEEP_COMMON")
s = arcpy.SearchCursor('NEW')
for row in s:
if row.getValue("testingg_2.Status_5") != row.getValue("testingg_3.Status_5"):