It looks like this thread never really got an answer and it popped up on a search for me, so I'll repost my solution to this problem from another thread...If you have enabled the Local Government Information Model on your parcel fabric, which you would have if you want to use the Tax Parcel Editing Template, then there is no "Parcels" sub-layer in the fabric. This is why the following line fails:parcels = r"%s_Layer\Parcels"%(name)
With the LGIM enabled on the parcel fabric, there is a sub-layer called "Tax Parcels", which is what you want to use. So change the line I mentioned before to:parcels = r"%s_Layer\Tax Parcels"%(name)
Also, the Tax Parcels sub-layer has already queried out historical parcels, so the query in the following line will return 0 parcels so none will be appended to the parcels publishing feature class:arcpy.management.SelectLayerByAttribute(parcels, "NEW_SELECTION", """Type = 7 AND Historical = 0""")
So remove AND Historical = 0 from the query to get the proper results. I suppose you could even completely remove the Select Layer By Attributes line because the Tax Parcels sub-layer has already been queried to only include Type 7. These are the things I had to do to get the script working, I hope this helps anybody with this problem.