The given key was not present in the dictionary RRS feed

  • Question


    Hi Every Body,


    I am in the process of developing a plugin that creates a record account from a recording contract ie. if the contract is validated (A picklist field contains the value confirm) a record type account is created after registration of the contract.
    Event: OnSaive
    Condition: confirmation Field = True

    But when I register the contract with the status I receive a confirmation message:
    The given key was not present in the dictionary
    But when I click another button when I plug SAIVE run properly
    the is the code:

                        if (entity.Properties.Contains("new_confirmation") == true)
                            //throw new InvalidPluginExecutionException("yes");
                            confirmationPick = (Picklist)entity.Properties["new_confirmation"];
                            if (confirmationPick.Value == 1)
                                Acct=new account();
                                crmService = context.CreateCrmService(true);
                                SubscriberId = crmService.Create(Acct);

    Thank you to explain the problem
    Thursday, November 20, 2008 3:02 PM


All replies

  • I expect the new_subscriber field is not in 'entity'. If the entity is the Target InputParameter it will only contain values for fields that were changed. Try registering a PostEntityImage and readingt new_subscriber from that. See also http://mscrmuk.blogspot.com/2008/09/plug-ins-differences-between-target-and.html 


    Thursday, November 20, 2008 7:35 PM
  • Thx DavidJennaway

    I am a new CRM technical consultant.
    I am currently in the process of developing plug-in and workflow as well as I participate in the integration using BizTalk 2006 R2 to the telecommunications system (EPPIX and MINSAT) for a customer in Tunisia.



    Your blog was very interesting


    Friday, November 21, 2008 8:39 AM