Pages

Showing posts with label object. Show all posts
Showing posts with label object. Show all posts

Thursday, May 2, 2024

Salesforce: Custom Object without Tab

It's easy to create a custom tab to create a new record of an object from UI; however, in some scenarios, we (admin) are not supposed to create a custom tab, so how to enter new data from the UI, or to see data created (I know we can use report if that object is enabled for reporting) in UI.

Create a New Record
https://domainname.lightning.force.com/lightning/o/objectname__c/new

View Record in the List View
https://domainname.lightning.force.com/lightning/o/objectname__c/list?filterName=Recent
Once you have landed in the list view, you can create a new list view with filters to see the data as needed.



Thursday, April 18, 2024

Salesforce: Public Read/Write Access




What does Public Read/Write access mean for a user? This means all users can view and edit all records for that object, but only when the user has permission to access the object (minimum read access). The object permission can be set in Profile or Permission Set assigned to the user.

For example, if Tom is the owner of Trident Inc.'s record, all users can view and edit it. However, only Tom can change the owner or delete (if he has Delete permission given via Profile or Permission Set) the Trident Inc. record.


Scenario:

1. User Profile (and Permission Set) does not have access to the object

  • Unable to access any records
  • Unable to own records from the object 


2. User Profile (or Permission Set) has Read access to the object

  • Able to own records 
  • Able to access records owned by any users


3. User Profile (or Permission Set) has Edit access to the object

  • Able to own records 
  • Able to edit records owned by any users
  • Not able to change record owner, only record owner (and users above the role hierarchy if Grant Access Using Hierarchies is enabled for custom objects; Grant Access Using Hierarchies is always enabled for standard objects)


4. User Profile (or Permission Set) has Create access to the object

  • Read access will be auto-enabled
  • Able to create records 


5. User Profile (or Permission Set) has Delete access to the object

  • Read and Edit access will be auto-enabled
  • Able to delete records owned
  • Delete permission does not roll up to users above the role hierarchy; even the Grant Access Using Hierarchies is enabled 


So, in other words, View All permission is replaced with Read permission, while Edit All permission is replaced by Edit permission. 


Note: Profile permission access does not roll up to user by Role Hierarchy


Reference: 




Wednesday, April 17, 2024

Salesforce: Finding Child Objects

As a Salesforce admin, seeing the parent objects of an object is easy; just go to the Object Manager, look in Fields & Relationships, and look for fields with type = Lookup or Master-Detail.

However, the other way around, looking for child objects from an object is not straightforward; developers can use getChildSObject(). 

Here is a way to find child objects, which is using Workbench.

Navigate to Standard & Custom Objects, choose the object, and see items under "Child Relationships"  


The one with cascadeDelete = True is the Master-Detail relationship, while cascadeDelete = False is the Lookup relationship.

Another way to look for custom child objects is by creation action and selecting "Create a Record"




If you know any other ways, feel free to comment.



Saturday, April 22, 2023

Salesforce: Query all Objects

As admin/developer, you can easily see all objects available in an org., but sometimes we need to get the list of the objects. Of course you can manually copy and paste from the Object Manager, but that is not ideal. 

Salesforce provide ability query using Tooling API from version 32.0 and later. EntityDefinition provides row-based access to metadata about standard and custom objects.

Sample query: 

SELECT QualifiedApiName, Label, ExternalSharingModel, InternalSharingModel, DurableId, DeploymentStatus, NamespacePrefix, Description, LastModifiedDate, LastModifiedById FROM EntityDefinition ORDER BY QualifiedApiName 


Compare from the Object Manager UI, using query, you also can also get the object sharing model, last modified by, DurableId. In this query, DurableId is the object Id, if you open a custom object from object manager, e.g. https://domain.lightning.force.com/lightning/setup/ObjectManager/01I50000000RAjx/Details/view, the one in bold is DurableId. While for standard object such as Account, the DurableId is Account, e.g.  https://domain.lightning.force.com/lightning/setup/ObjectManager/Account/Details/view

01I prefix is for CustomEntityDefinition


Reference:


Page-level ad