PostAP Lesson 9 Level 11 error

Student issue -https://studio.code.org/s/csppostap-2019/stage/9/puzzle/11?section_id=2243394&user_id=52998767 Getting the error Warning Line 85 - createRecord() record parameter value () is not a record.

Hi @carmichaelc,

I don’t know exactly what your student has on line 85, so I’m not sure I’m going to be helpful debugging this issue. When I use createRecord() and do not put in any parameter values I am able to produce the following error:


Is this what your student is getting? If so, it means that they are calling the function but not giving it any inputs. The createRecord() function requires three parameters:

without these it will throw a warning or error!

Is this perhaps the issue? If not, can you give us a little more detail of what’s happening?

Best,
Madeline

Please disregard my question. Thank you all for your help.

The warning is saying that the parameter “record” is not used in the function. Just add a console.log statement inside the function like this to remove the warning.

createRecord(“myContacts”, newContact, function(record){
console.log("Creating record with " + record);
});
});

@bhatnagars . We tried that but it didn’t help. She also said she wasn’t sure if the table is being created. I copied her code. It does save the new contacts. What do you think? thanks in advance.

The link at the top doesn’t appear to be the same code anymore. The code you cut and pasted is mangled due to the editor taking liberties with the character set. It also loses the context of the design elements. If you could get back the version in question, remix it yourself to keep the code fixed, then share your remix we can look at it more readily.

The code at the link above doesn’t interface with the database in any way.

image
The open and close quotes are not allowed. And that box is right out.

[ ] is what that is supposed to be.

Well there’s your problem. While it is true that an array is an object in Javascript, App Lab doesn’t allow objects of type array to be records in the database. Most likely because putting an array into the database someone might expect to get an array out, but that isn’t going to happen.

Oh no. Nevermind! Thanks for your help! I posted the wrong code all the way around. Can I delete all this?

refreshLocalData();
function refreshLocalData() {
readRecords(“myContacts”, {}, function(records){
contacts = records;
currentIndex = contacts.length - 1;
showCurrentContact();
});
}
My student must have gotten help from a programmer. I will pass this on to my other students.