function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Pedro Garcia GPedro Garcia G 

Create custom field in Scratch org

Hi...

I'm developing my first package in SF, I'm using SFDX and VisualStudio Code DX.

I need to create a custom field in Contact object and test it in Scratch org.

How could I do it? where could I get the documentation to understand that specific topic?

Thanks a lot.
Best Answer chosen by Pedro Garcia G
Raj VakatiRaj Vakati
you can do it in two ways 

Option1  : 

Login into the scratch org and open you can able to create from the object manager 

Option 2 : using SFDX command 


create an field defination in the objectdefaniation file and push it using sfdx command 

https://github.com/wadewegner/sfdx-platformencryption
https://www.jitendrazaa.com/blog/salesforce/getting-started-with-salesforce-dx-salesforce-developer-experience/
https://corevalue.net/salesforce-dx-for-continuous-integration-and-delivery/
 

All Answers

Raj VakatiRaj Vakati
you can do it in two ways 

Option1  : 

Login into the scratch org and open you can able to create from the object manager 

Option 2 : using SFDX command 


create an field defination in the objectdefaniation file and push it using sfdx command 

https://github.com/wadewegner/sfdx-platformencryption
https://www.jitendrazaa.com/blog/salesforce/getting-started-with-salesforce-dx-salesforce-developer-experience/
https://corevalue.net/salesforce-dx-for-continuous-integration-and-delivery/
 
This was selected as the best answer
Pedro Garcia GPedro Garcia G
Thanks Raj,

The JitTendrazza blog is very good. I fixed my issue by Option 1. I didn't understand that I had to set the Permission Setting for each custom object. Now I got it.

Thanks for your reply.
Raj VakatiRaj Vakati
Great .. close this thread