Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello!
I was wondering how to update a custom field value from code.
Is there an UmbracoHelper method to do that?
Thanks!
Generally for CRUD operations you'll use the Service APIs that are found in
Umbraco.Core.Services
The official docs, with code samples, are here https://our.umbraco.com/documentation/Getting-Started/Code/Umbraco-Services/
Using the ContentService you can set the value of the custom property to the value you need. Then, once your values are set, you Save or Save and Publish
https://our.umbraco.com/apidocs/v7/csharp/api/Umbraco.Core.Services.ContentService.html#UmbracoCoreServicesContentServiceSaveAndPublishWithStatusUmbracoCoreModelsIContentSystemInt32SystemBoolean_
Once you get the hang of it, all/most of the Service APIs use the same pattern.
-Paul
Awesome! :D
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to update a content field value
Hello!
I was wondering how to update a custom field value from code.
Is there an UmbracoHelper method to do that?
Thanks!
Generally for CRUD operations you'll use the Service APIs that are found in
The official docs, with code samples, are here https://our.umbraco.com/documentation/Getting-Started/Code/Umbraco-Services/
Using the ContentService you can set the value of the custom property to the value you need. Then, once your values are set, you Save or Save and Publish
https://our.umbraco.com/apidocs/v7/csharp/api/Umbraco.Core.Services.ContentService.html#UmbracoCoreServicesContentServiceSaveAndPublishWithStatusUmbracoCoreModelsIContentSystemInt32SystemBoolean_
Once you get the hang of it, all/most of the Service APIs use the same pattern.
-Paul
Awesome! :D
is working on a reply...