address, paren location & child location logic finished
This commit is contained in:
@ -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
|
||||
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"
|
|
1
prepared_steps/1/command.txt
Normal file
1
prepared_steps/1/command.txt
Normal file
@ -0,0 +1 @@
|
||||
sf sfdmu run --sourceusername csvfile --targetusername rene.kasseboehmer@vaillant.de.devrene
|
@ -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"
|
||||
}
|
||||
]
|
||||
|
1
prepared_steps/2/command_dev.txt
Normal file
1
prepared_steps/2/command_dev.txt
Normal file
@ -0,0 +1 @@
|
||||
sf sfdmu run --sourceusername rene.kasseboehmer@vaillant.de.devrene --targetusername rene.kasseboehmer@vaillant.de.devrene
|
37
prepared_steps/2/export.json
Normal file
37
prepared_steps/2/export.json
Normal file
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
2
prepared_steps/3/Location.csv
Normal file
2
prepared_steps/3/Location.csv
Normal file
@ -0,0 +1,2 @@
|
||||
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"
|
|
1
prepared_steps/3/command_dev.txt
Normal file
1
prepared_steps/3/command_dev.txt
Normal file
@ -0,0 +1 @@
|
||||
sf sfdmu run --sourceusername csvfile --targetusername rene.kasseboehmer@vaillant.de.devrene
|
11
prepared_steps/3/export.json
Normal file
11
prepared_steps/3/export.json
Normal file
@ -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
|
||||
}
|
||||
]
|
||||
}
|
1
prepared_steps/4/command_dev.txt
Normal file
1
prepared_steps/4/command_dev.txt
Normal file
@ -0,0 +1 @@
|
||||
sf sfdmu run --sourceusername csvfile --targetusername rene.kasseboehmer@vaillant.de.devrene
|
33
prepared_steps/4/export.json
Normal file
33
prepared_steps/4/export.json
Normal file
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user