Application Error while refreshing the Case Entry Screen from post processing Method Directives

Hi everyone, updating a Db field in HDCase table and Refreshing the case entry screen via bpm causes application error .

Application Error

Exception caught in: Infragistics4.Win.UltraWinTree.v12.2

Error Detail

============
##!Message:##! Key already exists, key: d4f8a4b3-68c1-4c63-ba11-ef95bccce9bf:HDCaseNum='77769:HDCaseOrder.OrderNum=13197
##!Program:##! Infragistics4.Win.UltraWinTree.v12.2.dll
##!Method:##! ValidateKeyDoesNotExist

Client Stack Trace

==================
at Infragistics.Win.UltraWinTree.UltraTree.ValidateKeyDoesNotExist(String key)
at Infragistics.Win.UltraWinTree.TreeNodesCollection.ValidateKeyDoesNotExist(String key)
at Infragistics.Win.UltraWinTree.TreeNodesCollection.AddNodeHelper(UltraTreeNode node, Boolean notify, Boolean internallyCreatedNode)
at Infragistics.Win.UltraWinTree.TreeNodesCollection.Add(Object value)
at Infragistics.Win.UltraWinTree.TreeNodesCollection.Add(UltraTreeNode node)
at Ice.Lib.Framework.EpiTreeView.treeLoader(EpiTreeNode parentNode, EpiDataView treeView, EpiTreeBinding treeBinding, String filter)
at Ice.Lib.Framework.EpiTreeView.BuildChildRows(EpiTreeNode parentNode)
at Ice.Lib.Framework.EpiTreeView.expandTreeNodes(IDictionary2 nodeStates, TreeNodesCollection nodes) at Ice.Lib.Framework.EpiTreeView.expandTreeNodes(IDictionary2 nodeStates, TreeNodesCollection nodes)
at Ice.Lib.Framework.EpiTreeView.ExpandTreeNodes(IDictionary`2 nodeStates, TreeNodesCollection nodes)
at Ice.Lib.Framework.EpiTreeView.ResetTreeData(Boolean preserveNodeState)
at Ice.Lib.Framework.EpiTreeView.OnNotification(EpiDataView view, EpiNotifyArgs ar, Boolean visibilityChanged)
at Ice.Lib.Framework.EpiTreeView.oDataView_EpiNotification(EpiDataView view, EpiNotifyArgs ar)
at Ice.Lib.Framework.EpiViewNotification.Invoke(EpiDataView view, EpiNotifyArgs args)
at Ice.Lib.Framework.EpiDataView.OnEpiViewNotification(EpiNotifyArgs e)
at Ice.Lib.Framework.EpiDataView.InnerNotify(EpiNotifyArgs args)
at Ice.Lib.Framework.EpiTransaction.NotifyAll()
at Erp.UI.App.HelpDeskEntry.Transaction.Update()

any inputs will be appreciated , thanks.

Well since you can’t do that lol, maybe step back and explain exactly what you are trying to do?

hi @klincecum thanks for the reply. I am trying to update a field via bpm -post processing and I want to refresh the case entry Maintenance screen after the bpm. for that i used get by id method in bpm. it is refreshing however i am encountering the Application error.

I have a feeling I know what you did. Show your BPM.

please take a look.

That’s not at all what I expected.

Without more information, I don’t know where your error is coming from.

Anyway, you did a GetByID, but then you did nothing with it.

You’ll need to modify the data coming back from the call with the data for it to show on the screen.

The error is exactly triggered after bpm run. can you please give me some examples to modify the data.
However when I remove getbyid method to refresh screen .the bpm works without any issue . but the user has to manually refresh the screen which is tedious.

I think you have a misunderstanding.

You calling GetByID does nothing.

That does not refresh the screen.

If the screen is refreshing, then it’s probably caused by the error you are causing.

You’ll need to dona GetByID and store it in a variable called newds then use

this.dsHolder.Attach(newds)

This will replace the returning data with the newly acquired get by I’d response and will “refresh” the screen

2 Likes

Hi @josecgomez Thanks for your Inputs , i tried the approach recommended by you.
see the below code for the reference.

I am still getting the same Error , what am i missing. surprisingly i don’t have any issue in any other screens for refreshing ui via bpm . the only caveat is here the case entry screen.

Error:

image

@klincecum Thanks , may I know what am I missing here, what is the other way to refresh the case entry ui screen, after the post bpm run.

@josecgomez pretty much answered that.
He may have been a little quick on his answer, so it may not be 100%.

You can’t actually refresh a screen from a BPM.

However, the way most of the client screens are designed, they make a call, and the data that comes back from the base or post processing is processed on the client to update the screen and or do other actions.

So what you need to do, is in whatever dataset that comes back from your post, put that value you just set in there, and it should show up on the screen.

What field did you update?

Looking at your BPM, I see a set field widget, but since you’re in post, that only sets something in the dataset that is returned, so nothing is saved at that point.

it was a ud field and it is getting updated. but i have to refresh the screen manually to see the latest changes.

That was a Local variable to store the casenum, which will be passed to the method getbyid.

Ok so how and where did you set that field?

also, a ud field on what table?

the Table Was HDCase_UD

I Used Fill by Query Widget to Update the Fields. and it is working good.