Welcome to Forums Sign in | Join | Help | Forums
in Search


Sample code for Edit and Save

Last post 02-20-2009 7:02 AM by Garrett Keating. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-20-2009 6:19 AM

    Sample code for Edit and Save

    Hi,

    Can anyone provide me sample API code for editing and saving a Constituent record, please?

    Thanks in advance

     

     

    Filed under:
  • 02-20-2009 7:02 AM In reply to

    • Garrett Keating
    • Top 150 Contributor
    • User Since: 2006
    • Posts 63
    • Organization: U.S. Naval Academy Alumni Association
    • Products:  Blackbaud NetCommunity, The Financial Edge, The Information Edge, The Raiser's Edge

    Re: Sample code for Edit and Save

    this is for an ADD you'll be able to use something like rec.load(id, false) to load up and then make your changes and then save Dim Rec As New CRecord Rec.Init(RE7.SessionContext) Rec.Fields(ERECORDSFields.RECORDS_fld_FIRST_NAME) = firstName Rec.Fields(ERECORDSFields.RECORDS_fld_LAST_NAME) = lastName Rec.Fields(ERECORDSFields.RECORDS_fld_GENDER) = "Unknown" Rec.Fields(ERECORDSFields.RECORDS_fld_KEY_INDICATOR) = "I" Try Rec.Save() Return Rec.Fields(ERECORDSFields.RECORDS_fld_CONSTITUENT_ID) Catch ex As Exception SendError("ERROR: webservice: addIndividual " & Now(), errorEmail, ex.ToString, True) Finally ' Always clean up even after a failed save Rec.CloseDown() ' The deterministic way to clean up a COM object (Like setting = Nothing in VB6) System.Runtime.InteropServices.Marshal.ReleaseComObject(Rec) System.Runtime.InteropServices.Marshal.ReleaseComObject(RE7) End Try
    Garrett Keating
    Senior Web Developer
    U.S. Naval Academy Alumni Association and Foundation
    www.usna.com
    customizingNetCommunity.com
Page 1 of 1 (2 items)