Quantcast
Viewing all articles
Browse latest Browse all 110

prim16662:How to retrieve all Activity Codes along with the values for each code using the IntegrationAPI

Solution ID: prim16662
How to retrieve all Activity Codes along with the values for each code using the Integration API
Status: Reviewed
Version(s): 3.x, 4.0, 4.1, 5.0, 6.0, 6.1



Problem: How to retrieve all Activity Codes along with the values for each code using the Integration API
Problem: Sample code to extract Activity Code dictionary
Fix: The following code can be used to print all the Activity Codes and Values:

          //Load Activity Codes
          BOIterator boiActivityCodeTypes = gom.loadActivityCodeTypes(new String[] {“ObjectId”,”Name”}, null, “Name”);


             //Get each Code and print it to screen
             while (boiActivityCodeTypes.hasNext()){
                  ActivityCodeType codeType = (ActivityCodeType)boiActivityCodeTypes.next();
                  System.out.println(“Activity CODE: ” + codeType.getName());


                  //Load a certain Activity Code’s values
                  BOIterator boiActivityCodes = codeType.loadAllActivityCodes(ActivityCode.getAllFields(), null, “CodeValue”);


                  //Get each Code Value and print it to screen
                  while (boiActivityCodes.hasNext()){
                        ActivityCode actCode = (ActivityCode)boiActivityCodes.next();
                        System.out.println(“   CodeValue: ” + actCode.getCodeValue() + “  ” + actCode.getDescription());
                  }
             }


Viewing all articles
Browse latest Browse all 110

Trending Articles