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