OK - I have found the errors - qll fixed now.
The only thing that is not working is the page before submit - setting the company_id by looking uo the MAX(id). The query is correct but is not setting the company_id field - maybe it is in the wrong place?
Good news - I have got it working - the snippet was an issue we started with editing
<form name="myresubmit" action="YOUR-TARGET-URL">
<input type="hidden" name="somefield" value="'.htmlentities( ff_getSubmit('somefield') ).'"/>
<input type="hidden" name="somefield2" value="'.htmlentities( ff_getSubmit ('somefield2') ).'"/>
<input type="hidden" name="somefield3" value="'.htmlentities( ff_getSubmit ('somefield3') ).'"/>
<!-- and so on ... -->
and the issue was the document.myresubmit.submit()
I had to change it to :
So for your info regarding Joomcrm - it has a report maker that create html and the necessary fields and that can be used in the end submit piece with that snippet anc chaning the values to
value="'.htmlentities( ff_getSubmit('email') ).'"
Thanks for standing by and I will let you know if i progress it and further.