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





Make the world a better place.

API: add table entries automatically.

Last post 11-12-2008 7:32 PM by Paul Black. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 03-26-2008 8:29 PM

    API: add table entries automatically.

    When doing an RE7 import you can opt (in code, using an object property, for example) to have table entries created automatically. Is there any way to do this when adding records using the API? Currently the only way I can see how to overcome this is when an error is returned (entry doesn't exist in code table) the record has to be added manually. 

  • 03-27-2008 9:09 AM In reply to

    • David Zeidman
    • Top 25 Contributor
    • Posts 164
    • Organization: Zeidman Development
    • Products:  The Raiser's Edge

    Re: API: add table entries automatically.

    There is no automatic add to code tables value in the API. You have to first check to see if the value is in the code table and then if it is not you have to add it. If you are interested I can dig out some code for you.

     David

    David Zeidman
    Zeidman Development
    http://www.zeidman.info

    Check out my RE API blog
    http://www.re-decoded.com
  • 11-10-2008 8:17 PM In reply to

    • Paul Black
    • Not Ranked
    • Posts 10
    • Organization: RMIT University
    • Products:  Blackbaud NetCommunity, The Raiser's Edge

    Re: API: add table entries automatically.

    Hi David, Im having similar problem. My problem is adding values to attributes where attribute itself has code table datatype. I got part to that of that code where im able to get the code table entry value for that attribute using

    Attribute Type Server which is given in api

     But im unable to find whether the value exist in attribute or not. Because GetTableEntryID is asking for ECodeTableNumbers where i cannot find this attribute code table.

     Can you help me with this issue.

    Code is given below.

    BBREAPI7.REServices rs = new BBREAPI7.REServices();

    rs.Init(ref _context);

    CCodeTablesServer oCodeTableServer;

    CAttributeTypeServer oAttributeTypeServer;

    int llong = 0;

    oCodeTableServer = (rs.CreateServiceObject(BBREAPI7.bbServiceObjects.bbsoCodeTablesServer)) as CCodeTablesServer;

    oAttributeTypeServer = (rs.CreateServiceObject(BBREAPI7.bbServiceObjects.bbsoAttributeTypeServer)) as CAttributeTypeServer;

    oCodeTableServer.Init(ref _context);

    oAttributeTypeServer.Init(ref _context);

    try

    {

    int lcodetableid = oAttributeTypeServer.GetAttributeCodeTableID(oAttributeTypeServer.GetAttributeTypeID("Academic Program Description", bbAttributeRecordTypes.bbAttributeRecordType_EDUCATION));

    //here lcodetableid value is 1028 but i cannot find in ECodeTableNumbers class

    int lAttlong = oCodeTableServer.GetTableEntryID("(R) MASTER OF BUSINESS ACCOUNTING", ECodeTableNumbers.  --- cannot find this value . if can find this then i can use addentry method to add the entry to this attribute

  • 11-11-2008 6:00 AM In reply to

    • David Zeidman
    • Top 25 Contributor
    • Posts 164
    • Organization: Zeidman Development
    • Products:  The Raiser's Edge

    Re: API: add table entries automatically.

    The ECodeTableNumbers enum is just the numbers of standard (not user defined) code tables. You will not find your code table in this enum. However if you want to add an entry to a code table you need to use the following code (you will need to translate the VB.NET to C# but it is pretty straight forward -  you will just need to handle the "optional" parameters)

       Public Sub addToCodeTable(ByVal shortValue As String, ByVal longValue As String, ByVal codeTable As Integer)

            Dim tableLookupHandler As CTableLookupHandler


            tableLookupHandler = _REServices.CreateServiceObject(bbServiceObjects.bbsoTableLookupServer)
            tableLookupHandler.Init(_SessionContext, _CodeTableServer)

            oTableLookupHandler.AddEntry(True, codeTable, shortValue, longValue)


            tableLookupHandler.CloseDown()
            tableLookupHandler = Nothing


        End Sub

     

    David Zeidman
    Zeidman Development
    http://www.zeidman.info

    Check out my RE API blog
    http://www.re-decoded.com
  • 11-11-2008 7:46 PM In reply to

    • Paul Black
    • Not Ranked
    • Posts 10
    • Organization: RMIT University
    • Products:  Blackbaud NetCommunity, The Raiser's Edge

    Re: API: add table entries automatically.