Questions tagged [operators]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
40 views

How to rewrite that ternary operator code to if-else?

I can't understand that part of the code - how to rewrite this to if-s and else? Especially the partthis.map1?.containsKey(custom_object__c?.workflow_status__c) List<custom_object_2__c> ...
user avatar
  • 35
-1 votes
2 answers
28 views

Need a validation rule for two different account types

I have two account types, Provider and Partner. My task is to forbid to create or change the record without entering a special code in a custom field. For Partner it should start from PRT, for ...
user avatar
0 votes
1 answer
377 views

How to use caret in Apex?

If I use the caret symbol to represent "power of" in Decimal-based mathematical expressions it throws me an error. ^ operator can only be applied to Boolean expressions or to Integer or Long ...
user avatar
4 votes
1 answer
215 views

Minified code in LWC is wrong because of optional chaining operator

I have a LWC that has a simple getter function that controls whether to display an element or not: get _isGridNotEmpty(){ return this._gridData?.length > 0; } However I found that the element ...
user avatar
  • 344
8 votes
2 answers
853 views

Using <> vs. !=

Is there any difference between using <> and != for checking if two native objects are not equal to each other in Apex? i.e. String, Date etc. I have only ever used != which has never failed me ...
user avatar
1 vote
3 answers
284 views

Formula is too big to execute (5,221 characters). Maximum size is 5,000 characters [closed]

Below is my formula that I want to execute I tried using '&& and ||' instead but I am still getting error Can you please help IF( AND( $RecordType.Name = "Reseller", ...
user avatar
1 vote
1 answer
80 views

How to formulate IF value_if_false to leave field as is

I have a field that is formulated to give me a day-count since a project has been created called "Study Age", written as such: IF( ISPICKVAL( Status__c , "Active"), TODAY () - ...
user avatar
  • 11
9 votes
2 answers
1k views

Ternary Operator Compile Failure. Incompatible types in ternary operator

Assume we have some code in Apex: APEX Boolean isString = true; // or false List<String> labels = new List<String>{ 'Label' }; Object entity = isString ? labels.get(0) : ...
user avatar
0 votes
1 answer
122 views

Assignment Operation in Apex

I'm going through a code implemented by one of our vendors and come across below assignment operation, serialNumberObj.Prefunded__c = snWrap.Prefunded == 'ZEW'; Here, Prefunded__c is a boolean field ...
user avatar
  • 33
0 votes
2 answers
824 views

Not equal to comparison operator does not work

I have a list of opportunities that I fetched via SOQL query. I am trying to check if any of the fetched opportunities is 'Closed Lost' or 'Closed - Lost'or 'Completed' or 'Closed Won'. If not, then I ...
user avatar
  • 555
1 vote
1 answer
78 views

Assigning operators for Date fields and comparing with today(), Scheduled Apex Code

Exam_Date__c = 01/01/2018, Expiration_Date__c = 01/31/2018 (usually 30 days gap) I want to send an email 7 days prior to expiration, on say eg. 01/25/2018, likewise. I used the following formula in ...
user avatar
5 votes
1 answer
215 views

Docs about comparison operators saying case-sensitive

Above all sorry about the title, couldn't find a good one. Please edit if you think of any I stumbled upon this description about equals operator in Salesforce docs. OPERATOR NAME DESCRIPTION ...
user avatar
  • 479
0 votes
1 answer
45 views

Ternary Operator error - Error: Compile Error: expecting a colon, found ')' at line

(!GWB_Utility.isNull(cust.FinancialIndicator)?cust.FinancialIndicator == 'Y'? 'Yes':cust.FinancialIndicator == 'N'? 'No':null); Idea - the value will be either Y/N/Null - If it's Y show Yes , N show ...
user avatar
  • 163
1 vote
1 answer
39 views

Best way to implement a formula

I have a scenerio which is based on a field of a record. This field is a lookup relation ship to another record. Example on my abc__c object I have lookup to xyz__c object. The xyz__c object has a ...
user avatar
  • 4,591
2 votes
2 answers
5k views

comparing and assign values to a variable on same line

I saw this kind of logic somewhere in an apex code and got curious about how this can be done. The code is a one liner and does variable check and assignment in the same line. It uses the <> ...
user avatar
  • 4,591
3 votes
3 answers
660 views

Operator Precedence in formula field

I have formula field like this: 2*2^3 Result = 64 Expected Result = 16 - I am getting this result in excel I corrected the formula by adding parenthesis. My question is that exponentiation ...
user avatar
  • 525
4 votes
1 answer
2k views

How do the "includes" and "excludes" operators work in Workflow rule criteria?

Does anybody know how the "includes" and "excludes" operators work when setting up rule criteria for workflow rules? The only documentation I've found on this is located at https://help.salesforce....
user avatar
0 votes
1 answer
29 views

how to evaluate expression to truewhen both the operands are false

<div id="contentToToggle" style="display:{!if(showContent && showContentreplica,"block","none")};"> dont have duplicates </div> { showContent =false; showContentreplica = ...
user avatar
  • 706
3 votes
2 answers
13k views

Is this ternary operator logic documented?

Ever since... well, the dawn of Apex Code, I've always presumed that the ternary operator evaluated both the true and false branches as part of its operation. Today, while playing around with them, I ...
user avatar
  • 438k
2 votes
1 answer
884 views

Like Operator in a Trigger

I am editing an existing Trigger where I need to reference a field that starts with 'Check In @' So I tried using the LIKE operator but it gives an error: ((t.Subject=='Store Check-In' || t.Subject ...
user avatar
  • 389
1 vote
0 answers
28 views

Liveagent: Getting the details was not successful

I have two Operators in my LiveAgent. When Operator 2 is on line and Operator 1 is offline all works fine: the calls arrrives to the Operator 2 and the Transcript and another custome object are saved....
user avatar
1 vote
1 answer
48 views

Render condition error throws

I have below render condition that throws error. Can someone let me the correct condition? Please counter is a get set Integer value in controller that increments after a check in for loop inside ...
user avatar
  • 2,900
8 votes
2 answers
4k views

Is Changed operator in Process Builder

I am checking whether Order OwnerId is changed or not in Process buider.If Changed update related records. But getting below error when Order.Close_Date__c is updated through Workflow field update ...
user avatar
  • 13.3k
4 votes
1 answer
303 views

exact equality operator

Found this in a great post on salesforce collections (http://peterknolle.com/collections-eggstravaganza/). Can anyone explain what is going on here that this isn't true? Account acct = [ ...
user avatar
  • 4,936
8 votes
1 answer
604 views

Comparing to null with "<>"

I was reviewing some Apex code when I found an expression like this: if (a <> null && b != null) { ... } My gut feeling tells me that <> is an alternative way to say "not ...
user avatar
2 votes
1 answer
201 views

Getting the comma out of YEAR function in salesforce formula builder?

I have a YEAR(CloseDate) which required to be a number field type. And when I try to convert it to text to get rid of the 2,014 comma with something like this... TEXT(YEAR(CloseDate)) or this... YEAR(...
user avatar
  • 653
4 votes
1 answer
3k views

special characters not displaying properly

Special characters such as ≠ or ≥ are displaying as question marks on a single customer's site. My app is a managed package and these characters appear correctly on all other instances, so I figure ...
user avatar
  • 41
2 votes
4 answers
147 views

Approval process with AND( OR() ) doesn't seem require all

I thought that should be able to wrap a bunch OR conditions with an AND that would require TRUE from each OR such as this. AND(OR(ISPICKVAL(Apttus_Proposal__Opportunity__r.Sales_Typ__c, "New"), ...
user avatar
  • 653