<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Save user input to database? in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-user-input-to-database/m-p/603437#M13438</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;This seems the way to go Casey. Do you more examples or a more complete example that you can share? Thank you so much!&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This should get you on your way.&amp;nbsp; Just modify it to handle your workflow and data&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
private var inspections:FeatureLayer = new FeatureLayer("http://" + Model.instance.serverHost + "/ArcGIS/rest/services/Delivery/T_Inspections/FeatureServer/1");
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; protected function init():void{
&amp;nbsp;&amp;nbsp;&amp;nbsp; inspections.addEventListener(FeatureLayerEvent.EDITS_COMPLETE, inspections_editsCompleteHandler);
&amp;nbsp;&amp;nbsp;&amp;nbsp; inspections.addEventListener(FeatureLayerEvent.EDITS_STARTING, inspections_editsStartingHandler);
&amp;nbsp;&amp;nbsp;&amp;nbsp; inspections.addEventListener(FaultEvent.FAULT, inspections_faultHandler);
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; /* function used to create inspection records */ 
&amp;nbsp;&amp;nbsp; protected function btn_createInspection_clickHandler(event:MouseEvent):void{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Modify this portion to meet your requirements. 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; const inspection:Object = {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GISONUMBER: item.GISONUMBER.toString(),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INSPECTIONDATE: df_dateInspected.selectedDate.time,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PATROLMANID: dd_patrolmanID.selectedItem.PATROLMANID.toString(),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PATROLTYPE: dd_patrolType.selectedItem.TYPECODE.toString(),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LINENUMBER: dd_lineNumber.selectedItem.ID.toString()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; const g:Graphic = new Graphic(null,null,inspection);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inspections.applyEdits(&lt;G&gt;, null, null, true);
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; /* function used to handle when editing of inspections starts */
&amp;nbsp;&amp;nbsp; protected function inspections_editsStartingHandler(event:FeatureLayerEvent):void{
&amp;nbsp;&amp;nbsp;&amp;nbsp; CursorManager.setBusyCursor();
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; /* function used to handle when editing of inspections completes */
&amp;nbsp;&amp;nbsp; protected function inspections_editsCompleteHandler(event:FeatureLayerEvent):void{
&amp;nbsp;&amp;nbsp;&amp;nbsp; try{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var flag:Boolean = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var result:FeatureEditResult;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for each(result in event.featureEditResults.addResults){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!result.success)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flag = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(flag)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Alert.show('Created - ' + event.featureEditResults.addResults.length.toString() + ' inspection records', 'info');
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Alert.show('Some inspection records failed to create, rolling back edits','warning');
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CursorManager.removeBusyCursor();
&amp;nbsp;&amp;nbsp;&amp;nbsp; }catch(error:Error){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CursorManager.removeBusyCursor();
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; /* function to handle when editing inspections faults */
&amp;nbsp;&amp;nbsp; protected function inspections_faultHandler(event:FaultEvent):void{
&amp;nbsp;&amp;nbsp;&amp;nbsp; Alert.show(event.fault.faultDetail, 'fault');
&amp;nbsp;&amp;nbsp;&amp;nbsp; CursorManager.removeBusyCursor();
&amp;nbsp;&amp;nbsp; }

&lt;/G&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 01:52:27 GMT</pubDate>
    <dc:creator>CaseyBentz</dc:creator>
    <dc:date>2021-12-12T01:52:27Z</dc:date>
    <item>
      <title>Save user input to database?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-user-input-to-database/m-p/603432#M13433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have one dropdown box that contains county names and one text input asking for number of acres. Does anybody have any examples or have any ideas on how I can save this information to a geodatabase once the user enter this information? It does not need to be shown on the map, just to be saved in a database. I have 10.1 Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 16:23:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-user-input-to-database/m-p/603432#M13433</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-02-04T16:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Save user input to database?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-user-input-to-database/m-p/603433#M13434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What kind of database do you have to store it in?&amp;nbsp; If it is an SDE database you could used ArcGIS Server and a Feature Layer.&amp;nbsp; If it is a non geodatabase database like SQLite or something like that, you could use a web service.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 20:26:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-user-input-to-database/m-p/603433#M13434</guid>
      <dc:creator>CaseyBentz</dc:creator>
      <dc:date>2013-02-05T20:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: Save user input to database?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-user-input-to-database/m-p/603434#M13435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do I have to create the webservice in Visual Studio? If so, I would prefer to use a geodatabase. Do you know of any examples? But I dont want the user to add anything on the map. Just to enter the answer in the dropdown menu and text input and that would be saved in the database. Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 20:31:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-user-input-to-database/m-p/603434#M13435</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-02-05T20:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Save user input to database?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-user-input-to-database/m-p/603435#M13436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Do I have to create the webservice in Visual Studio? If so, I would prefer to use a geodatabase. Do you know of any examples? Thanks&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For a web service, you would have to use visual studio or visual web developer express.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you have an SDE geodatabase, you can just create a table, register it with the geodatabase and register it as versioned.&amp;nbsp; Then add it to an MXD, publish it to ArcGIS Server with Feature Access enabled.&amp;nbsp; Then in your Flex application you can create a feature layer pointed at the service.&amp;nbsp; Then each time a user enters a value, you can create an object with the same fields as your table and add it to the graphic.attributes.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; var inspections:FeatureLayer = new FeatureLayer("http://" + Model.instance.serverHost + "/ArcGIS/rest/services/Delivery/T_Inspections/FeatureServer/1");&amp;nbsp; inspections.addEventListener(FeatureLayerEvent.EDITS_COMPLETE, inspections_editsCompleteHandler); inspections.addEventListener(FeatureLayerEvent.EDITS_STARTING, inspections_editsStartingHandler); inspections.addEventListener(FaultEvent.FAULT, inspections_faultHandler);&amp;nbsp;&amp;nbsp; var arr:Array = new Array(); for each(var item:Object in l_structures.selectedItems){&amp;nbsp; const inspection:Object = { GISONUMBER: item.GISONUMBER.toString(), INSPECTIONDATE: df_dateInspected.selectedDate.time, PATROLMANID: dd_patrolmanID.selectedItem.PATROLMANID.toString(), PATROLTYPE: dd_patrolType.selectedItem.TYPECODE.toString(), LINENUMBER: dd_lineNumber.selectedItem.ID.toString() };&amp;nbsp; const g:Graphic = new Graphic(null,null,inspection); arr.push(g); } inspections.applyEdits(arr, null, null, true);&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 20:48:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-user-input-to-database/m-p/603435#M13436</guid>
      <dc:creator>CaseyBentz</dc:creator>
      <dc:date>2013-02-05T20:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Save user input to database?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-user-input-to-database/m-p/603436#M13437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This seems the way to go Casey. Do you more examples or a more complete example that you can share? Thank you so much!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 21:08:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-user-input-to-database/m-p/603436#M13437</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-02-05T21:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: Save user input to database?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-user-input-to-database/m-p/603437#M13438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;This seems the way to go Casey. Do you more examples or a more complete example that you can share? Thank you so much!&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This should get you on your way.&amp;nbsp; Just modify it to handle your workflow and data&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
private var inspections:FeatureLayer = new FeatureLayer("http://" + Model.instance.serverHost + "/ArcGIS/rest/services/Delivery/T_Inspections/FeatureServer/1");
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; protected function init():void{
&amp;nbsp;&amp;nbsp;&amp;nbsp; inspections.addEventListener(FeatureLayerEvent.EDITS_COMPLETE, inspections_editsCompleteHandler);
&amp;nbsp;&amp;nbsp;&amp;nbsp; inspections.addEventListener(FeatureLayerEvent.EDITS_STARTING, inspections_editsStartingHandler);
&amp;nbsp;&amp;nbsp;&amp;nbsp; inspections.addEventListener(FaultEvent.FAULT, inspections_faultHandler);
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; /* function used to create inspection records */ 
&amp;nbsp;&amp;nbsp; protected function btn_createInspection_clickHandler(event:MouseEvent):void{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Modify this portion to meet your requirements. 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; const inspection:Object = {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GISONUMBER: item.GISONUMBER.toString(),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INSPECTIONDATE: df_dateInspected.selectedDate.time,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PATROLMANID: dd_patrolmanID.selectedItem.PATROLMANID.toString(),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PATROLTYPE: dd_patrolType.selectedItem.TYPECODE.toString(),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LINENUMBER: dd_lineNumber.selectedItem.ID.toString()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; const g:Graphic = new Graphic(null,null,inspection);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inspections.applyEdits(&lt;G&gt;, null, null, true);
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; /* function used to handle when editing of inspections starts */
&amp;nbsp;&amp;nbsp; protected function inspections_editsStartingHandler(event:FeatureLayerEvent):void{
&amp;nbsp;&amp;nbsp;&amp;nbsp; CursorManager.setBusyCursor();
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; /* function used to handle when editing of inspections completes */
&amp;nbsp;&amp;nbsp; protected function inspections_editsCompleteHandler(event:FeatureLayerEvent):void{
&amp;nbsp;&amp;nbsp;&amp;nbsp; try{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var flag:Boolean = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var result:FeatureEditResult;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for each(result in event.featureEditResults.addResults){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!result.success)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flag = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(flag)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Alert.show('Created - ' + event.featureEditResults.addResults.length.toString() + ' inspection records', 'info');
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Alert.show('Some inspection records failed to create, rolling back edits','warning');
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CursorManager.removeBusyCursor();
&amp;nbsp;&amp;nbsp;&amp;nbsp; }catch(error:Error){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CursorManager.removeBusyCursor();
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; /* function to handle when editing inspections faults */
&amp;nbsp;&amp;nbsp; protected function inspections_faultHandler(event:FaultEvent):void{
&amp;nbsp;&amp;nbsp;&amp;nbsp; Alert.show(event.fault.faultDetail, 'fault');
&amp;nbsp;&amp;nbsp;&amp;nbsp; CursorManager.removeBusyCursor();
&amp;nbsp;&amp;nbsp; }

&lt;/G&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:52:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-user-input-to-database/m-p/603437#M13438</guid>
      <dc:creator>CaseyBentz</dc:creator>
      <dc:date>2021-12-12T01:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Save user input to database?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-user-input-to-database/m-p/603438#M13439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok Casey! Thanks a lot! This will help me tremendously!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 15:49:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-user-input-to-database/m-p/603438#M13439</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-02-06T15:49:21Z</dc:date>
    </item>
  </channel>
</rss>

