locked
Inactive Status as default RRS feed

  • Question

  •  

    when adding new account or contact I want to make the default "Inactive" and then I change it to "Active" according to my needs
    Sunday, February 10, 2008 12:44 PM

Answers

  • Hi.

     

    There is no default behavior for this.

    You can use a workflow or callout / plug-in on account creation and use the following code to achieve your goal:

     

    CrmService service = new CrmService();

    service.Credentials = System.Net.CredentialCache.DefaultCredentials;

     

    // Create the request object.

    SetStateAccountRequest state = new SetStateAccountRequest();

     

    // Set the properties of the request object.

    state.AccountState = AccountState.Inactive;

    state.AccountStatus = -1;

     

    // EntityId is the GUID of the account whose state is being changed.

    state.EntityId = new Guid("{ Account GUID Here }");

     

    // Execute the request.

    SetStateAccountResponse stateSet = (SetStateAccountResponse)service.Execute(state);

     

    Cheers,

    Adi

     

    Sunday, February 10, 2008 1:22 PM

All replies

  • Dear you can achieve this by write calout / plugin, postCreate, it will update status after first time creation to inactive and whenever you want you can change that.

     

    read CRM SDK for that.

     

    Beat Regards,

    Imran

     

    http://microsoftcrm3.blogspot.com

     

     

    Sunday, February 10, 2008 1:21 PM
    Moderator
  • Hi.

     

    There is no default behavior for this.

    You can use a workflow or callout / plug-in on account creation and use the following code to achieve your goal:

     

    CrmService service = new CrmService();

    service.Credentials = System.Net.CredentialCache.DefaultCredentials;

     

    // Create the request object.

    SetStateAccountRequest state = new SetStateAccountRequest();

     

    // Set the properties of the request object.

    state.AccountState = AccountState.Inactive;

    state.AccountStatus = -1;

     

    // EntityId is the GUID of the account whose state is being changed.

    state.EntityId = new Guid("{ Account GUID Here }");

     

    // Execute the request.

    SetStateAccountResponse stateSet = (SetStateAccountResponse)service.Execute(state);

     

    Cheers,

    Adi

     

    Sunday, February 10, 2008 1:22 PM