diff --git a/src/commands/texei/data/import.ts b/src/commands/texei/data/import.ts index 9248c5f..9fe874e 100644 --- a/src/commands/texei/data/import.ts +++ b/src/commands/texei/data/import.ts @@ -196,11 +196,10 @@ export default class Import extends SfCommand { // If object is PricebookEntry, look for standard price book let standardPriceBookId = ''; - if (sobjectName === 'PricebookEntry') { - standardPriceBookId = ((await conn.query('Select Id from Pricebook2 where IsStandard = true')).records[0] as any) - .Id; - } - + // if (sobjectName === 'PricebookEntry', ) { + standardPriceBookId = ((await conn.query('Select Id from Pricebook2 where IsStandard = true')).records[0] as any).Id; + // } + // Replace data to import with newly generated Record Type Ids for (const sobject of jsonData) { // Remove fields that are not on target org if requested @@ -223,14 +222,8 @@ export default class Import extends SfCommand { // Replace all lookups for (const lookup of lookups) { // Regular lookups - if ( - sobject[lookup.name] && - !( - sobjectName === 'PricebookEntry' && - sobject.Pricebook2Id === 'StandardPriceBook' && - lookup.name === 'Pricebook2Id' - ) - ) { + //if (sobject[lookup.name] && !(sobjectName === 'PricebookEntry' && sobject.Pricebook2Id === 'StandardPriceBook' && lookup.name === 'Pricebook2Id')) + if(sobject[lookup.name] && !(sobject.Pricebook2Id === 'StandardPriceBook' && lookup.name === 'Pricebook2Id')) { sobject[lookup.name] = recordIdsMap.get(sobject[lookup.name]); } @@ -343,7 +336,8 @@ export default class Import extends SfCommand { } // If object is PricebookEntry, use standard price book from target org - if (sobjectName === 'PricebookEntry' && sobject.Pricebook2Id === 'StandardPriceBook') { + //if (sobjectName === 'PricebookEntry' && sobject.Pricebook2Id === 'StandardPriceBook') { + if (sobject.Pricebook2Id === 'StandardPriceBook') { sobject.Pricebook2Id = standardPriceBookId; }