Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • David McDonnell 53 posts 251 karma points
    Jan 10, 2020 @ 16:06
    David McDonnell
    2

    Member Saving Event Set Custom Properties

    I am trying to set a custom value on the member item when the member is created for the first time.

    But when I call the save method on the member the custom property value does not appear in Umbraco CMS but debugging the code I can see the custom properties have their value set in after the setValue method. Any ideas why this is not presenting or saving in Umbraco 8 CMS? There are no errors thrown.

        private void MemberService_Saving(IMemberService sender, SaveEventArgs<IMember> e)
        {
    
                    foreach (IMember member in e.SavedEntities)
                    {
                        if (member.Id <= 0)
                        {
                            var guidId = Guid.NewGuid().ToString();
                            member.SetValue("customFieldName", guidId);
                            sender.Save(member, false);
                        }
                    }
       }
    
  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Aug 14, 2020 @ 00:37
    Alex Skrypnyk
    0

    Hi David

    Did you solve this issue?

    What is the problem?

    Thanks,

    Alex

  • 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.

Please Sign in or register to post replies