Create Record Action saves to database but does not appear in grid until a Data Sync is done

I have created a simple table in the same database as aavehicle and I created a data model for the table along with CREATE and UPDATE record actions.  When I add a new record using the CREATE record action and associated UI, the data does not appear in the record List until after I run a Data Sync.  When I UPDATE a record using the UPDATE record action and associated UI, the changes are reflected immediately in the record List.  I have scrolled through all pages of the list and confirmed the new record does not appear.  If I query the database BEFORE running the Data Sync, the new record is in the database.  Any ideas why this may be happening?

  Discussion posts and replies are publicly visible

Parents
  • After additional trial and error, I was able to figure this out myself.  I will explain the solution here in case anyone else has a similar situation. 

    The database table I created was using a guid for the primary key.  When I initially established the Create Record Action it was failing because of missing not nullable data.  Since I couldn't figure out how to generate a guid in Appian, I allowed the column to be nillable on insert from Appian by editing the XSD for the data type and then I added a database trigger to set the key value on insert.  After creating a new Data Type that used an integer for the primary key and testing the Create Record Action it worked and it finally dawned on me that the record was not returned to the grid after insert because Appian didn't know the key value for the record that was inserted. 

    To fix the problem, I created an expression rule to generate a guid, then modified the Process Model to use a Script Task that sets the key value using the expression prior to the Write new Code to DSW call and removed the trigger code to prevent overwriting of the key value sent by Appian.  Now that the key value is established in Appian, it can return the record that was inserted immediately after save.  Problem is now resolved.

Reply
  • After additional trial and error, I was able to figure this out myself.  I will explain the solution here in case anyone else has a similar situation. 

    The database table I created was using a guid for the primary key.  When I initially established the Create Record Action it was failing because of missing not nullable data.  Since I couldn't figure out how to generate a guid in Appian, I allowed the column to be nillable on insert from Appian by editing the XSD for the data type and then I added a database trigger to set the key value on insert.  After creating a new Data Type that used an integer for the primary key and testing the Create Record Action it worked and it finally dawned on me that the record was not returned to the grid after insert because Appian didn't know the key value for the record that was inserted. 

    To fix the problem, I created an expression rule to generate a guid, then modified the Process Model to use a Script Task that sets the key value using the expression prior to the Write new Code to DSW call and removed the trigger code to prevent overwriting of the key value sent by Appian.  Now that the key value is established in Appian, it can return the record that was inserted immediately after save.  Problem is now resolved.

Children
No Data