About Me

My photo
PLANO, Texas, United States

Tuesday, November 26, 2024

DevOps Center​

  • DevOps Center lets you choose whether to manage your releases from its point-and-click interface, or directly from the source control system, or a combination of both. Under the hood, we manage the source control branches so developers and builders can focus on development tasks.​
  • Because all changes are captured in a source control system, you have a single source of truth for configuration and code, which improves collaboration across all functions: admins, developers, release managers, QA, and other business stakeholders.​

What do you need to start with DevOps Center?

  • Access to DevOps Center in Salesforce​
  • Access to Dev Org, Dev Integrated Org, QA Org, and Stage Org​
  • Access to GitHub, (BB is in Beta as of 11/26/2024)

Work Item-

In Salesforce DevOps Center, a work item is a logical unit of work that represents a collection of metadata changes for a project​

Because all changes are captured in a source control system, you have a single source of truth for configuration and code, which improves collaboration across all functions: admins, developers, release managers, QA, and other business stakeholders.​

A work item encapsulates information about an objective or task while it’s being worked on and is assigned to one individual. The work item is a historical record if questions arise about those changes. ​

Create Review ​

  • Once work item is created and components get added, pls submit for review by clicking the “Create Review” button on Work item.​
  • When a work item is reviewed and approved, you can change the status to Ready to Promote.​

Recommendation on Work Item​

  • If a plan changes, or if a change conflicts with another change, you can change the status of a work item to Never. This will make the work item inactive and return the committed files to the list of available changes. ​
  • Limit the number of work items​
  • Combine work items​

Things to Remember​

  • SF Devops center is in its initial stages, It's not as rich as other tools like Flosum or Copado or many more.​
  • We will not have the cool feature that flosum had which is the Overwrite protection against the org.​
  • BitBucket is support is still in Beta version

Thursday, February 29, 2024

Working with Polymorphic Relationships in SOQL Queries

Polymorphic Relationships

Polymorphic fields are defined as fields that can reference more than one Object. A polymorphic lookup field is a lookup field that allows you to select a record from more than one table therefore ‘morphing’ into many (poly!) tables. For example:
  • A Lead or Case Owner can be either a User or a Queue record since the Lead Owner and Case Owner are both Lookup (User, Queue) fields.
  • Who relationship field of a Task can be a Contact or a Lead.
  • What: This field represents nonhuman objects that are associated with the record.

How to check if a field is Polymorphic?

To determine what kind a field is, call describeSObjects() on the object and examine the properties of the field. Also, you can check the below properties in Workbench.
  • If relationshipName is not null, the field is a relationship field.
  • If, in addition, namePointing is true, polymorphicForeignKey is true, and referenceTo has more than one referenced object type, then the field is polymorphic.

How to use Polymorphic fields in SOQL query?

You can use polymorphic fields in several ways.
  • You can use the polymorphic field for the relationship.
            [SELECT Id, What.Name FROM Event]
  • You can use the Type qualifier on a polymorphic field to get the associate object name. For example, if you wanted to pull events created only under Account and Opportunity, you can use as below:
            [SELECT Id FROM Event WHERE What.Type IN ('Account', 'Opportunity')]
  • You can use a TYPEOF clause in a query. A TYPEOF expression specifies a set of fields to select that depends on the runtime type of the polymorphic reference. For example, you need to find the Event information along with reference object information. If the event is linked with Account pull Phone and  NumberOfEmployees, if the event is linked to Opportunity then get THEN Amount, CloseDate otherwise get email and name. 
            [SELECT  
                TYPEOF What
                    WHEN Account THEN Phone, NumberOfEmployees
                    WHEN Opportunity THEN Amount, CloseDate
                    ELSE Name, Emai
                END
            FROM Event]