When I create a new entry using insertAPIEntry(), it does not load the default value for the fields. I’ve been tinkering with loadAllDefaultValues() and can’t get it to work. I thought it might be because of the [user] parameter so I tried user.getUserName() but that just returned an error.
Here’s an example of how I have implemented loadAllDefaultValues()
function loadDefault(ID) {
var entry = db.getAPIQuery('/backend2/3').getAPIEntry(ID);
entry.loadAllDefaultValues(user);
entry.save();
}
but the field “Test” is still blank despite the “free text” box having a default value of “red”.
I have worked out it just loads them into a var, which I tried, but I just get ‘undefined’.