Hi,
I haven't used the Formit script, but from what I understand it may have 'hooks' that allow you to call 'post process' scripts.
If not, you might want to look at something like:
$res = $modx->newObject('modResource');
$res->fromArray($properties);
$res->save();
$resource_id = $modx->lastInsertId();
Then you could use:
header("Location: htp//example.com?newdocid=$resource_id");
exit();
Depending on what you need to do at the redirect juncture, this might also be an option:
$modx->sendForward($resource_id);
I think sendFroward() would keep you on the same URL (as your initial form submission), but would display the resource content as though viewing the page normally.
In the 'formit2Resource' documentation are there any references to 'hooks', or 'post processing'?
If not, you could probs look at the formit2Resource code, and see if it can be amended to include the above.
[ed. note: thenewmanifesto last edited this post 15 years ago.]