InvcGrp updatetable BAQ

Thanks @ckrusen for the tip! @Jonathan - on the contrary, it actually does appear that there is some check that the person unlocking is the same person who has it locked, as @ckrusen speculated. Testing this method call via BLTester while connected as the same user that has the group locked, the call was successful and the group was unlocked. Doing the same exact test while connected as a different user results in the error “group is locked by another user”.

@ckrusen I’m curious - in a BPM how would we adjust the context of the user that it runs as?

I can tell you for a fact that it doesn’t, do you happen to maybe have bpms triggering an update somewhere?

Unless something else is executing, if only UnlockGroup is being called, it should not care what user is calling it.

Very strange - nope, we don’t have any BPMs linked to that table… but UnlockGroup() does appear to behave differently depending on the user that runs it.

“Based on the user …”

How so? Does being a SecMgr affect it?

Does it only unlock when the user that locked it does it?

And as a stretch … Does it matter if the person who locked it is currently logged on?

Being a SecMgr doesn’t appear to have any effect - even as one, I cannot unlock a group that another (non-security manager) user has locked using UnlockGroup(). From my testing, it seems to only unlock when the user that has the batch locked calls UnlockGroup(). And it does not seem to matter if the person is currently logged on (I had tried even when the user that had the batch locked hadn’t been logged in for a while, and it still wouldn’t let me unlock it).

1 Like

I would suggest enabling server logging to see what else is being called other than UnlockGroup.

I did this exact same test, create invoice group with User1, InvcGrp.ActiveUserID is populated as User1, then through the REST API Help page call UnlockGroup logged in as User2, call is successful and InvcGrp.ActiveUserID is empty.

Hmm ok, I will try that and and also will try via the REST API instead of via BLTester or a custom form w/ custom code. One thing I did notice, checking the documentation in the REST API on APChkGrpSvc.UnlockGroup() is that it actually states “The user who locked the group only can unlock it”. This is different from APInvGrpSvc.UnlockGroup() which does not state this. Is it possible the same holds true for APInvGrp as well (perhaps in my specific version)?

This might be why we are getting different results, I was only referring to the InvcGrp BO, it is possible others work differently, I will check tomorrow.

EDIT: Yes, both APChkGrp and APInvGrp check ActiveUserID against Session.UserID and won’t let you unlock the group unless it is the same user.

I can confirm that using BLTester does not work to unlock an AP/AR group… did someone have found a proper way to do this? An UBAQ won’t work either since the upudate process validates if there is an active user…

image

any suggestions other than running an update sequence in SQL ?

Try passing the ‘OnBehalfOf’ header in the rest call as the user id that has the group locked. This might help

Like This, (but check the OnBefalfOfToken)

1 Like

Thanks for the snip, I didn’t have one handy

Thanks for the reminder. I forgot that you had to impersonate. There was another thread where I suggested using the BL tester, but that won’t work unless you are logged in as the owner of the group.

2 Likes

ok, so… this will work only on 10.2+… since there are no APIs in 10.1, right?

is there a way to consume the “unlock” method in 10.1.600 for example?

That’s correct. You need to have REST for this to work. You could code a UBAQ that uses the impersonation to do it as well. But I don’t have any code written up for that.

REST exists in 10.1.600 (only v1). Functions don’t exist until 10.2.500.

I am trying to do the unlock as well. How do you specify impersonation in a UBAQ? We have users that no matter how many times we tell them they must exit the form properly they don’t and then our CFO can’t process the groups. I am trying to come up with a dashboard based on a UBAQ so he can unlock he groups as needed.

@jadixon You may not have to. In my version there is Unlock Batch and Release Data Locked for GL Posting. Maybe one them will work for you. If you are doing a UBAQ it would not be like REST so you would just need it to be updatable and removing the active user should release the lock.

Unlock Batch

Unlock Batch

Use Unlock Batch to normally process error cash receipt and payment batches.

When you work with batches in Cash Receipt Entry, Cash Receipt Batch Maintenance, AP Payment Entry, or Payment Batch Maintenance, some of these batches may be locked due to some errors. On this occasion you are able to unlock such batches in the Unlock Batch program.

Release Data Locked for GL Posting

Release Data Locked for GL Posting

Use Release Data Locked for GL Posting to unlock data locked for GL Posting process. Note, that this conversion process will only affect the current company.

Menu Path: System Management > Rebuild Processes > Finance

1 Like

We are working in groups, not batches, so there are no batches to select.

The release data locked did nothing to unlock the AP Group.

Is there any easy solution for this issue?