Questions tagged [switch]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers
46 views

Programmatic way to switch current selected app?

This is exactly the same question from here: Programmatic way to switch apps? However this solution is outdated and not working anymore. Is there any way to switch from the current selected app to ...
user avatar
0 votes
1 answer
321 views

Variable does not exist when passing SObject as parameter to method

Refactoring code to merge similar operations and getting an error the SObjects I'm passing to this method are variables that do not exist. private static List<SObject> getSObjectList(SObject ...
user avatar
0 votes
1 answer
997 views

Can I perform a switch statement in AMPscript?

new SFMC user here. I'm just wondering if there's an equivalent of a javascript (or GTL) switch statement within AMPscript or if I'm restricted to using IF ELSE statements. For example, If I take the ...
user avatar
  • 3
1 vote
1 answer
35 views

How to eliminate if/elseif/else chain for SObjectType variables? [duplicate]

In a few places I have code of this nature: private static void myMethod(SObjectType t) { if (t == Claim__c.SObjectType) xyzForClaims(); else if (t == Account.SObjectType) xyzForAccounts(); ...
user avatar
  • 129k
9 votes
1 answer
3k views

Switch "when" cannot see constants?

I am trying to use a switch statement with constants but it doesn't appear that the switch statement can see the constants. At the top of the class I have: private final String A_B_C = 'a b c'; ...
user avatar
  • 4,441