first draft update account
This commit is contained in:
2
prepared_steps/1_extract_data/command.bat
Normal file
2
prepared_steps/1_extract_data/command.bat
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
@echo off
|
||||||
|
python .\extract_via_simple_salesforce.py --context qa2
|
@ -1 +0,0 @@
|
|||||||
python .\extract_via_simple_salesforce.py --context prod
|
|
@ -2,10 +2,10 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"sobject": "SCInstalledBaseLocation__c",
|
"sobject": "SCInstalledBaseLocation__c",
|
||||||
"query": "SELECT Id, City__c, Country__c, GeoY__c, GeoX__c, PostalCode__c, Street__c, Extension__c, HouseNo__c, FlatNo__c, Floor__c FROM SCInstalledBaseLocation__c WHERE Country__c = 'NL'"
|
"query": "SELECT Id, City__c, Country__c, GeoY__c, GeoX__c, PostalCode__c, Street__c, Extension__c, HouseNo__c, FlatNo__c, Floor__c FROM SCInstalledBaseLocation__c WHERE Country__c = 'NL' limit 1"
|
||||||
},{
|
},{
|
||||||
"sobject": "SCInstalledBase__c",
|
"sobject": "SCInstalledBase__c",
|
||||||
"query": "SELECT Id, Name, CommissioningDate__c,InstallationDate__c,ProductEnergy__c, ProductUnitClass__c,ArticleNo__c,SerialNo__c, SerialNoException__c, ProductUnitType__c, InstalledBaseLocation__c FROM SCInstalledBase__c WHERE Country__c = 'NL'"
|
"query": "SELECT Id, Name, CommissioningDate__c,InstallationDate__c,ProductEnergy__c, ProductUnitClass__c,ArticleNo__c,SerialNo__c, SerialNoException__c, ProductUnitType__c, InstalledBaseLocation__c FROM SCInstalledBase__c WHERE Country__c = 'NL' limit 1"
|
||||||
},{
|
},{
|
||||||
"sobject": "Asset",
|
"sobject": "Asset",
|
||||||
"query": "SELECT Id, Serialnumber FROM Asset WHERE Location.ParentLocation.Name LIKE '%NL'"
|
"query": "SELECT Id, Serialnumber FROM Asset WHERE Location.ParentLocation.Name LIKE '%NL'"
|
||||||
|
1
prepared_steps/8_update_personaccounts/command.txt
Normal file
1
prepared_steps/8_update_personaccounts/command.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
sf sfdmu run --sourceusername rene.kasseboehmer@vaillant.de.devrene --targetusername rene.kasseboehmer@vaillant.de.devrene
|
72
prepared_steps/8_update_personaccounts/export.json
Normal file
72
prepared_steps/8_update_personaccounts/export.json
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
{
|
||||||
|
"allOrNone": true,
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"query": "SELECT Id, SobjectType from recordtype where SobjectType = 'Account' and Name = 'Person'",
|
||||||
|
"operation": "Readonly",
|
||||||
|
"master": false
|
||||||
|
},{
|
||||||
|
"query": "SELECT Id, BillingHouseNo__c,BillingStreet__c, BillingCountry__c,BillingPostalCode__c FROM Account WHERE isPersonAccount = true and BillingCountry__c = 'NL' AND RecordTypeId = '01220000000E59RAAS'",
|
||||||
|
"operation": "Update",
|
||||||
|
"master": true,
|
||||||
|
"beforeUpdateAddons": [
|
||||||
|
{
|
||||||
|
"module": "core:RecordsTransform",
|
||||||
|
"description": "Updates RecordTypeId with source .Id based on Pkey__c",
|
||||||
|
"args": {
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"alias": "sourceRecordTypeId",
|
||||||
|
"sourceObject": "recordtype",
|
||||||
|
"sourceField": "Id",
|
||||||
|
"lookupExpression": "source.Name == 'Person'"
|
||||||
|
},{
|
||||||
|
"alias": "sourceAddressCountryForFSL",
|
||||||
|
"sourceObject": "Account",
|
||||||
|
"sourceField": "BillingCountry__c",
|
||||||
|
"lookupExpression": "source.Id == target.Id"
|
||||||
|
},{
|
||||||
|
"alias": "sourceAddressStreetForFSL",
|
||||||
|
"sourceObject": "Account",
|
||||||
|
"sourceField": "BillingStreet__c",
|
||||||
|
"lookupExpression": "source.Id == target.Id"
|
||||||
|
},{
|
||||||
|
"alias": "sourceAddressHouseNoForFSL",
|
||||||
|
"sourceObject": "Account",
|
||||||
|
"sourceField": "BillingHouseNo__c",
|
||||||
|
"lookupExpression": "source.Id == target.Id"
|
||||||
|
},{
|
||||||
|
"alias": "sourceAddressPostalCodeForFSL",
|
||||||
|
"sourceObject": "Account",
|
||||||
|
"sourceField": "BillingPostalCode__c",
|
||||||
|
"lookupExpression": "source.Id == target.Id"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"transformations": [
|
||||||
|
{
|
||||||
|
"targetObject": "Account",
|
||||||
|
"targetField": "RecordTypeId",
|
||||||
|
"formula": "formula.sourceRecordTypeId"
|
||||||
|
},{
|
||||||
|
"targetObject": "Account",
|
||||||
|
"targetField": "BillingCountryCode",
|
||||||
|
"formula": "formula.sourceAddressCountryForFSL"
|
||||||
|
},{
|
||||||
|
"targetObject": "Account",
|
||||||
|
"targetField": "BillingStreet",
|
||||||
|
"formula": "formula.sourceAddressStreetForFSL + ' ' + formula.sourceAddressHouseNoForFSL"
|
||||||
|
},{
|
||||||
|
"targetObject": "Account",
|
||||||
|
"targetField": "BillingPostalCode",
|
||||||
|
"expressions": [
|
||||||
|
"formula.exists = formula.sourceAddressPostalCodeForFSL"
|
||||||
|
],
|
||||||
|
"formula": "formula.exists ? formula.sourceAddressPostalCodeForFSL : null"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
21
run.bat
21
run.bat
@ -1,26 +1,17 @@
|
|||||||
@echo off
|
@echo off
|
||||||
setlocal enabledelayedexpansion
|
setlocal enabledelayedexpansion
|
||||||
|
|
||||||
:: Change directory to where prepared_steps is located
|
cd .\prepared_steps
|
||||||
cd ..\..\prepared_steps
|
|
||||||
|
|
||||||
:: Loop through all folders in prepared_steps
|
|
||||||
for /d %%f in (*.*) do (
|
for /d %%f in (*.*) do (
|
||||||
set "current_dir=%%f"
|
if exist "%%f\command.bat" (
|
||||||
|
echo Running command from %%f
|
||||||
|
|
||||||
:: Check if command.txt exists in the current folder
|
for /f "usebackq delims=" %%c in ('type "%%f\command.bat"') do (
|
||||||
if exist "%current_dir%\command.txt" (
|
call %%c
|
||||||
echo Running command from %current_dir%
|
|
||||||
|
|
||||||
:: Read the command from command.txt and execute it
|
|
||||||
for /f %%c in ('type "%current_dir%\command.txt"') do (
|
|
||||||
start "" "%%c"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
:: Pause after each command to see results
|
|
||||||
pause
|
|
||||||
) else (
|
) else (
|
||||||
echo No command.txt found in %current_dir%
|
echo No command.bat found in %%f
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user