Method event version type "Version 2" - where do we find more samples and guidelines?

Hi community,

does anyone of know how to use the "Version 2" type for ItemType Server Methods?

Let´s assume we use an onAfterAdd/Update event in the Part BOM ItemType. With Event Version 1 the event is fired for each single row.
Which version 2 it would be executed on the complete item group.

From my POV version 2 is useful to improve performance for certain tasks. But there is not much information out there that describe how to use this version type.

The context item in version 2 is empty by default. So "this" simply contains nothing when we execute a Method with "Version 2". 
I assume that we have to extract the information of the affected items from the "eventData" parameter in the background.

I found some minor code samples in the code used for Effectivity and Derived Relationships. But they are to specific for being used in other contexts.

Does anyone know more about using "Version 2"? Thanks for any tip!!!

Best regards

Angela

Parents
  • My only wish is to have actions be able to use the version 2 configuration as well. I have a relationship that I want users to be able to highlight numerous relationship records to right click action >. Unfortunately, the execution as of now is very slow as I suppose it is rerunning the method each time per record as opposed to running with all in one context.

  • Also the method saves the Item's changes, which takes time as well. Which if there was a way to store changes in the frontend to render on the frontend, and letting the user click save later would likely be ideal

  • Vielen Dank für die Unterstützung dieses Beitrags!

    Methoden der Version 2 sind für serverseitige Operationen gedacht. In meinem Fall möchte ich sie verwenden, um einige Flags und Zähler automatisch zu aktualisieren. Mit Version 1 würde diese Methode für jede einzelne Beziehungszeile ausgelöst. Das ist meistens kein Problem. Aber ich möchte die Geschwindigkeit mehrstufiger Operationen verbessern, die von ECOs mit Hunderten von Elementen ausgelöst werden. Sie sind nicht super langsam, aber aus meiner Sicht bieten die Methoden der Version 2 viel Potenzial.

    Für Ihren Anwendungsfall: Warum nicht CUI verwenden? Dies ist die Auswirkungsmatrix einer benutzerdefinierten Änderungsbestellung, die ich verwende:

    Der Benutzer kann mehrere Beziehungen gleichzeitig auswählen. Die ausgewählte CUI-Schaltfläche aktualisiert die Eigenschaften „Aktion ändern“ und „Neues Dokument nach Änderung“ auf der rechten Seite. Die Methode wird nur einmal ausgelöst. 

  • 0 オフライン in reply to AngelaIp

    Thank you - this is a great idea

Reply Children