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

  • I checked the Record Tab of Tempo and the record did not appear there after creating it.  I haven't been able to find the refreshAfter option anywhere, but I will keep looking and if I can find it, try your suggestion.  Thanks for your response.

  • Thank you.  The record is written to the database.  The process model is a simple auto-generated model so I can't find anything to change there.  I will keep looking.

  • 0
    Certified Lead Developer
    in reply to insurityapp0001
    The process model is a simple auto-generated model so I can't find anything to change there.

    Are you saying you confirmed that Activity Chaining is enabled all the way through to the WTDS node, as Danny said?  You may need to do this manually in your process model, and it definitely does affect the behavior you're experiencing.

  • No, I didn't say anything about Activity Chaining.  I am new to Appian and I don't even know what you are referring to with Activity Changing.  I was just trying to create a simple example that will create and update a record in a database.  I used the Generate A Record Action automation to establish the Create and Update actions and didn't change anything in the underlying process models.  I assumed that the auto generated actions wouldn't require me to change the process models to get the Create Record to work properly since the Update Record does work properly.  As I indicated earlier, I will keep looking.  Thanks for your response.

  • 0
    Certified Lead Developer
    in reply to insurityapp0001

    I'm unsure what the auto-generated process model will or won't have, so I can't speak to that either way.  I was merely trying to clarify what Peter was trying to point out - specifically, that "Enable Activity Chaining" needs to be enabled on each activity flow line up until the WTDS node.

    Without this, the functionality will still work, but it is known to often exhibit the behavior you're describing and trying to remedy here, which is why we're asking you to confirm this.

  • Ah!  A picture is worth a thousand words.  Thank you for providing.  I checked the process models and for the Create Record Action I see the chain:

    For the Update Record Action I see the chain as well:

  • 0
    Certified Lead Developer
    in reply to insurityapp0001

    Thanks for confirming, the current configurations we can see here are enough to confirm that this piece isn't affecting the behavior you're seeing, as far as I know.

  • 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.