Select to view content in your preferred language

Why am I receiving an "Unable to perform applyEdits error?

5636
20
Jump to solution
04-22-2015 01:34 PM
ChrisSergent
Regular Contributor III

I have an application where I am using the editing functionality. It works as long as I enter information for all fields, but if any field are missing information, I receive Unable to perform applyEdits error.

My live application is at:http://maps.decaturil.gov/streetsignshttp://geonet.esri.com/

My github project is at: https://github.com/csergent45/streetSigns/tree/176dbb8a76f3773964ab25987f8e4f8cabcc9308

and here is the error that I am receiving:

streetSignsError.png

If I enter data in for all fields, the application runs without a hitch. The JavaScript file is in the app folder named main.js.

Any ideas?

Tags (2)
0 Kudos
20 Replies
ChrisSergent
Regular Contributor III

I had this issue in .NET and was able to fix it by removing the '' or replacing them in my insert statements, but I am not sure how to do that in JavaScript.

0 Kudos
williamcarr
Occasional Contributor II

I would try editing all the values in your input,

(<input id="location" name="location" value="Under your nose" type="text">)

to ones that fit your schema just to ensure it is not the issue. I did notice that your "Name" field had the type set to "email" not sure if that could be a validation issue, but it could be worth double checking.

ChrisSergent
Regular Contributor III

That's actually the feedback form from the project that I have been converting. I haven't been using that form.

0 Kudos
KyleMorgan
New Contributor III

I would look into using native Dojo form elements to properly validate against.  It will allow for rule enforcement like number and date values in the proper fields.

0 Kudos
KyleMorgan
New Contributor III

Your GITHUB should now have a pull request addressing the form validation for the 3 problem children.

Also, note the changes reflect being ran against JSHint and addressing the errors that appeared.

ChrisSergent
Regular Contributor III

Thanks. I modified your code and I no longer have to enter any data. Check it out:

if ((attributes.supportId === undefined) || (attributes.supportId === "")) {
            attributes.supportId = null;
        }
        if ((attributes.dateInv === undefined) || (attributes.dateInv === "")) {
            attributes.dateInv = null;
        }
        if ((attributes.addrCode === undefined) || (attributes.addrCode === "")) {
            attributes.addrCode = null;
        }       
0 Kudos
KyleMorgan
New Contributor III

As long as your back-end database supports it and the data structure doesn't panic on joins, should be fine.

ChrisSergent
Regular Contributor III

Good point. We will have to address that with real data.

Do you know how to do a git pull? I need to merge my data to my local project.

0 Kudos
KyleMorgan
New Contributor III

Are you talking about a local change or my pull request?

Usual workflow...

/repository <user>$ git pull

For working on a branch... <Recalling from memory so I may be off... Anyone, please correct me where wrong.>

/repository <user>$ git checkout -b <branch name>

/repository <user>$ git branch

  master

* <branch name>

[ do some work ]

/repository <user>$ git commit -a -m "Comments"

[ when ready to commit to master... ]

/repository <user>$ git checkout master

/repository <user>$ git fetch upstream // In case there is work outside of your commits.

/repository <user>$ git merge upstream

/repository <user>$ git merge <branch name>

/repository <user>$ git push

/repository <user>$ git branch -d <branch name>

ChrisSergent
Regular Contributor III

I got it to work. Guessed at it, but I will bookmark this, just in case I run into the issue again. Thanks.

0 Kudos