``` var options = { ...
# suitescript
s
Copy code
var options = {
                                fieldId: key
                            };
                            log.debug("options", options);
                            var fieldObj = objRecord.getField(options);
Options logs out
{"fieldId":"custbody_transaction_gateway"}
and
custbody_transaction_gateway
exists on the customer payment. but I get this error:
Copy code
{"type":"unexpected error","code":"","details":"{\"type\":\"error.SuiteScriptError\",\"name\":\"SSS_MISSING_REQD_ARGUMENT\",\"message\":\"DeferredDynamicRecord.getField: Missing a required argument: fieldId\",\"stack\":[\"anonymous(N/serverRecordService)\",\"doPost(/SuiteScripts/CreateTransaction.js:186)\"],\"cause\":{\"type\":\"internal error\",\"code\":\"SSS_MISSING_REQD_ARGUMENT\",\"details\":\"DeferredDynamicRecord.getField: Missing a required argument: fieldId\",\"userEvent\":null,\"stackTrace\":[\"anonymous(N/serverRecordService)\",\"doPost(/SuiteScripts/CreateTransaction.js:186)\"],\"notifyOff\":false},\"id\":\"\",\"notifyOff\":false,\"userFacing\":false}"}	Remove
How could it be missing an argument? the options log.debu is showing the 1 and only argument needed for getField
b
sounds weird, try
Copy code
objRecord.getField({ fieldId: "custbody_transaction_gateway" });
n
maybe try: var fieldObj = objRecord.getField({fieldId:options.fieldId});
think your getField key fieldId is missing because it's coming through quoted from options.