Interceptor to Create CSI

We are about to dip our toes into the world of interceptors and the first one we need to create is one that will automatically create a CSI based on a specific address on a constituent record general tab (primary address only). Has anyone created an interceptor that creates a CSI of any kind yet?  Since we haven't touched interceptors at all yet, we were hoping to find someone willing to share their process and maybe code to help point us in the right direction.

Any help is greatly appreciated!!

Teresa
AT&T Performing Arts Center 

  • Teresa,

    We have an interceptor plugin for end points for addresses when they are being added on the general tab.  The general tab uses the ConstiuentSnaphot rest call for adding the address.  You would need to have a plugin configured for that end point as such:

      <PluginConfig>
        <UriMatch>CRM/Constituents/Snapshot</UriMatch>
        <Verb>POST</Verb>
        <FullPluginName>ConstituentService.ContactPurpose</FullPluginName>
        <PluginPlacement>POST</PluginPlacement>
      </PluginConfig>

    Once the plugin is hit we do something like the following to get  the address  no, this might be slight different for you  because this code is serving some other address purposes:

     private static XElement GetDataAddress(string elementName, XElement data)
            {
                XElement result;
                if (data.Name.ToString() == "ConstituentSnapshot")
                {
                    if (XmlUtil.FindElement(data, elementName, "") != null)
                    {
                        result = XmlUtil.FindElement(data, elementName, "");
                        return result;
                    }
                }
                else
                {
                    if (data.Name.ToString() == elementName)
                    {
                        result = data;
                        return result;
                    }
                }
                result = null;
                return result;
            }

    XElement Address address = SerializationHelper.Deserialize<Address>(dataAddress);
                            if (address != null)
                            {
                                text = text + "&amp;@POSTAL_CONTACT_POINT_ID =" + address.Id;
                                text = text + "&amp;@CUSTOMER_NO =" + address.Constituent.Id;
                            }

     Once we have the customer number and address number we execute a local procedure.  You could do the same passing this infomation to create the CSI.   I would be happy to discuss this further here or offline.

    Jon

     



    [edited by: Jon Ballinger at 12:08 PM (GMT -6) on 29 Oct 2014]
  • Jon,

     

    You are awesome!!!  Thank you so much.  I’ve just forwarded this information to our DBA and you will probably hear from him sometime in the near future!

     

    Teresa

    Teresa Dean  Tessitura Systems Director
    2403 Flora Street  Dallas, Texas 75201
    direct line  214-978-2865  fax  214-954-9936    mobile 972-835-3225
    teresa.dean@attpac.org  |  www.attpac.org

     

    Our nonprofit mission: To provide a public gathering place that strengthens community and fosters creativity through the presentation of performing arts and arts education programs.

     

     

    This electronic mail transmission is confidential, may be privileged and should be read or retained only by the intended recipient. If you have received this transmission in error, please immediately notify the sender and delete it from your system.

  • Jon,

     

    You are awesome!!!  Thank you so much.  I’ve just forwarded this information to our DBA and you will probably hear from him sometime in the near future!

     

    Teresa

    Teresa Dean  Tessitura Systems Director
    2403 Flora Street  Dallas, Texas 75201
    direct line  214-978-2865  fax  214-954-9936    mobile 972-835-3225
    teresa.dean@attpac.org  |  www.attpac.org

     

    Our nonprofit mission: To provide a public gathering place that strengthens community and fosters creativity through the presentation of performing arts and arts education programs.

     

     

    This electronic mail transmission is confidential, may be privileged and should be read or retained only by the intended recipient. If you have received this transmission in error, please immediately notify the sender and delete it from your system.

  • Jon,

     

    You are awesome!!!  Thank you so much.  I’ve just forwarded this information to our DBA and you will probably hear from him sometime in the near future!

     

    Teresa

    Teresa Dean  Tessitura Systems Director
    2403 Flora Street  Dallas, Texas 75201
    direct line  214-978-2865  fax  214-954-9936    mobile 972-835-3225
    teresa.dean@attpac.org  |  www.attpac.org

     

    Our nonprofit mission: To provide a public gathering place that strengthens community and fosters creativity through the presentation of performing arts and arts education programs.

     

     

    This electronic mail transmission is confidential, may be privileged and should be read or retained only by the intended recipient. If you have received this transmission in error, please immediately notify the sender and delete it from your system.

  • Jon,

     

    You are awesome!!!  Thank you so much.  I’ve just forwarded this information to our DBA and you will probably hear from him sometime in the near future!

     

    Teresa

    Teresa Dean  Tessitura Systems Director
    2403 Flora Street  Dallas, Texas 75201
    direct line  214-978-2865  fax  214-954-9936    mobile 972-835-3225
    teresa.dean@attpac.org  |  www.attpac.org

     

    Our nonprofit mission: To provide a public gathering place that strengthens community and fosters creativity through the presentation of performing arts and arts education programs.

     

     

    This electronic mail transmission is confidential, may be privileged and should be read or retained only by the intended recipient. If you have received this transmission in error, please immediately notify the sender and delete it from your system.

  • Jon,

     

    You are awesome!!!  Thank you so much.  I’ve just forwarded this information to our DBA and you will probably hear from him sometime in the near future!

     

    Teresa

    Teresa Dean  Tessitura Systems Director
    2403 Flora Street  Dallas, Texas 75201
    direct line  214-978-2865  fax  214-954-9936    mobile 972-835-3225
    teresa.dean@attpac.org  |  www.attpac.org

     

    Our nonprofit mission: To provide a public gathering place that strengthens community and fosters creativity through the presentation of performing arts and arts education programs.

     

     

    This electronic mail transmission is confidential, may be privileged and should be read or retained only by the intended recipient. If you have received this transmission in error, please immediately notify the sender and delete it from your system.

  • Jon,

     

    You are awesome!!!  Thank you so much.  I’ve just forwarded this information to our DBA and you will probably hear from him sometime in the near future!

     

    Teresa

    Teresa Dean  Tessitura Systems Director
    2403 Flora Street  Dallas, Texas 75201
    direct line  214-978-2865  fax  214-954-9936    mobile 972-835-3225
    teresa.dean@attpac.org  |  www.attpac.org

     

    Our nonprofit mission: To provide a public gathering place that strengthens community and fosters creativity through the presentation of performing arts and arts education programs.

     

     

    This electronic mail transmission is confidential, may be privileged and should be read or retained only by the intended recipient. If you have received this transmission in error, please immediately notify the sender and delete it from your system.

  • Jon,

     

    You are awesome!!!  Thank you so much.  I’ve just forwarded this information to our DBA and you will probably hear from him sometime in the near future!

     

    Teresa

    Teresa Dean  Tessitura Systems Director
    2403 Flora Street  Dallas, Texas 75201
    direct line  214-978-2865  fax  214-954-9936    mobile 972-835-3225
    teresa.dean@attpac.org  |  www.attpac.org

     

    Our nonprofit mission: To provide a public gathering place that strengthens community and fosters creativity through the presentation of performing arts and arts education programs.

     

     

    This electronic mail transmission is confidential, may be privileged and should be read or retained only by the intended recipient. If you have received this transmission in error, please immediately notify the sender and delete it from your system.