getItemAudits

The getItemAudits actionreturns all the changes to a filtered list of item records, from a specified point in time to the current time.

Input

Class

Name

Type

Required

Details

ItemHistoryRequest

userId

String

Yes

The caller's user ID

ItemHistoryRequest

password

String

Yes

The caller's password

ItemHistoryRequest

returnRawXML

 

 

 

ItemHistoryRequest

startTimeSlice

Date

Yes

The cutoff timestamp value is not included in the issues generated by this command; that is, the comparison is item timestamp is greater than cutoff timestamp

ItemHistoryRequest

endTimeSlice

Date

No

The endTimeSlice is optional. If it is omitted, there is no constraint on the end of the cutoff period. If it is provided, the value must be greater than the value of cutoff. This is used to limit the items for which history is generated

ItemHistoryRequest

userNameMask

String

No

The optional userNameMask may be used to override the behavior setting named USERNAME_DISPLAY, for the duration of the execution of a single API call. This allows the developer to return the user names in a different format than the system-wide default stored in the behavior setting

ItemHistoryRequest

filters

Array[]

No

List of filters for the history

Field

id

boolean

No

 

Field

name

boolean

No

 

Field

value

boolean

No

 

Field

childOfFieldId

boolean

No

 

Field

repeatingRowField

boolean

No

 

Field

textAreaField

boolean

No

 

Field

typeOfUserField

boolean

No

 

Output

Class

Name

Type

Required

Details

ItemHistoryResponse

success

boolean

Yes

True is succeeded False if failed

ItemHistoryResponse

returnCode

String

No

See Appendix for details

ItemHistoryResponse

returnMessage

String

No

Human readable message

ItemHistoryResponse

xml

String

No

The number of field records in the child array

ItemHistoryResponse

itemRecords

Array[]

Yes

An array of itemRecords objects

ItemRecord

numberOfItemRecordFields

int

Yes

The number of field records in the child array

ItemRecord

itemRecordFields

Array[]

Yes

An array of ItemRecordField objects

ItemRecordField

fieldId

String

Yes

The id of the field

ItemRecordField

fieldTitle

String

Yes

The title of the field

ItemRecordField

fieldValue

String

Yes

The value of the field

ItemRecordField

row

boolean

Yes

The repeating row value

Example

public static void testGetItemAudits(EVItemServiceStub stub) {
    try {
        GetItemAuditsDocument reqEnvelope = GetItemAuditsDocument.Factory.newInstance();
        ItemHistoryRequest request = reqEnvelope.addNewGetItemAudits().addNewRequest();
        Calendar startCal = new GregorianCalendar();
        startCal.add(Calendar.DATE, -30);
        // look back 30 days ago
        Calendar endCal = new GregorianCalendar();
        request.setUserId(ServiceClientHelper.ADMIN_USER_ID);
        request.setPassword(ServiceClientHelper.ADMIN_PASSWORD);
        request.setStartTimeSlice(startCal);
        request.setEndTimeSlice(endCal);
        request.setReturnRawXML(true);
        GetItemAuditsResponseDocument resEnvelope = stub.getItemAudits(reqEnvelope);
        ItemHistoryResponse response = resEnvelope.getGetItemAuditsResponse().getReturn();
        if (response.getSuccess()) {
            System.out.println("success: [" + response.getReturnCode() + "] : " +
                                              response.getReturnMessage());
            System.out.println("XML Report:n" + response.getXml());
            for (ItemRecord record: response.getItemRecordsArray()) {
                System.out.println(" ++++++++++++++ ");
                System.out.println(" + New Record + ");
                for (ItemRecordField field: record.getItemRecordFieldsArray()) {
                    System.out.println(" + New Field + ");
                    System.out.println(" - Field Id: " + field.getFieldId());
                    System.out.println(" - Value: " + field.getFieldValue());
                    System.out.println(" - Title: " + field.getFieldTitle());
                    System.out.println(" - Row: " + field.getRow());
                }
            }
        } else {
            System.out.println("failure: [" + response.getReturnCode() + "] : " +
                                              response.getReturnMessage());
        }
    } catch (Exception e) {
        e.printStackTrace();
        System.err.println("nnn");
    }
}