Hi All,
What’s the accepted way of creating documents in the doc tree in code. I want to execute this code in an eForm event. I need to be able to set lots of tv values. I’ve tried the docmanager api and it seems to have real trouble with my tv updates. A kludge might be to create the doc with docmanager api and then use some other api/snippet to update the tv’s.
Can anyone suggest anything?
Thanks in advance (MODX 0.9.6.1)
AndyFlan
Hmmmmm.
It's all a delusion
Hmmmmm.
It's all a delusion
FDM works well and it will be (or is being) further developed so it is a good place to look around.
yes it looks good but it might be more a case of borrowing code rather than implementing it fully. I have to deal with a file upload before i create the document. I can get the file and save it in the right place on the server, now I just need to create a doc and set the tv values. I’m quite surprised really that modx api doesn’t publish this functionality.
Cheers for your reply.
Hmmmmm.
It's all a delusion
Solved it, I wasn’t prefixing my tv’s with ’tv’ when using docmanager, sorry for my dumbness, we live and learn

thanks
Hmmmmm.
It's all a delusion
Probably not so dumb, seems I have same issue ...? I try to set a TV in a document from within a snippet. Is this what you are referring to? How would I do that?
Well I wanted to create records in the document tree in code and I used this api:
http://www.modxcms.com/Docmanager-881.html
You have to remember to prefix your tv fields with ’tv’ when you set the value using the api...
... so if you want to set the value of your ’Country’ tv with the API then you should refer to it as tvCountry. This API is great, made my life a breeze
Hmmmmm.
It's all a delusion
Could you share any of the code you used to do this?