mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
🐛 Salesforce Get All : Handle string and array options.fields (#1590)
This commit is contained in:
@@ -163,7 +163,12 @@ 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) {
|
||||||
|
// options.fields is comma separated in standard Salesforce objects and array in custom Salesforce objects -- handle both cases
|
||||||
|
if (typeof options.fields === 'string') {
|
||||||
|
fields.push.apply(fields, options.fields.split(','));
|
||||||
|
} else {
|
||||||
fields.push.apply(fields, options.fields as string[]);
|
fields.push.apply(fields, options.fields as string[]);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
fields.push.apply(fields, (getDefaultFields(sobject) as string || 'id').split(','));
|
fields.push.apply(fields, (getDefaultFields(sobject) as string || 'id').split(','));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user