TypeError: Error #1034: Type Coercion failed: cannot convert Object@ee7f749 to com.esri.ags.Graphic. at com.esri.ags.layers::FeatureLayer/http://www.esri.com/2008/ags/internal::editHandler() at mx.rpc::AsyncResponder/result() at com.esri.ags.tasks::FeatureLayerTask/handleApplyEdits() at Function/http://adobe.com/AS3/2006/builtin::call()
_accountObject= { "attributes": { "OBJECTID":null, "LASTNAME":txtLastName.text, "FIRSTNAME":txtFirstName.text, "EMAILADDRESS":txtEmailAddress.text, "PHONENUMBER":txtPhoneNumber.text, "CREATIONDATE": new Date().toString(), "LASTUPDATE": new Date().toString() } }
_accountTable.applyEdits([_accountObject], [], [], new AsyncResponder(applyEditsResults, applyEditsFault));
Royce, I Believe you need to submit a graphic to the applyedits no matter what as in this sample:http://help.arcgis.com/en/webapi/flex/samples/index.html#/Editing_a_related_table/01nq00000020000000/
private function voteImage_clickHandler(event:MouseEvent):void { const voteRecordAttributes:Object = { sf_311_serviceoid: selectedGraphic.attributes.objectid, datetime: new Date().getTime(), agree_with_incident: 1 }; const voteRecord:Graphic = new Graphic(null, null, voteRecordAttributes); const incidentVoteTable:FeatureLayer = new FeatureLayer("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/1"); incidentVoteTable.addEventListener(FeatureLayerEvent.EDITS_COMPLETE, incidentVoteTable_editsCompleteHandler); incidentVoteTable.applyEdits([ voteRecord ], null, null); }
Royce, So have you tried to submit a graphic that has a null for geometry as in the sample (which by the way is editing a related Flat table). private function voteImage_clickHandler(event:MouseEvent):void { const voteRecordAttributes:Object = { sf_311_serviceoid: selectedGraphic.attributes.objectid, datetime: new Date().getTime(), agree_with_incident: 1 }; const voteRecord:Graphic = new Graphic(null, null, voteRecordAttributes); const incidentVoteTable:FeatureLayer = new FeatureLayer("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/1"); incidentVoteTable.addEventListener(FeatureLayerEvent.EDITS_COMPLETE, incidentVoteTable_editsCompleteHandler); incidentVoteTable.applyEdits([ voteRecord ], null, null); }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.