Skip to content

Formatting: TYPEOF query should provide better formatting #135

@paustint

Description

@paustint
  • Feature
  • Bug

Description

SELECT Id, Name, Address, AnnualRevenue, ConvertedAccount.Id, ConvertedAccount.Name,
	ConvertedContact.Id, ConvertedContact.Name, ConvertedOpportunity.Id, ConvertedOpportunity.Name,
	TYPEOF Owner WHEN User THEN Id, Name, Account.Id, Account.Name, Account.GL_Treatment__c, Account.GL_Treatment__r.Id, Account.GL_Treatment__r.Name, Account.auto_number_test_1__c ELSE Id END
FROM Lead

Not sure the best structure, but something like this might be nice

SELECT Id, Name, Address, AnnualRevenue, ConvertedAccount.Id, ConvertedAccount.Name,
	ConvertedContact.Id, ConvertedContact.Name, ConvertedOpportunity.Id, ConvertedOpportunity.Name,
        TYPEOF Owner
            WHEN User
                THEN Id, Name, Account.Id, Account.Name, Account.GL_Treatment__c, Account.GL_Treatment__r.Id,
                    Account.GL_Treatment__r.Name, Account.auto_number_test_1__c
            ELSE Id
        END
FROM Lead

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions