diff --git a/prepared_steps/1/Address.csv b/prepared_steps/1/Address.csv index c67b821..ecd01cf 100644 --- a/prepared_steps/1/Address.csv +++ b/prepared_steps/1/Address.csv @@ -1,2 +1,2 @@ -Parent.Name,City,Country,PostalCode,Street,Latitude,Longitude,CountryCode -"Plantsoen de Pas 12, 6601 BK WIJCHEN, NL",WIJCHEN,Netherlands,6601 BK,Plantsoen de Pas 12,51.81388993,5.72578937,NL \ No newline at end of file +Parent.Name,City,Country,PostalCode,Street,Latitude,Longitude,CountryCode,PKey__c +"Plantsoen de Pas 12, 6601 BK WIJCHEN, NL",WIJCHEN,Netherlands,6601 BK,Plantsoen de Pas 12,51.81388993,5.72578937,NL,"Plantsoen de Pas 12, 6601 BK WIJCHEN, NL" \ No newline at end of file diff --git a/prepared_steps/1/command.txt b/prepared_steps/1/command.txt new file mode 100644 index 0000000..4c22459 --- /dev/null +++ b/prepared_steps/1/command.txt @@ -0,0 +1 @@ +sf sfdmu run --sourceusername csvfile --targetusername rene.kasseboehmer@vaillant.de.devrene \ No newline at end of file diff --git a/prepared_steps/1/export.json b/prepared_steps/1/export.json index e94bfee..306dabd 100644 --- a/prepared_steps/1/export.json +++ b/prepared_steps/1/export.json @@ -4,11 +4,11 @@ "excludeIdsFromCSVFiles": true, "objects": [ { - "query": "SELECT Name,DuplicateCheck__c,IsInventoryLocation,IsMobile,LocationType,VisitorAddressId FROM Location", + "query": "SELECT Name,DuplicateCheck__c,IsInventoryLocation,IsMobile,LocationType FROM Location", "operation": "Insert", "externalId": "Name" },{ - "query": "SELECT City, Country, PostalCode, Street, Latitude, Longitude, CountryCode, ParentId$Location FROM Address", + "query": "SELECT City, Country, PostalCode, Street, Latitude, Longitude, CountryCode, Pkey__c, ParentId$Location FROM Address", "operation": "Insert" } ] diff --git a/prepared_steps/2/command_dev.txt b/prepared_steps/2/command_dev.txt new file mode 100644 index 0000000..0389686 --- /dev/null +++ b/prepared_steps/2/command_dev.txt @@ -0,0 +1 @@ +sf sfdmu run --sourceusername rene.kasseboehmer@vaillant.de.devrene --targetusername rene.kasseboehmer@vaillant.de.devrene \ No newline at end of file diff --git a/prepared_steps/2/export.json b/prepared_steps/2/export.json new file mode 100644 index 0000000..ba7ea4f --- /dev/null +++ b/prepared_steps/2/export.json @@ -0,0 +1,37 @@ +{ + "allOrNone": true, + "objects": [ + { + "query": "SELECT Id, Pkey__c FROM Address WHERE CountryCode = 'NL' AND PKey__c != null", + "operation": "Readonly" + },{ + "query": "SELECT Id, Name, VisitorAdressId FROM Location WHERE VisitorAddressId = null", + "operation": "Update", + "beforeUpdateAddons": [ + { + "module": "core:RecordsTransform", + "description": "Updates VisitorAddressId with source Address.Id based on Pkey__c", + "args": { + "fields": [ + { + "alias": "sourceAddressIdFromPkey", + "sourceObject": "Address", + "sourceField": "Id", + "lookupExpression": "source.PKey__c == target.Name", + "lookupSource": "source" + } + ], + "transformations": [ + { + "targetObject": "Location", + "targetField": "VisitorAddressId", + "formula": "formula.sourceAddressIdFromPkey" + } + ] + } + } + ], + "externalId": "Name" + } + ] +} \ No newline at end of file diff --git a/objectset_source/object-set-2/Location.csv b/prepared_steps/3/Location.csv similarity index 55% rename from objectset_source/object-set-2/Location.csv rename to prepared_steps/3/Location.csv index 310a05e..2fd7634 100644 --- a/objectset_source/object-set-2/Location.csv +++ b/prepared_steps/3/Location.csv @@ -1,2 +1,2 @@ -ParentLocation.Name,Extension,Flat,Floor,Name,DuplicateCheck__c,IsInventoryLocation,IsMobile,LocationType -"Plantsoen de Pas 12, 6601 BK WIJCHEN, NL",test,,,--,false,false,false,Site \ No newline at end of file +ParentLocation.Name,Extension,Flat,Floor,Name,DuplicateCheck__c,IsInventoryLocation,IsMobile,LocationType,PKey__c +"Plantsoen de Pas 12, 6601 BK WIJCHEN, NL",test,,,--,false,false,false,Site,"Plantsoen de Pas 12, 6601 BK WIJCHEN, NL" \ No newline at end of file diff --git a/prepared_steps/3/command_dev.txt b/prepared_steps/3/command_dev.txt new file mode 100644 index 0000000..4c22459 --- /dev/null +++ b/prepared_steps/3/command_dev.txt @@ -0,0 +1 @@ +sf sfdmu run --sourceusername csvfile --targetusername rene.kasseboehmer@vaillant.de.devrene \ No newline at end of file diff --git a/prepared_steps/3/export.json b/prepared_steps/3/export.json new file mode 100644 index 0000000..d8a4ac6 --- /dev/null +++ b/prepared_steps/3/export.json @@ -0,0 +1,11 @@ +{ + "allOrNone": true, + "excludeIdsFromCSVFiles": true, + "objects": [ + { + "query": "SELECT Extension,Flat,Floor,Name,DuplicateCheck__c,IsInventoryLocation,IsMobile,LocationType,PKey__c FROM Location", + "operation": "Insert", + "useSourceCSVFile": true + } + ] +} \ No newline at end of file diff --git a/prepared_steps/4/command_dev.txt b/prepared_steps/4/command_dev.txt new file mode 100644 index 0000000..4c22459 --- /dev/null +++ b/prepared_steps/4/command_dev.txt @@ -0,0 +1 @@ +sf sfdmu run --sourceusername csvfile --targetusername rene.kasseboehmer@vaillant.de.devrene \ No newline at end of file diff --git a/prepared_steps/4/export.json b/prepared_steps/4/export.json new file mode 100644 index 0000000..75eac37 --- /dev/null +++ b/prepared_steps/4/export.json @@ -0,0 +1,33 @@ +{ + "allOrNone": true, + "objects": [ + { + "query": "SELECT Id, Name, Pkey__c, ParentLocationId FROM Location WHERE Pkey__c != null AND PKey__c like '%NL' AND ParentLocationId = null AND VisitorAddressId = null", + "operation": "Update", + "beforeUpdateAddons": [ + { + "module": "core:RecordsTransform", + "description": "Updates ParentLocationId with source Address.ParentId based on Pkey__c", + "args": { + "fields": [ + { + "alias": "sourceAddressParentIdFromPkey", + "sourceObject": "Address", + "sourceField": "ParentId", + "lookupExpression": "source.PKey__c == target.Pkey__c", + "lookupSource": "source" + } + ], + "transformations": [ + { + "targetObject": "Location", + "targetField": "ParentLocationId", + "formula": "formula.sourceAddressParentIdFromPkey" + } + ] + } + } + ] + } + ] +} \ No newline at end of file diff --git a/source/Address_source.csv b/source/Address_source.csv deleted file mode 100644 index f6b0515..0000000 --- a/source/Address_source.csv +++ /dev/null @@ -1,2 +0,0 @@ -address_identifier,City,Country,PostalCode,Street,Latitude,Longitude,CountryCode -WIJCHENNetherlands6601 BKPlantsoen de Pas12,WIJCHEN,Netherlands,6601 BK,Plantsoen de Pas 12,51.81388993,5.72578937,NL