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
Hi Im trying to inject UmbracoHelper in my custom field. But i get this error:
Cannot consume scoped service 'Umbraco.Cms.Web.Common.UmbracoHelper' from singleton 'xxx.Forms.MyCustomField'.)
I did follow this: https://docs.umbraco.com/umbraco-forms/developer/extending/adding-a-fieldtype
Why can't I do that? I need loop some published content. to check if some content id's exist.
I ended up doing this instead:
var accessor = StaticServiceProvider.Instance.GetRequiredService<IUmbracoHelperAccessor>(); if (accessor.TryGetUmbracoHelper(out var umbracoHelper)) { var contentnode= umbracoHelper.Content(1234); }
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
UmbracoHelper in Custom field
Hi Im trying to inject UmbracoHelper in my custom field. But i get this error:
Cannot consume scoped service 'Umbraco.Cms.Web.Common.UmbracoHelper' from singleton 'xxx.Forms.MyCustomField'.)
I did follow this: https://docs.umbraco.com/umbraco-forms/developer/extending/adding-a-fieldtype
Why can't I do that? I need loop some published content. to check if some content id's exist.
I ended up doing this instead:
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.