Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

addNew Multi-step generated errors

Avatar

Former Community Member
LifeCycle Designer 7.1

Im connected to a SQL Server database table



using xfa.sourceSet.DataConnection.addNew()



As per help "Attaching a database script to a button"



when I use



xfa.sourceSet.DataConnection.update()

I get Error: Multi-step operation generated errors



Previous Next First Last all work



How do you add a new record?
4 Replies

Avatar

Former Community Member
Hmm.. does you data connection contain a field that's an auto generated number in the database?



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
Yes it does (start 1 step 1). I don't use it any were in the pdf form.

It is also the primary key.

All the other other fields can be null

Avatar

Former Community Member
You can't use an auto generated field in your data connection. The problem is when you do the update() call it tries to write the value in the field to the database, but the database considers this a read only field and throws an error.



You should modify the SQL query for your data connection so that it returns all the fields you want without the auto number field and let the database handle setting the value for that field.



Chris

Adobe Enterprise Developer Support