Validation for the 'Column Nam' property failed. Property value does not match the required pattern

Hello Backendless Team,

I’m trying to create Relation Database, Here is the Data structures.

Problem :
Error Message : Validation for the nVendorID property failed. Property value does not match the required pattern.
Status Code : 403
Code : 8023

1 . 1 . * (One to many relationship)
2. i’m using Javascript API

  1. Table name “Vouchers” is the parent table

function Vouchers(args)
{
args = args || {};
this.___class = ‘Vouchers’;
this.owner = args.owner || {};
this.redeemedVouch = args.redeemedVouch || null;
this.nVendorID = args.nVendorID || “”;
this.strVendorName = args.strVendorName || “”;
this.strEmailID = args.strEmailID || “”;
this.strCategoryID = args.strCategoryID || “”;
this.strTermsConditions = args.strTermsConditions || “”;
this.strRewards = args.strRewards || “”;
this.strPhoneNo = args.strPhoneNo || “”;
this.strSponsorPath = args.strSponsorPath || “”;
this.strUsedFilePath = args.strUsedFilePath || “”;
}

  1. RedeemedVouchers is the child table
    function RedeemedVouchers(args)
    {
    args = args || {};
    this.___class = ‘RedeemedVouchers’;
    this.nVendorID = args.nVendorID || “”;
    this.strVendorName = args.strVendorName || “”;
    this.strVendorEmailID = args.strVendorEmailID || “”;
    this.strUserEmailID = args.strUserEmailID || “”;
    this.strCategoryID = args.strCategoryID || “”;
    }

  2. Here is my Javascript function to save the data

function RedeemTheVoucher()
{
try
{
var contactStorage = Backendless.Persistence.of(Vouchers);

 var RedeemVouch = new RedeemedVouchers({
     nVendorID : 5,
        strVendorName : "Anith",
        strVendorEmailID : "anithraj143@gmail.com",
     strUserEmailID : "anithraj143@gmail.com",
     strCategoryID : "1"
 });
  
var JohnsPhoneBook = contactStorage.save( new Vouchers({
	owner: RedeemVouch
}));
}
catch(err)
{
   ErrorMsg = err.message;
}

}
Please do let me know where m going wrong.

Thanks in advnace

Thanks & regards
Anith

Hello!
Provide your application id please.
Thanks!
Alex

Hi Alexandr,

Here is my application Id

3F6DF7EF-3C30-7A53-FF56-094E1263C000
Thanks
Anith

Thank you.

I guess that the error you receive is raised because the Voucher object has “” as nVendorID, but this column has validator “Number” in base. Try to pass there some value, for example, change your code like this:
var JohnsPhoneBook = contactStorage.save(new Vouchers({
owner: RedeemVouch,
nVendorID: 7
}));

Hi

I have tried the above solution, m getting new error message.

code:1007
message:“Unable to save object - invalid data type for properties - strCategoryID. You can change the property type in developer console.”
statusCode:403

regards
Anith

This error means that the object you’re trying save has property srtCategoryID which doesn’t match type declared in table. I guess that you’re passing strCategoryID = “”, but it’s declared type is INT.

You should change your constructor if it’s expected to be INT, or change this property type on console if you expect it to be String.

Hi Alexandr,

Sorry i have done necessary changes, still m facing same error message.
I have attached the table schema , relation entity and constructors related to the table schema.

Please have look at the where m going wrong?

Please do let me know, do i need to provide any information to resolve the issue.

Big thanks spending time for my problem.

Thanks in advance .

regards
Anith

Reason leaves the same: you’re passing strings to int fields.
I can order you the following: make changes in your contructors. For all your int fields corresponding rows in contructors should look like this:
this.strCategoryID = args.strCategoryID || 0;
Here strCategoryID is name of int column. This way you set default values for these fields to 0.
Notify me about results please.