I have a custom dashboard widget (manager side) that I created (unfortunately cannot share the exact code) which essentially uses a dashboard widget which contains a table of data populated by the user. The snippet will go through each row of the table and generate resources and other actions for each table row entry.
On the front end, i have a “hub” that lists a number of resources, and sorts them based on the dates saved by VersionX for that resource.
The issue I am having is that VersionX relies on the OnDocFormSave event to trigger a new “version-entry” to be created for a resource. My snippet/widget creates and saevs its resources using “$newResource->save();” which does not seem to be setting an initial “version-entry” in VersionX.
I can prove this by making a new resource myself and saving, which directly calls the ondocformsave event and creates a first “version-entry” for the resource i create.
But if I use my widget/snippet, there is no entry in the VersionX UI. I must open the resources created by my widget and manually click “save” to get VersionX to take a snap of the resource and log that version.
Can anyone provide help on how to work with VersionX/snippets/events so that it will create an initial “version-entry” for each of the resources that i create using my snippet?