My Products
Help
Kjetil Ringstad
PARTNER

Deleting purchase receipt lines gives GUI error messages

by Kjetil Ringstad

Sometimes when we delete purchase receipt lines using PUT /controller/api/v1/PurchaseReceipt/{poReceiptNumber with operation "Delete", the API returns GUI error messages, e.g.:

Another user has updated the ''POLine'' line. The page will now reload and your changes will be lost."

 

What can we do to prevent this?

5 REPLIES 5
Yıldırım
VISMA

by Yıldırım

This is the information that we received from the infrastructure team about how that specific exception is built.

If there are inconsistencies in the scenarios of when the exception thrown, please inform us on the followed steps before you've received the response so that we can check this out in detail.

adrianm
PARTNER

by adrianm

It is just a generic message the API returns when it doesn't know why the Visma.Net backend failed.

 

Just treat it as "Unknown Visma.Net error". It has nothing to do with "another user" or the GUI and you will just waste time investigating it in that way.

 

This is a response to a similar question I gave in the old forum:

(don't know why Yildrim still says it has something to do with things open in UI)

 

>>Originally posted by Yildrim
>>Please also make sure that , the asset you sent request for through API is not kept open on the UI and
>>not waiting for save changes.
 

>Tested this and it is not true. You can still update an asset via API while it is open in the UI but you will

>get the error message in the UI when saving.
>Saving is the critical part here and the error message makes sense in the UI but not in API.
>This code will randomly return the error

var a = new AccountUpdateDto();
a.Description = "new description";
var t1 = context.Account.PutByaccountCdAsync("1010", a);
var t2 = context.Account.PutByaccountCdAsync("1010", a);
await Task.WhenAll(t1, t2).Dump();

 

 

Yıldırım
VISMA

by Yıldırım

Hello Kjetil, 


To our knowledge, this kind of errors usually appear when the user has a related document open in the UI session and during that time the related document have been updated by other users or transactions. Afterward the system returns this error when the user is trying to update/delete the document without refreshing the page / session.

Make sure that document is not kept open or altered during the Delete operation. Retry the operation after eliminating the aforementioned possible causes.

We'd be able to investigate further if you could inform us on the exact steps / setup followed when you receive the error message. 
Thanks.

Kjetil Ringstad
PARTNER

by Kjetil Ringstad

Thank you, but I think I was unclear. The GUI error message is returned in the response from the API. And the documents have not been opened by the users.

 

We'll investigate further on our side to try to recreate the situation and provide some information.

Yıldırım
VISMA

In the system, there is no difference between API and UI Transaction and this is also valid for the exceptions / errors.
API represents a regular ERP user as it is registered with the Financial roles.  Therefore, if the same condition such as read, write, update allocation occurs then the same exception can be triggered and returned to the API.