- Install SFDX
- Authorize target org within SFDX with desired alias
Open powershell and fire this command
./createstagingwithattachment.ps1 -objectName [OBJECT NAME] -instanceName [ORG NAME] -objectData [OBJECT FIELD DATA] -attachment [ATTACHMENT FILE]
- [OBJECT NAME] = api name of the object for which record is to be created
- [ORG NAME] = alias/username of salesforce org
- [OBJECT FIELD DATA] = object data in space separated format (refer examples)
- [ATTACHMENT FILE] = file path for the attachment file to be uploaded
./createstagingwithattachment.ps1 -objectName Account -instanceName test -objectData "Name='testaccount2' Phone='8765434567'" -attachment "c:\test.txt"
./createstagingwithattachment.ps1 -objectName Contact -instanceName test -objectData "Lastname='testcontact' Phone='18765434567'" -attachment "c:\test.txt"
Uses SFDX plugins from Shane McLaughlin To understand installation and other options refer https://github.com/mshanemc/shane-sfdx-plugins
- Install Shane's SFDX plugins
sfdx plugins:install shane-sfdx-plugins
./createstagingwithattachment2.ps1 -objectName Contact -instanceName test -objectData "Lastname='testcontact' Phone='18765434567'" -attachment "c:\test.txt"