I'm trying to delete using a delete action inside interface using a stored procedure because I also need to delete related data from other tables. However, I'm facing an issue: the entity is successfully deleted from the database, but it still appears in Appian.
I have a subprocess that runs after the stored procedure to sync all the updated tables, but the entity remains visible in Appian until I manually trigger a sync—after which it disappears as expected.
Does anyone have any idea what could be causing this issue? Any insights would be greatly appreciated!
here u can see the main subprocess sync :
and an example of one subprocess sync:
Discussion posts and replies are publicly visible
hamzas0003 said:but it still appears in Appian
What exactly does this mean?
If you use a separate expression to query data, this expression uses local variables, and you use that expression from your interface, this expression typically caches query results as long as the query parameters do not change. You can alter this behaviour using a!refreshVariables.
Do you call this process synchronously?
That would indicate that something is perhaps wrong with your sync expression. Can you share it?
-but it still appears in Appian
i mean when i try to delete something it s being delted form db but it remains in appian even if i refresh the page ,it disspaears only when i sync manually the recordtype ,and yes im calling it synchronously.
this is the main sync procees configuration :
adn this is one how one of it s sub procees expression:
getIds Output:
index( rule!SLC_getProgettoDiConnessioneByFilters( idRegione: pv!idRegione, pagingInfo: a!pagingInfo( startIndex: pv!startIndex, batchSize: cons!SLC_INT_BATCH_SIZE_CSV, sort: a!sortInfo(field: "id",ascending: true) ) ),"id",{} )
OK. This is important to know.
This is a lot of chaining. Are you sure you are within the 50 nodes limit?
I do not remember trying to delete data directly in DB, and then trying to remove deleted rows from the synced record cache. I am not sure this is a supported use case and can't find it in the documentation just now.
What is that rule querying? Is it querying the record type or your database directly (like through a!queryEntity())?
Why are you doing a query to find the ids that were removed?
I understand your problem. If you're calling a stored procedure (SP) to delete data from a few tables in the database by clicking on the delete action in the interface, you need to refresh the data upon deleting the data in the database tables.
If you're using the a!executeStoredProcedureOnSave() function, it has an onSuccess attribute to save the response. I believe you're storing this response in a local variable, such as local!response.
a!executeStoredProcedureOnSave()
onSuccess
local!response
By using local!response, you can query the data again using refreshVariable to get refreshed data. The refreshVariable will refresh based on the local!response variable.
refreshVariable