CustomFieldList cfl = customrec.getCustomFieldList(); CustomFieldRef[] cfr = cfl.getCustomField(); StringCustomFieldRef bankgironummer = null; for (int i = 0; i < cfr.length; i++) { bankgironummer = (StringCustomFieldRef) cfr[i]; if (bankgironummer.getInternalId().equals("custrecord_bankgironummer")) { break; } } My problem is that I want to be able to loop through cfr (an array of CustomFieldRef objects) and get their Internal IDs. When it matches with the desired Internal ID, I want to break. I have not been able to find a method to get the Internal ID for a CustomFieldRef, so I'm forced to cast the object into a StringCustomFieldRef. This works fine as long as the Custom Field is a FreeForm Text field, but when I have other fields, for example a Custom Field with Integer it doesn't work. How can I loop through an array of CustomFieldRef objects and get their Internal IDs without having to cast them into StringCustomFieldRef (or LongCustomFieldRef etc)?