Hi All, I recently came across this issue while using the write records smart service to update a single specific column(eg: textCol} for an existing record. I'm using the recordType constructor to specify the primary key value and using a pv value for the other column. So my input to the write records looks something like this:
{recIdPk = 1, textCol: "newvalue"}
Instead of updating the column (textCol) with the given value for the existing row I get the below error (screen-shot attached).
So from my understanding this error should not be coming becoming as this not null column already has a value both in the db table and the record object and I'm not looking to update that field hence not specfying it in my above recordType constructor.
I have a total of 15 columns in my table of which two columns have a not null constraint and are already populated from a separate location (using write records itself).
I'm only looking to update one specific column value and it's asking me to provide values for the not null columns too.
Any idea as to why this might be happening?
Discussion posts and replies are publicly visible
Hello abelm0002 You're getting a "not null" error because you are updating specific columns({recIdPk = 1, textCol: "newvalue"}) might unintentionally set other columns to null and as u mentioned two columns have a not null constraint.
abelm0002 said:I'm only looking to update one specific column value and it's asking me to provide values for the not null columns too.
If you want to update specific column i would suggest you to use a!update()