My original question stemmed from my trials and errors. I wanted to know the credit usage because I tried to publish the FGDB one way and CVDs were not transferring for some reason. I have since found the reason that the CVDs did not publish (a bug of course). I have also found a solution. I have also found that this whole process is costing me essentially no credits (less than one).
- Once the DB was ready for field collection, it was published as a service to AGOL
a. ArcMap 10.2 has a bug. There are multiple ways to publish an entire database as a hosted service from the desktop to AGOL, however you have to do it one specific way in order for the coded value domains to upload properly. The steps are as follows:
i. Add all data to be published to ArcMap, remove all data that should not be published from ArcMap
ii. Symbolize everything appropriately
iii. BEFORE YOU PUBLISH: follow best practice for publishing and sharing on AGOL http://video.esri.com/watch/1702/arcgis-online-best-practices-for-publishing-and-sharing Some key points include:
Finalize schema
Make sure data is in Web Mercator Auxiliary Sphere projection
Be sure to include robust metadata
iv. Sign into AGOL from ArcMap: File> Sign In
v. Share as a service: File> Share As > Service
vi. Follow instructions in box depending on the database requirements
- For this particular project, I shared as a feature service with ALL editing capabilities
vii. From AGOL, sign in and navigate to the feature service in Content
viii. Edit the feature service to allow editing, delete protection, sync, and any other custom options necessary.
- For this particular project, I allowed all editing, exportation, sync, and tracking edits
ix. Add feature service to map
Test to be sure that all CVDs work and that the feature service handles edits properly.
The feature service hosted on AGOL is now a separate entity from the database it was published from. In order to edit the feature service on AGOL, follow these steps:
a. Sign into AGOL from ArcMap: File> Sign In
b. Open the Catalog and navigate to My Hosted Feature Services
c. Add feature service to map
d. List the table of contents by drawing order
e. Right-click on the feature service name > Edit Features > Create Local Copy for Editing
f. Edit Features
Best Answer
Your code is close, but there are a few things you're doing wrong with the properties you're passing into each call. Try the below code (specifically updating what you're passing for the properties and not passing in the itemId to the
publish
... the item itself knows which item it is, thus you don't need to give it this).