Copied to clipboard

Flag this post as spam?

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


  • Evelyne Schreiner 25 posts 74 karma points
    May 06, 2012 @ 10:13
    Evelyne Schreiner
    0

    Programmaticaly deleting a media in "media picker"

    I’ve working with a Member Type which has a property of type “media picker”.

    Using the API, I’m trying to delete the media. It’s working for the media node (moved to the recycle bin). However, I cannot find how to update the property of the member. How do I programmatically delete a value in a media picker property ?

    Thank you,

  • Richard Soeteman 4045 posts 12898 karma points MVP 2x
    May 07, 2012 @ 08:39
    Richard Soeteman
    0

    Hi You need to assign a null value to the property then the reference is deleted.

    Cheers,

    Richard

  • Evelyne Schreiner 25 posts 74 karma points
    May 16, 2012 @ 11:49
    Evelyne Schreiner
    0

    Yes, it's working now. Thank you, Richard.

  • Tejaswini 7 posts 27 karma points
    Sep 27, 2013 @ 20:25
    Tejaswini
    0

    I tried the following -

    It throws an error. How do I set it to null value ?

     string tj = ProgramNode.GetProperty("programPhoto").ToString();

            Media thisMedia = new Media(Convert.ToInt32(tj));
            thisMedia.delete(true);

    ProgramNode.GetProperty("programPhoto").Value = String.Empty();

     

Please Sign in or register to post replies

Write your reply to:

Draft