0

I have one custom object Territory__c which has a standard Field called Name and custom field Territory_Ex_ID__c. So what would be SOQL whole data. Suppose the user list I want to fetch with this detail included.

I am new to salesforce, so please help me with scenario.

Please also help me how to create this custom object and custom field on portal.

5
  • What are you trying to achieve ? Do you want all records to be fetched from Territory__c object in a SOQL query ? You can go through this Write SOQL Queries trailhead module to learn about this topic. Also, keep in mind that there are governor limits in salesforce which we have to respect. – Vijay Ganji Jul 11 '19 at 9:25
  • @VijayGanji what we have right now we fetch the whole user list with basic query but now we want to find out the whole user list with custom fields and custom object to. – curiousMind Jul 11 '19 at 9:28
  • What do you mean by "we want to find out the whole user list with custom fields and custom object to." ? Do you want to query on custom object along with user details ? – Vijay Ganji Jul 11 '19 at 9:58
  • May be i am not clear with salesforce concept. can you please tell me how can we create custom object and field on salesforce portal or login.salesforce.com – curiousMind Jul 11 '19 at 10:06
  • Hey @curiousMind, you can get started with this Data Modeling trailhead module to learn about objects and fields creation in salesforce. – Vijay Ganji Jul 11 '19 at 10:50
1

Standard and custom objects and standard and custom fields are queried in SOQL in exactly the same way. The main difference is in the API names of the objects, fields and relationships.

To query the Territory__c instances you would do:

SELECT Id, Name, Territory_Ex_ID__c FROM Territory__c WHERE ...

Standard objects and fields do not have the suffix "__c" and don't use the suffix "__r" for relationships. For example: the standard Contact object has a standard lookup field "AccountId" that references an Account object, and the equivalent relationship field "Account".

On the other hand, custom objects and fields always have the suffix "__c" in the API name, and relationships end with "__r". For example: a custom Example__c object could have a custom lookup field "Account__c" that references an Account object, and the equivalent relationship field "Account__r".

You will find some useful information in the Salesforce documentation for objects and fields.

3
  • The main difference is in the API names of the objects, fields and relationships. can you please explain me this more or give any link for study about this – curiousMind Jul 11 '19 at 9:24
  • Thanks @PhilW i got the idea about standard and custom object. Can you please do one more thing that how can I create this object on salesforce portal – curiousMind Jul 11 '19 at 10:11
  • That depends on whether you have Lightning Experience (LEX) enabled on the org. Basically, login with an account with required permission to access setup and manage the object schema. For LEX, click on the cog in the top right and select "Setup", then click the Object Manager (may be available as a tab or within the sidebar under Platform Tools > Objects and Fields). For Classic, click the "setup" button near the top right then type "objects" in the quick find box and select the Build > Create > Objects option in the sidebar. In both cases you can then create your custom object type. – Phil W Jul 11 '19 at 10:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.