I'm uploading files to umbraco using the ContentService API. It's all currently working fine but i'm having trouble with DropDown
IContent contentNode;
contentNode.SetValue("date", myitem.ExpiryDate); // populates a date
contentNode.SetValue("reference", myitem.Reference); // populates a text box
contentNode.SetValue("status", "Online"); // remains empty
status is a custom property of the datatype "Status" which is a "Dropdown List" with 3 values; "Online, Approval, Offline".
Any helps appreciated, is a dropdown list the right datatype i want? there were 4 to choose from.
This worked if i set the value to 18,19 or 20. Not sure how good this will be, this script will be run on another site and so not reusable.
This value is stored in cmsDataTypePreValues and I could reverse the process to get the ID from the value by string matching and use this, but I think this is too complicated for something that may be simple.
Populating custom DropDown propety
Hello,
I'm uploading files to umbraco using the ContentService API. It's all currently working fine but i'm having trouble with DropDown
status is a custom property of the datatype "Status" which is a "Dropdown List" with 3 values; "Online, Approval, Offline".
Any helps appreciated, is a dropdown list the right datatype i want? there were 4 to choose from.
Thanks, Fred
edit: version is 7.2.4
Tested out the Dropdown with publishing keys.
This worked if i set the value to 18,19 or 20. Not sure how good this will be, this script will be run on another site and so not reusable.
This value is stored in cmsDataTypePreValues and I could reverse the process to get the ID from the value by string matching and use this, but I think this is too complicated for something that may be simple.
Incase anyone gets stuck on the same thing, managed to find an old post that did the trick, shame you can't do it built in.
https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/54217-Dropdown-Custom-Member-Properties
is working on a reply...