Custom Records are entry forms based on existing record types but customized to include fields for gathering information specific to the needs of your business. Use the Custom Record to define records to emulate existing custom records.
The Custom record is defined in the setupCustom (Customization) XSD.
Supported Operations:
-------------------------------------------------------
The following operations can be used to manipulate custom records.
add | addList | update | updateList | delete | deleteList | get | getList | search | searchMore | searchNext | getSelectValue
Note:
------------------------
Currently we do NOT support the store values option on custom records.
Working with References:
--------------------------------------------------------------
When referencing custom records, you may need a separate CustomRecordRef type and a RecordRef type.
RecordRef and CustomRecordRef both descend from BaseRef. They are most prominently used in get(), and that is why they have a type attribute. CustomRecordRef has a typeId to indicate which kind of CustomRecord it is. Therefore, you can NOT get a CustomRecord by setting the RecordRef.type to customRecord on add ---- you must use CustomRecordRef to specify the kind of CustomRecord.
CustomRecord descends from Record, just like Customer or Opportunity. This is what you submit to add() and it is what is returned through search(). CustomRecord uses a RecordRef() to store it´s type information.
To add a CustomRecord:
-----------------------------------------------------------
CustomRecord myCR = new CustomRecord();
RecordRef rt = new RecordRef();
rt.setName("Authors");
rt.setId("3"); // This indicates a typeId of 3 and corresponds to the Authors CustomRecord type
myCR.setRecType(rt);
myCR.setName("Ernest Hemmingway"); // This is what will show up in List->CustomRecords->Authors under Name
myCR.setCustomFieldList(myCFL); // An already filled out CustomField List
WriteResponse wr = port.add(myCR);
Note that setTypeId is not submitted since this is the internal ID returned by the response, just like for normal records.
To get a CustomRecord:
----------------------------------------------------
CustomRecordRef myCRR = new CustomRecordRef();
myCRR.setKey("1200"); // The key we got back
myCRR.setTypeId("3"); // For Authors
myCRR.setType(RecordType.customRecord);
ReadResponse rr = port.get(myCRR);
Similarly update operation is also same as we perform in other records.
4