Disconnect contact from ERPconnection

I need to disconnect a lot of contacts from ERP in SuperOffice Online.

I’m trying to do this by using ejscript but get the following error when using NSErpSyncAgent agent; :

Is this a bug?

To reproduce:

NSErpSyncAgent agent;

 

Expected:

NSErpSyncAgent agent;

agent.BreakActorLink(1,17,1);

Disconnect contact 17 from ERP with erpconnectionId = 1 and erp actortype 1

 

 

RE: Disconnect contact from ERPconnection

The ERPSyncAgent is not exposed to CRMScript, and therefor you get the error.

 

Af: Stian Andre Olsen 8. mar 2019

RE: Disconnect contact from ERPconnection

By the way, same goes for:

NSDatabaseAgent dbAgent;
Af: Frode Lillerud 8. mar 2019

RE: Disconnect contact from ERPconnection

Yes, that is correct. But there are classes already in CRMScript to manipulate extra table data, so better to use them than doing this through NetServer.

Af: Stian Andre Olsen 8. mar 2019

RE: Disconnect contact from ERPconnection

Thanks Stian,

I managed to get around it by deleting rows in the involved tables with SearchEngine.

It would probably be a good Ide to remove everything that can never be used 😉

Af: Henning Dahl 8. mar 2019

RE: Disconnect contact from ERPconnection

Any chance that the ERPSyncAgent will be exposed in SuperOffice Online, or at least something similiar to the BreakActorLink() method? Having to ask SuperOffice or Keyforce every time we need to mass-disconnect ERP connections seems like the long way around sometimes, so it would be nice to be able to do this through CRMScript with proper methods.

Af: Espen Steen 1. mar 2021

RE: Disconnect contact from ERPconnection

With the mindset that ERPSyncAgent is used exclusively for establishing ERP Connectors, connections and operations, No, it doesn't make sense to open that agent to the CRMScript engine. 

Your requirement to have access to the BreakActorLink method is real though, I get that. Perhaps this is something would be better suited for a BulkUpdate, or Selection?

The current resolution is to use the ERPSyncAgent API directly... Sure you have to create the utility application that calls the API, and if this is for an online tenant, yes you have to register yourself and a private (custom) application to do it. But it's doable, and trust me when I say that doing it this way is more work for SuperOffice (Operations Center) than it is for you, that's for sure. 

I'll forward along the previous ideas about making it easier in the existing application though, i.e. BulkUpdate.

Best regards!

Af: Tony Yates 2. mar 2021

RE: Disconnect contact from ERPconnection

Hi Tony

About the ERPSyncAgent - that makes sense. The pressing need is some way to "Mass-unlink ERP" connections, not all the other stuff that agent can do.

Doing this with selection/bulk update would be very well recieved and something we have wanted for a good while. If I had to choose between the two, doing it in bulk update would probably be even better than having a CRMScript method for it since it would be better for larger bulks. That is, as long as we can pick which ERP connection to disconnect, in case the entity has multiple ERP connections.

Thanks!

Af: Espen Steen 2. mar 2021

RE: Disconnect contact from ERPconnection

I agree with Espen, if we can't have ERPSyncAgent exposed, we certainly need some way to bulk update / remove ERPActorLink. i Recently had a case, where we were looking into all the hassle of registering a custom app and everything in order to succeed with this.

 

We ended up contacting support and have them do it instead, as the time and therefore money going into making a "custom app" for what coul've been a quite simple operation was way overkill.

Af: Dennis Mortensgaard 3. mar 2021

RE: Disconnect contact from ERPconnection

Adding this to BulkUpdate is no big deal.
However, Espen requires a feature that makes no sence in BulkUpdate:

"That is, as long as we can pick which ERP connection to disconnect, in case the entity has multiple ERP connections."

You cannot cherry pick a connection in a bulkupdate job for hundreds of contacts, persons or projects.
It must be All connections for every entity in the entire bulkj update job.

/conrad 

 

Af: Conrad Weyns 3. mar 2021

RE: Disconnect contact from ERPconnection

Hi Conrad

Well, a bulk update that removes all ERP connections would certainly be a lot better than not having it at all, so maybe not a requirement. :) And it would do the job in most cases. But I have definitely had cases where a "take all"-feature couldn't be used, where you would have to specificy which ERP connection to remove to get the right result.

Af: Espen Steen 3. mar 2021

RE: Disconnect contact from ERPconnection

Hi Espen,
I understand that use case.
BulkUpdate can't have specific requirements per entity and it certainly cannot introduce the need for Dialog input while running a job in the background.

You may need a better way to search for contacts, persons and projects based on the number of erp connections in order to make a good selection.
The "Erp Connected" criterion will merely look in the entity's activeErpLinks field.
One needs to query the ERP system for every entity in order to find the connection ids.

/conrad

 

Af: Conrad Weyns 3. mar 2021

RE: Disconnect contact from ERPconnection

After some discussions and feedback this is what we landet on:
(Currently only a demo in 8.5 Win)

 

 

I.o.w. Given a collection of Contact, Person or Project ids, disconnect from ERP if entity is connected by this connection id

 

If you want to disconnect from more than 1 connection, just add another row.
Let us know if this could be of value. We are still somewhat uncertain if this solves any real problems out there.

Essentially, it is nothing more than a faster alternative to navigating to n-number of ERP cards, hit Edit and click on the Disconnect hypertext.

Nothing bad wil happen if an entity in the collection is either not connected or does not use that particular connection id.


/conrad

Af: Conrad Weyns 6. mar 2021

RE: Disconnect contact from ERPconnection

This looks great! If this is implemented in Web/Online it would help a lot.

Can't say I've ever had the need to disconnect two specific connections at the same time, but I can imagine it would be useful to disconnect "all" connections, so it would be helpful in that regard. But of course that could also just be done in just two (or more) bulk updates.

Af: Espen Steen 8. mar 2021

RE: Disconnect contact from ERPconnection

Hi Espen,
making this available in Nine (Web/Online) is no problem.
But we are not done discussing this.
I think there is a good argument to be made for implementing this as a dedicated Selection Task instead.

Once you combine this field with other fields in BulkUpdate it becomes a bit of a hybrid.
BulkUpdate was a pratical and easy place to test this but I am not convinced it belongs in there.

/conrad

Af: Conrad Weyns 8. mar 2021