Remedy - JAVA/API - 8.1.x How to get the field label information from AR Server over Java API

Version 2
    Share This:

    This document contains official content from the BMC Software Knowledge Base. It is automatically updated when the knowledge article is modified.


    PRODUCT:

    Remedy AR System Server


    COMPONENT:

    AR System


    APPLIES TO:

    Remedy AR System Server 8.1.x



    QUESTION:

    Running a custom Java program to pull out data from remedy server is used for accessing the field values: 
    .................................
        List<Entry> getEntrysByQual(String formName, String qualStr) { //e.g. "( \'Create Date\' > \"1/1/2010\" )" 
        System.out.println(); 
        System.out.println("Using following form: " + formName); 
        System.out.println("Retrieving entries with qualification " 
        + qualStr); 
        try { 
        // Retrieve the detail info of all fields from the form. 
        List<Field> fields = remedy.getServer().getListFieldObjects(formName); 

        //Retrieve name of all available fields of the form 
        for(int i=0; i<fields.size(); i++){ 
        System.out.println("DB Name: "+fields.get(i).getName()+ " | Field-ID: "+fields.get(i).getFieldID()); 
        } 
    ...........................
    ......

    The getName() function only return the field DB name, but  we need the label text of the field. 
    The problem is, that it is found no option per now to pull out the field label text by the customer.


    ANSWER:

    Use getDisplayInstance()
    ......................
    int firstKey=0;
    if(fields.size()>0){
                   firstKey=fields.get(0).getDisplayInstance().firstKey();
                }
    if(field[i].getDisplayInstance().getProperty(firstKey, 20) != null){
                    stringFieldLabelNames[myCounter]=field.getDisplayInstance().getProperty(firstKey, 20).toString();
                    }else{
                        stringFieldLabelNames[myCounter]="No Label";
    ......................


    Check the available Java API documentation which is located in:
    Directrory: BMC Software\ARSystem\Arserver\api\doc
    Rename the file: ardoc81_build001.jar to ardoc81_build001.zip and extract.


    Article Number:

    000130997


    Article Type:

    FAQ/Procedural



      Looking for additional information?    Search BMC Support  or  Browse Knowledge Articles