Salesforce Custom Object Get All : Fix TypeError: options.fields.split is not a function

This commit is contained in:
Craig McElroy 2021-03-17 14:17:21 -05:00
parent 7c21e61151
commit 3cb8cd115e
No known key found for this signature in database
GPG key ID: 5175FE27D93DABDC

View file

@ -163,7 +163,7 @@ export function getDefaultFields(sobject: string) {
export function getQuery(options: IDataObject, sobject: string, returnAll: boolean, limit = 0) { export function getQuery(options: IDataObject, sobject: string, returnAll: boolean, limit = 0) {
const fields: string[] = []; const fields: string[] = [];
if (options.fields) { if (options.fields) {
fields.push.apply(fields, (options.fields as string).split(',')); fields.push.apply(fields, options.fields.toString().split(','));
} else { } else {
fields.push.apply(fields, (getDefaultFields(sobject) as string || 'id').split(',')); fields.push.apply(fields, (getDefaultFields(sobject) as string || 'id').split(','));
} }