"Error: class name should be specified" when saving object in backendless from form

Error class name should be specified

I don’t know what to change. I followed this video ‘Database Integration - Saving data in the database’ from Mark on youtube. Changed a few minor things.

Regards,
Thomas

Could you please show your codeless logic?

I got it to work. My mistake was to use get property from select to determine table name without converting it to text.

I do have another question. How can i use the uploadbutton to instanly upload a file to my database instead of to my files?

Regards,
Thomas

Files belong to file system. Storing files in the database is a bad practice (IMHO). Instead, I recommend saving file in the file storage, get its URL and save the url in the database.

Thats what i have been doing manually now, how can i automate this? When the button is pressed it saves the files, gets the url and stores it in the correct column.

Regards,
Thomas

The logic should do exactly what you described:

  1. Upload file - the response will get you the URL
  2. You take the URL, put it into the object to save in the database
  3. Use the Codeless block to save the object.

Regards,
Mark

Hey Mark,

So i have been testing it a bit. And i wish i could say i figured it out but alas. Since i’m using the file uploader button in my form not the codeless block from file api. how can i retrieve the url response after the file is uploaded? I’m assuming it gets stored in page data but i need the property of the button to acces it and i’m at a loss with that.

Regards,
Thomas

Hi Thomas,

The File Upload control has the following event:

The event is invoked when the file is uploaded. One of the context blocks is the URL of the uploaded file.

What you can do is put that value into a property in Page Data and then have a hidden element in the form that is bound to the same property. This way when the form is submitted, you will have the URL as a part of the form data.

Hope this helps.

Regards,
Mark