Discussions

 View Only
  • 1.  Actions ""Add New Record"" to table with same Key field

    Posted 10-09-2017 15:53
    I've been using Actions for a while.  I have observed is that if I choose the "Perform Action Type: Add New" and the value am inputting into the Key Field of the table where the new record is created already exists, it actually edits the existing record instead of adding a new record.  This makes sense based off the way databases work, but most interesting to me is that the "Date Created" field doesn't update, it stays as the original creation date.  Has anyone else observed this?

    I am asking because it would be advantageous for me to use a Add Record vs. Edit Record for a new project I'm working on.  I just want to make sure I haven't observed a fluke before I set it up this way!


  • 2.  RE: Actions ""Add New Record"" to table with same Key field

    Posted 10-09-2017 16:20

    If you edit an existing record, you look to [Date Modified] for the date of last modification. The field [Date Created] will never change once populated. Anything after that is an edit.

    With the QB Actions, to create a New record in the manner you're describing, leave off he [Record ID#]. The database will always provide a new ID number to this field itself. You would only provide a new ID# to a custom Key Field.




  • 3.  RE: Actions ""Add New Record"" to table with same Key field

    Posted 10-09-2017 16:29
    You missed my point.  in the event that I do include the Record ID for Add Record, if the Record ID already exists, it just modifies the existing record.  I want someone to confirm that it works this way.

    I don't want to have to use "Edit Record" for an Action because the data is coming from Synced table and I don't want to change the Key field of the synced table.


  • 4.  RE: Actions ""Add New Record"" to table with same Key field

    Posted 10-09-2017 16:55

    Is the synced table related to the table the Action is pointing to? If so, you can provide the Related Record ID#.

    Anytime you input to Record ID#, you're updating if the value you're providing exits.

    As you may not have two identical Record ID#s in the same table, the behavior you're experiencing is valid and correct. If you should provide a value to Record ID# and that particular Record ID# does not already exist, the system will issue you an error, which is valid and correct.