I am trying to add some extra validation (using DI api) to certain System Forms with C# API and SAP 9.2.
I subscribed to the `Application.FormDataEvent` so I can catch any data modification on the desired form which I checked with
if (BusinessObjectInfo.BeforeAction == true && BusinessObjectInfo.Type == ObjectTypes.OBJECT_SALESQUATATION)
So far I had no problems, but getting the Form object now is a problem, because there is only the ActiveForm reference I could use, but that could get changed.
So I call it like this:
Form oForm = SBOApp.Forms.ActiveForm;
And If the calling form had a popup after the submit (like a warning where you can continue If you press Yes), the ActiveForm is changed to the pop's form object, not the System Form I would like to read data from. Also, I cannot get the form with `Application..Forms.GetForm()`, because I have no idea about the count.
Even If I subscribe to the submit button on the System Form directly, it will be still interrupted by the popup confirmation form and change the ActiveForm, leaving me hanging without a calling form reference.
How can I solve this?
Add comment