How to add a new entry into table using a!writeRecords?

A Score Level 1

Hi,

I am trying to use a!writeRecord function in an interface button save into block. Below is my code. Id is a Primary Key and is set as AUTO_INCREMENT in the database table. When I set the id as 0, it doesn't seem to accept the identifier and hence fails. What should I do in order to write a new entry into the table using this function?

PS : I am able to update the record and the corresponding row in the DB with an existing identifier.

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to Malleswari T

    I did a quick test and had the same issue. Writing a new item, fv!recordsUpdated was empty. But in the DB I had a new row with the correct values. Then I checked my record for applied source filters ... and BINGO. The item I added to the DB did not get pass that filter. I removed that filter and a retest showed that fv!recordsUpdated is not populated as expected.

    I think this is expected, while somewhat tricky to debug when you do not have that source filter in mind.

Children