Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ExampleInstructionFiles/ExampleInstructionFile1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@
<!-- For account we want to apply a filter based on a custom field called Help_Sandbox_Data_Set__c -->
<SbbObject ApiName="Account" Filter="Help_Sandbox_Data_Set__c = true" />
<SbbObject ApiName="Client__c" />
<!-- We can Filter based on RecordTypeId -->
<SbbObject ApiName="Contact" Filter="RecordTypId IN ('0122E000000KjUTQA0')" />
<!-- New Limit feature to avoid performance issues -->
<SbbObject ApiName="Campaign" Limit="50" />
</SbbObjects>
</SbbInstructionSet>
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
# SandboxBerry
A tool for copying test data into Salesforce sandboxes

# What's New

## Recent Updates

- **Merged Feature:** Reprocess missing lookups after import ([#5](https://github.com/codeulike/SandboxBerry/issues/5))
- **Added support for "Limit":** You can now limit the number of records transferred per object.
- **Added support to save (source/target) passwords:** Credentials can be saved for convenience.
- **Updated to .NET Framework 4.8:** The application now targets .NET 4.8 for improved compatibility and security.
- **Updated Log4Net NuGet package:** Logging dependencies have been updated.
- **Cleaned up using statements:** Codebase maintenance for clarity and performance.

# What is this for?

During Salesforce development you will generally create Sandboxes based on your production environment, and then
do development in the Sandbox. Most Salesforce Sandboxes are blank (except for the more expensive ones). Generally to do
some development you're going to want some data in there, for example

* Any reference tables/objects you've created (e.g. Geo_Country__c - a list of countries)
* Any reference tables/objects you've created (e.g. Country__c - a list of countries)
* Some sample data in the main tables to experiment with during development.

So ... you can try and copy some data accross using DataLoader or an ETL tool, but you'll quickly find:
Expand Down Expand Up @@ -42,8 +53,8 @@ SandboxBerry is Open Source under the GPL2 license.

# Downloading

SandboxBerry is a windows application written in C# and uses the .NET Framework 4.5.
You'll need .NET 4.5 Framework installed already (most recent PCs will have it)
SandboxBerry is a windows application written in C# and uses the .NET Framework 4.8.
You'll need .NET 4.8 Framework installed already (most recent PCs will have it)

* Download the latest Zip from the [GitHub Releases](https://github.com/codeulike/SandboxBerry/releases) page
* Unzip it in a folder and run SandboxBerry.exe
Expand All @@ -52,8 +63,8 @@ You'll need .NET 4.5 Framework installed already (most recent PCs will have it)
# Running from Source

Visual Studio 2012 was used for the initial project but it should be easily loadable in more recent versions of VS.
Download the solution and ooen it in VS.
You'll need .NET 4.5 installed.
Download the solution and open it in VS.
You'll need .NET 4.8 installed.

# Getting Started

Expand Down
1 change: 1 addition & 0 deletions Sandboxberry/.vs/Sandboxberry.csproj.dtbcache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"RootPath":"C:\\Users\\Admin\\source\\repos\\shahrier\\SandboxBerry\\Sandboxberry","ProjectFileName":"Sandboxberry.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"AboutForm.cs"},{"SourceFile":"AboutForm.Designer.cs"},{"SourceFile":"MainForm.cs"},{"SourceFile":"MainForm.Designer.cs"},{"SourceFile":"Program.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"Properties\\Resources.Designer.cs"},{"SourceFile":"Properties\\Settings.Designer.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.8.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Users\\Admin\\source\\repos\\shahrier\\SandboxBerry\\SandboxberryLib\\bin\\Debug\\SandboxberryLib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":true,"ProjectPath":"C:\\Users\\Admin\\source\\repos\\shahrier\\SandboxBerry\\SandboxberryLib\\bin\\Debug\\SandboxberryLib.dll"},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Configuration.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Deployment.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Drawing.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Web.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Windows.Forms.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"C:\\Users\\Admin\\source\\repos\\shahrier\\SandboxBerry\\Sandboxberry\\bin\\Debug\\Sandboxberry.exe","OutputItemRelativePath":"Sandboxberry.exe"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}
16 changes: 11 additions & 5 deletions Sandboxberry/App.config
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Sandboxberry.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="Sandboxberry.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
<userSettings>
<Sandboxberry.Properties.Settings>
Expand All @@ -25,6 +25,12 @@
<setting name="SetInstructionsFile" serializeAs="String">
<value />
</setting>
<setting name="SetSourcePassword" serializeAs="String">
<value />
</setting>
<setting name="SetTargetPassword" serializeAs="String">
<value />
</setting>
</Sandboxberry.Properties.Settings>
</userSettings>
</configuration>
</configuration>
4 changes: 2 additions & 2 deletions Sandboxberry/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 12 additions & 29 deletions Sandboxberry/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,13 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using log4net;

using Sandboxberry.Properties;
using SandboxberryLib;
using SandboxberryLib.InstructionsModel;
using Sandboxberry.Properties;
using System;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Sandboxberry
{
Expand All @@ -55,17 +48,16 @@ public void DisableForm()
{
c.Enabled = false;
}


}

public void SaveUserSettings()
{

{
Settings.Default["SetSourceUrl"] = uxSourceUrl.SelectedIndex;
Settings.Default["SetSourceUsername"] = uxSourceUsername.Text;
Settings.Default["SetSourcePassword"] = uxSourcePassword.Text;
Settings.Default["SetTargetUrl"] = uxTargetUrl.SelectedIndex;
Settings.Default["SetTargetUsername"] = uxTargetUsername.Text;
Settings.Default["SetTargetPassword"] = uxTargetPassword.Text;
Settings.Default["SetInstructionsFile"] = uxInstructionsFilename.Text;
Settings.Default.Save();
}
Expand All @@ -78,8 +70,10 @@ public void RetrieveUserSettings()
{
uxSourceUrl.SelectedIndex = (int)(Settings.Default["SetSourceUrl"]);
uxSourceUsername.Text = Settings.Default["SetSourceUsername"].ToString();
uxSourcePassword.Text = Settings.Default["SetSourcePassword"].ToString();
uxTargetUrl.SelectedIndex = (int)(Settings.Default["SetTargetUrl"]);
uxTargetUsername.Text = Settings.Default["SetTargetUsername"].ToString();
uxTargetPassword.Text = Settings.Default["SetTargetPassword"].ToString();
uxInstructionsFilename.Text = Settings.Default["SetInstructionsFile"].ToString();
}

Expand Down Expand Up @@ -110,7 +104,6 @@ private async void uxStartButton_Click(object sender, EventArgs e)
{
ShowUiProcessStarted();
SaveUserSettings();


try
{
Expand All @@ -130,18 +123,14 @@ private async void uxStartButton_Click(object sender, EventArgs e)
ShowUiProcessEnded();
MessageBox.Show(string.Format("Unexpected error: {0} \r\n\r\n See Log.txt file for details", ex.Message), "Unexpected Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);

}


}

private void ShowUiProcessStarted()
{
uxStartButton.Enabled = false;
uxWaitPicture.Visible = true;
clearTargetDataToolStripMenuItem.Enabled = false;

}

private void ShowUiProcessEnded()
Expand All @@ -166,9 +155,9 @@ private SbbInstructionSet LoadInstructions()
private SbbCredentials GetSourceCredentials()
{
var sourceCred = new SbbCredentials();
sourceCred.SalesforceUrl = "https://test.salesforce.com/services/Soap/u/32.0";
sourceCred.SalesforceUrl = "https://test.salesforce.com/services/Soap/u/54.0";
if (uxSourceUrl.SelectedItem != null && uxSourceUrl.SelectedItem.ToString().StartsWith("Live"))
sourceCred.SalesforceUrl = "https://login.salesforce.com/services/Soap/u/32.0";
sourceCred.SalesforceUrl = "https://login.salesforce.com/services/Soap/u/54.0";
sourceCred.SalesforceLogin = uxSourceUsername.Text;
sourceCred.SalesforcePassword = uxSourcePassword.Text;
return sourceCred;
Expand All @@ -177,7 +166,7 @@ private SbbCredentials GetSourceCredentials()
private SbbCredentials GetTargetCredentials()
{
var targetCred = new SbbCredentials();
targetCred.SalesforceUrl = "https://test.salesforce.com/services/Soap/u/32.0";
targetCred.SalesforceUrl = "https://test.salesforce.com/services/Soap/u/54.0";
targetCred.SalesforceLogin = uxTargetUsername.Text;
targetCred.SalesforcePassword = uxTargetPassword.Text;
return targetCred;
Expand Down Expand Up @@ -230,8 +219,6 @@ private async void clearTargetDataToolStripMenuItem_Click(object sender, EventAr
MessageBoxButtons.OK, MessageBoxIcon.Error);

}


}
}

Expand Down Expand Up @@ -284,9 +271,5 @@ private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
about.ShowDialog();
}
}




}
}
6 changes: 1 addition & 5 deletions Sandboxberry/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using log4net;

namespace Sandboxberry
{
Expand Down Expand Up @@ -75,7 +72,6 @@ static void Application_ThreadException(object sender, System.Threading.ThreadEx
else
Application.Exit();


}
}
}
46 changes: 19 additions & 27 deletions Sandboxberry/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading