UpdateRLTab Method

Sample code to update the RecordList tab Properties of a custom Object using the UpdateRLTab method of CampusNexus CRM COF iService.

In the following sample code we will be updating the Properties of the Revenue Details tab, which is a RecordList Tab of the custom Object, Sales Executive. The Revenue Details consists of the following three properties:

  • Year

  • Quarter

  • Total Revenue

We will be performing the following operations on the Revenue Details tab for a Sales Executive item whose instance ID is 10:

  • Update the value of the Total Revenue Property of the following row to 12500:

Year

Quarter

Total Revenue

2012

1

10000

  • Add the following rows in the Revenue Details tab:

Year

Quarter

Total Revenue

2012

2

13000

2012

3

14250

  • Delete the following row from the Revenue Details tab:

Year

Quarter

Total Revenue

2013

1

3450

Sample Code for the UpdateRLTab Method
public void UpdateRLTabCOFIService()
        {
            //Creating an Instance of the COF iService
            COFWebService CofService = new COFWebService();

            //Generating the UsernameToken
            UsernameToken userToken = getUserToken("ParkerRoy", "password");

            //Associating the user Token with the iService Instance
            CofService.RequestSoapContext.Security.Tokens.Add(userToken);
            CofService.RequireMtom = false;

            //Setting the values of the input parameters
            long objectType = 5007; //Object type of the Sales Executive Object
            long instanceID=10; // ID of the Sales Executive item
            long tabID=86848; // Tab Id of the Revenue Details tab

            //Initializing the PropertyInfo class with required Information for updating 7 properties
            PropertyInfo[] propData = new PropertyInfo[7];

            //Updating the Total Revenue Property of the existing row ID 1
            propData[0]= new PropertyInfo();
            propData[0].rowID=1; //ID of the existing row that needs to be updated 
            propData[0].propertyID=21865; //ID of the Total Revenue Property
            propData[0].propValue="12500"; //Value of the Total Revenue Property

            //Adding the values for the 3 Properties of row 1 of the Revenue Details tab
            propData[1]= new PropertyInfo();
            propData[1].rowID=-1; //Initializing the row ID as -1 for row 1 to be added
            propData[1].propertyID=21864; //ID of the Quarter Property
            propData[1].propValue="2"; //Value of the Quarter Property

            propData[2]= new PropertyInfo();
            propData[2].rowID=-1; //Initializing the row ID as -1 for row 1 to be added
            propData[2].propertyID=21865; //ID of the Total Revenue Property
            propData[2].propValue="1300"; //Value of the Total Revenue Property

            propData[3]= new PropertyInfo();
            propData[3].rowID=-1; //Initializing the row ID as -1 for row 1 to be added
            propData[3].propertyID=21866; //ID of the Year Property
            propData[3].propValue="2012"; //Value of the Year Property


            //Adding the values for the 3 Properties of row 2 of the Revenue Details tab
            propData[4]= new PropertyInfo();
            propData[4].rowID=-2; //Initializing the row ID as -2 for row 2 to be added
            propData[4].propertyID=21864; //ID of the Quarter Property
            propData[4].propValue="3"; //Value of the Quarter Property


            propData[5]= new PropertyInfo();
            propData[5].rowID=-2; //Initializing the row ID as -2 for row 2 to be added
            propData[5].propertyID=21865; //ID of the Total Revenue Property
            propData[5].propValue="14250"; //Value of the Total Revenue Property


            propData[6]= new PropertyInfo();
            propData[6].rowID=-2; //Initializing the row ID as -2 for row 2 to be added
            propData[6].propertyID=21866; //ID of the Year Property
            propData[6].propValue="2012"; //Value of the Year Property

            //Deleting a row from the RecordList tab
            int[] deleteRows = new[] { 7 }; //here 7 is the Row Id of the row that is being deleted.

            //Declaring the output parameters
            string error = "";
            long result = 0;

            //Calling the UpdateRLTab method
            result = CofService.UpdateRLTab(objectType, instanceID, tabID, propData, deleteRows, out error);
        }