Getting Error while Save 1001

Hello Team,

Kindly help me on saving/insert new data in table.

error–>1001
msg–>Cannot update object without any properties: flatno
detila–>null

Backendless.Persistence.save( Complaintdtl, new AsyncCallback<Complaintdtl>() {
public void handleResponse( Complaintdtl response )
{
// new complaint instance has been saved
Toast.makeText( getApplicationContext(), “Complaint Registered Successfully”, Toast.LENGTH_SHORT ).show();
}

                  public void handleFault( BackendlessFault fault )
                  {
                    // an error has occurred, the error code can be retrieved with fault.getCode()
                      Toast.makeText( getApplicationContext(),fault.getCode(), Toast.LENGTH_SHORT ).show();
                    }                    
                });

Can any one help me on this please

The error message tells you what’s wrong: “Cannot update object without any properties”

Hello Mark,

I have checked passed Complaintdtl object variable , all values present under Complaintdtl object.
but still getting this error.
Kindly help me.

The values might be present, but are they accessible publicly?

yes,

private View.OnClickListener sendButtonListener = new View.OnClickListener()
{
@Override
public void onClick( View view )
{

           Complaintdtl complaintdtl = new Complaintdtl();
           
           complaintdtl.setcomplaint(complaintmsg.getText());
           complaintdtl.setflatno(flatno.getText());
           complaintdtl.setname(fname.getText());
        
          
           Backendless.Persistence.save( complaintdtl, new AsyncCallback&lt;Complaintdtl&gt;() {
                  public void handleResponse( Complaintdtl response )
                  {
                    // new complaint instance has been saved
                     Toast.makeText( getApplicationContext(), "Complaint Registered Successfully", Toast.LENGTH_SHORT ).show();
                  }
             
                  public void handleFault( BackendlessFault fault )
                  {
                    // an error has occurred, the error code can be retrieved with fault.getCode()
                      Toast.makeText( getApplicationContext(),fault.getCode(), Toast.LENGTH_SHORT ).show();
                      System.out.println("---error-- "+fault.getCode()+"---msg-->"+fault.getMessage()+"---detila-->"+fault.getDetail());
                  }                    
                });
             
              
    }
  };

This shows that the values can be set through setters. However, when an object is serialized to server, setters do nothing, so this essentially does not answer my question.

Hello Mark,

This is my class where setter define

package com.example.lakevista.utils;

import android.text.Editable;

public class Complaintdtl {

public String objectId;
public Editable complaint;
public Editable name;
public Editable flatno;
public String mailid;
public String complaint_no;
public String remark;

public String getObjectId()
{
  return objectId;
}
 
public void setObjectId( String objectId )
{
  this.objectId = objectId;
}

public Editable getname()
{
  return name;
}
 
public void setname( Editable name )
{
  this.name = name;
}


public Editable getcomplaint()
{
  return complaint;
}
 
public void setcomplaint( Editable complaint )
{
  this.complaint = complaint;
}

public Editable getflatno()
{
  return flatno;
}
 
public void setflatno( Editable flatno )
{
  this.flatno = flatno;
}
public String getmailid()
{
  return mailid;
}
 
public void setmailid( String mailid )
{
  this.mailid = mailid;
}
public String getcomplaint_no()
{
  return complaint_no;
}
 
public void setcomplaint_no( String complaint_no )
{
  this.complaint_no = complaint_no;
}
public String getremark()
{
  return remark;
}
 
public void setremark( String remark )
{
  this.remark = remark;
}

}

Hello!

First of all, your class doesn’t have default no-argument constructor.
Second, it has field of “Editable” class, which is not supported. You can use only primitive types, Strings, and your custom classes ( which also must have default constructor and all setters and getters ). Avoid using any other classes.
best regards,
Alex