In the WebQuerySave event of the form you can call an agent. In the agent, you can use print statements to return whatever you want (e.g. the UNID of the newly created document).
if i execute agents, can supercharge the agenmanager task ( multiple users running the agent), i need make this with formula or URL command or another way
What is your goal here? Can you provide more details about what you are doing? What the XMLHttpRequest is for and what it will do? What’s the process flow of the form submission to be?