I wish to create new Service Calls using sd_dataform. This technique does not seem able to set values for fields like the category or the folder. However, I wish to set values via sd_dataform for certain custom fields which are enabled only for a given category.
I can set the category via the template, but I cannot select the template using sd_dataform.
Result: if the category is not set in the template, sd_dataform cannot set it and the fields that are enabled only for that category are not set either.
I also tried using the system action "Create a subcontractor call". There, too, I cannot set the template to use, so it is not useful for our purposes.
Obviously, we can just ask users to set the template manually, but I want to avoid that solution because it is too error prone.
It is possible to set values via sd_dataform for code fields. I've just tested Category and Classification and they've worked. Folder does not work, but you can set up a hidden custom field, plus a bunch of UI rules to set the value. (if you don't have too many folders...)
This is what worked: sd_dataform "Service Call" -forcenew "+Category=Incident" "+Classification=Software"
We use sd_dataform extensively and have no problems setting the category. I just did a test and using sd_dataform created a Work Order from a Service Call, set the Category, and also set a custom field only enabled for that category. This you should be able to do.
We can't, however, set the Folder. In our case, the folder is associated to a persons role, so we have set up all that role's templates to include the Folder. We basically control the folder based on a person's role. Ruth had an idea in a previous post on setting the folder to the same as the folder of the person via a rule - something I'm still thinking about...
Whenever something like this has happened to me, it's usually because I forgot a quote mark somewhere, or the + sign, or spelled the word wrong, or something like that. If you can post your string, I can try to replicate it...