locked
Removing parent account from an account RRS feed

  • Question

  • I am trying to remove the parentaccountid from an account, via Scribe software.  Initially tried setting the parentaccountid to Null as that is what accounts without parent accounts have, but get an error related to the fact the parentaccountid must be 32 digits in length.

    Is there a way to remove the parentaccountid of specific accounts, other than through the GUI?

    Monday, June 7, 2010 11:17 PM

Answers

  • You may need to address the matter with Scribe.  I'm unfamiliar with their software, so I cannot say what operations it supports.  If you were to Null the attribute using C# code in a Plugin, the operation would be something like:

    // assuming "entity" is the object held by the "Target" parameter of a Create or Update message
    
    if (entity.Properties.Contains("parentaccountid"))
     entity.Properties.Remove("parentaccountid");
    
    Lookup emptyParent = new Lookup();
    emptyParent.name = "parentaccountid";
    emptyParent.IsNull = true;
    emptyParent.IsNullSpecified = true;
    
    entity.Properties.Add(emptyParent);


    Dave Berry
    • Proposed as answer by Mayank Pujara Tuesday, June 8, 2010 8:46 AM
    • Marked as answer by Jim Glass Jr Tuesday, June 8, 2010 8:21 PM
    Monday, June 7, 2010 11:44 PM
    Moderator

All replies

  • You may need to address the matter with Scribe.  I'm unfamiliar with their software, so I cannot say what operations it supports.  If you were to Null the attribute using C# code in a Plugin, the operation would be something like:

    // assuming "entity" is the object held by the "Target" parameter of a Create or Update message
    
    if (entity.Properties.Contains("parentaccountid"))
     entity.Properties.Remove("parentaccountid");
    
    Lookup emptyParent = new Lookup();
    emptyParent.name = "parentaccountid";
    emptyParent.IsNull = true;
    emptyParent.IsNullSpecified = true;
    
    entity.Properties.Add(emptyParent);


    Dave Berry
    • Proposed as answer by Mayank Pujara Tuesday, June 8, 2010 8:46 AM
    • Marked as answer by Jim Glass Jr Tuesday, June 8, 2010 8:21 PM
    Monday, June 7, 2010 11:44 PM
    Moderator
  • Thank you.
    Tuesday, June 8, 2010 2:33 PM