Add New record action stopped working all of a sudden, not sure what is causing the error

Yesterday afternoon, the Add New record action on 3 different interfaces stopped working and the process models show the same following error:

The only change that was made to those 3 interfaces was the following highlighted section was added into the expression mode:

*Note - after this change was made to the example above I was able to create a new record in that table with no issue, then proceeded to make the change to the other 2 now having issue. Also, we tried putting it back the way it was and it still gave the error so we are stumped as to what is causing this issue now.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    I believe, after creating a foreign key constraint, whenever we insert records into the first table or child table, we will get the above error. The error comes when you are trying to add a row for which no matching row is in the other table (parent table).

    "Foreign key relationships involve a parent table that holds the central data values, and a child table with identical values pointing back to its parent. The FOREIGN KEY clause is specified in the child table. It will reject any INSERT or UPDATE operation that attempts to create a foreign key value in a child table if there is no matching candidate key value in the parent table." - taken from dev.mysql.com/.../create-table-foreign-keys.html

  • The rule input that was used was already in the interface and working fine for the filter it was originally being used for, it was only after it was added to that spot in the expression mode that the problem occured. But now I wondering why, when I remove it from expression mode and put it back the way it was, we are still getting the error?

    Also, this input is on the Document Listing interface, but the process model for Add Document is where the error is coming, would that mean something changed on the Add Document interface?

  • 0
    Certified Senior Developer
    in reply to cls5469

    But you need to understand the root cause of this error is that you are trying to insert an entry in the PLSM_document table with a misMattersMainId that is not present in the PLSM_miscMattersMain table. Since you have configured a Foreign key constraint in PLSM_document table on misMattersMainId column with the permission to restrict any entry in which value of foreign key i.e., misMattersMainId is anything which is not present in the PLSM_miscMattersMain's misMattersMainId (primary key).

    Now, you need to check in your Add document action that how you are setting up misMattersMainId for the new documents. According to me this action should not be in the PLSM document recordType at first place but instead should be added as a related action in PLSM miscMatterMain recordType so that you can setup the value for foreign key column in the new document added by using the record identifier of the record you are adding this document to.

Reply
  • 0
    Certified Senior Developer
    in reply to cls5469

    But you need to understand the root cause of this error is that you are trying to insert an entry in the PLSM_document table with a misMattersMainId that is not present in the PLSM_miscMattersMain table. Since you have configured a Foreign key constraint in PLSM_document table on misMattersMainId column with the permission to restrict any entry in which value of foreign key i.e., misMattersMainId is anything which is not present in the PLSM_miscMattersMain's misMattersMainId (primary key).

    Now, you need to check in your Add document action that how you are setting up misMattersMainId for the new documents. According to me this action should not be in the PLSM document recordType at first place but instead should be added as a related action in PLSM miscMatterMain recordType so that you can setup the value for foreign key column in the new document added by using the record identifier of the record you are adding this document to.

Children