Questions tagged [conditional]
The conditional tag has no usage guidance.
167
questions
0
votes
0
answers
23
views
The test class coverage isn't happening because of a condition
I have written the below apex class
public with sharing class BillingMonthlyCustomApp {
public BillingMonthlyCustomApp() {}
public static void insertRecordsIntoSchedule(Set<Id> ...
0
votes
1
answer
38
views
Flow Condition for entry
Need help for the below entry condition in the flow as my entry condition is not matching with the expectation.
Object: Case Comment
Condition for Entry:
Case Comment parent record type should be ...
0
votes
0
answers
31
views
LWC: in my LWC component i have looped the orders and i want to display icon and status based on order substatus values, how to achieve that?
Here is my code:
<template for:each={Orders} for:item ='record'>
<div class="individual-row" key = {record.Id}>
<div class="col1">
<span class=&...
0
votes
1
answer
221
views
Currency Formatting Issue in Conga Template Conditional Statements
I am encountering a problem with currency formatting in a Conga Word template while using conditional statements. The specific code snippet in question is as follows:
{
if "«...
0
votes
0
answers
34
views
In GTL datasource can I have conditional content appear based on the first instance only?
I'm using Amspscript and GTL datasource to extract information from a field in a data extension called: cancelled. This field has multiple items in there and within cancelled there is another field ...
0
votes
1
answer
502
views
LWC Conditional render to show a field in a data table if that field has value
I'm trying to show or not show the content of field in a data table depending on if it is null or empty etc. What am I doing wrong?
<th scope="col">
<div lwc:if={isNotes}&...
-2
votes
2
answers
206
views
getting a 'Missing return statment required' even though i have one
I have a method:
public static String doCallout(String requestJson, String recordId){
HttpRequest req = new HttpRequest();
req.setEndpoint(END_POINT_URL);
req.setHeader('Content-Type', '...
0
votes
2
answers
598
views
Bypass lookup filter
I have a lookup filter which I want to bypass as a system administrator when doing i.e. data imports.
I found possible solutions but they dont seem to be working.
Added a second filter condition OR ...
-1
votes
1
answer
100
views
How to write a Formula to have a checkbox checked by default and if the case is reopened, uncheck the box to track First Contact Resolution?
For example, if a customer comes in and a case is created, the FCR (First Contact Resolution) Checkbox is already checked by default, then if the Case has a status of Resolved and it changes, meaning ...
0
votes
2
answers
115
views
Ampscript condition else/if to show the default link and conditional issue
I have DE lists like this for "Fruits" category:
"Apple", "Apple A", "Apple 2", "Apple red", "Apple green", "Apple CA", "...
0
votes
1
answer
886
views
Using ampscript check if value exists in data extension
I have a customer_data_extension that consists of customers with their customer_id.
I'm creating an email with conditional content, so IF customer exists in customer_data_extension then show this ...
0
votes
2
answers
44
views
Struggling with syntax errors on and IF AND statement
I seem to always be struggling with resolving syntax errors on my IF code. I have used VS editor so it's easier to read and I don't think it's a parenthisis issue. Getting the error message "The ...
1
vote
1
answer
2k
views
Can I nest AND and OR statements as part of a condition for allowing a Flow?
I am fairly new to Flows, and I've never had to setup a complex condition. I can't figure out how to set up what I need. This is what I'm trying to get:
We have a Flow that is triggered if an ...
1
vote
2
answers
3k
views
Conditional Criteria on Lightning button disabled attribute doesn't work
Can someone help me how to make this work please. Wanted to disable the button based on the following criteria
//Diabled criteria - MUST be disbaled for all rows except for last row.
//Background - we ...
-1
votes
1
answer
101
views
How to pass value to attribute in visualforce page
I have an attribute which I want to pass to a visualforce component, how do I achieve this. Currently I get the error: expecting a boolean
Photoshoot="{!IF(!opportunity.Quote__r.Photoshoot__c!='',...
1
vote
2
answers
604
views
Make Reminder Flow work when Event.DueDate changes
I have a Time-Triggered Flow that reminds people one week before the Meeting Due Date. That is easily implementable.
But now I also want to cover the use case where somebody changed the Due Date. In ...
0
votes
1
answer
835
views
Convert check box result to yes, no in email template
I'm trying to use a conditional statement in a salesforce email text template, field is a check box and i want the output in the email template to be yes or no. I'm using the below but it is not ...
0
votes
1
answer
48
views
ELSEIF Statements not being evaluated
I am having issue with the script below.
I have a DE that includes a column "Days Since Last Login". I want specific language to display based upon what the numeric value is in that column ...
0
votes
1
answer
218
views
LWC Conditional Output Field [duplicate]
I am looping through a list in LWC and want to render the field if there is a value and if there is no a value then I want to default it to a dash ( - or 0). I understand that we can conditionally ...
0
votes
1
answer
778
views
Email nested if statement AMPScript with HTML
I need to have a nested if statement with some HTML inside.
Like this.
%%[ IF (NOT EMPTY(@Var1) THEN ]%%
<!-- HTML goes here -->
%%[ IF (NOT EMPTY(@Var2) THEN
<!-- HTML ...
0
votes
1
answer
108
views
Conditional Formatting Visualforce Cells
Hello there,
I am attempting to re-create the lightning stage path with branching stages.
I built a Visualforce table with the bare-bones of these stages, but am running into trouble when I go to add ...
0
votes
1
answer
100
views
Error in a formula with several if
I am trying to create a formula field to display a "clean" value for our revenue. It is a formula based on opportunity fields and it's a field displayed in the opportunity itself.
We have ...
0
votes
2
answers
1k
views
render child component div in lwc by matching data-attributes on button click
I have a component that displays a list of questions using a for:each. For each question rendered I have a child component (which is a simple form with a few fields) to capture a followup question.
I ...
-2
votes
1
answer
442
views
Multiple OR for one variable and with AND CONDITION [closed]
How to write this code
If @br != 'X' OR 'Y' OR 'Z' AND @PROF=='N'
0
votes
1
answer
4k
views
Add a div element depending on condition in LWC
Hello,
I develop a LWC and I have 2 displays because a condition.
They are very similar but a "div" element is inside the second display but it is on the top of the LWC.
This is my first ...
0
votes
2
answers
91
views
Simple Apex code snippet not behaving as expected
Integer delay = 1;
for(Integer i=1;i<=5;i++)
{
System.debug('Print '+i);
Long sTime = System.now().getTime();
while ( (System.now().getTime()/1000 - sTime/1000) < delay){}
}
When ...
0
votes
1
answer
5k
views
Need help using IF statement in Salesforce Flows
We're moving to Flows and I need a bit of help on IF statements in Salesforce. I've tried a few variations but with the IF statement when creating a DATE formula but I keep getting “Syntax error. ...
0
votes
1
answer
231
views
Flow Decision Condition is failing
I have a custom Object Request__c
These are the fields on the Request__c record
Account_Executive__c (lookup to Contact record)
Central_Services__c (lookup to Contact record)
Opportunity__c ...
1
vote
1
answer
366
views
onchange handler not displaying together with my if:true directive
I am doing this udemy course for LWC Development and I am stuck on the part for conditional rendering. My goal is that I should be able to show and hide the div with the use if if:true and if:false ...
0
votes
1
answer
94
views
How can I use substitute in combination with if condition
Our Salesrep can write some text in a textbox field which is related to a campaign. This field should print on the letter. The Salesrep can use some words which are substitute in the process.
If the ...
1
vote
1
answer
725
views
Using Date fields in process builder as conditions
I am trying to use date fields as part of my condition in a process builder to say:
If field #1 (number) has value > 0
AND field #2 (date) is less than 30 days ago (ie. date is within the last 30 ...
0
votes
2
answers
4k
views
Formula field date subtraction
I have a formula field as a boolean which should return true if the date of today and enddate has less than 3 months in between and the enddate field is not empty. I dont get the correct results. ...
1
vote
1
answer
2k
views
Get Records with condition not working in Flow
I am working on an assignment in which I developed a screen flow. The screen flow gets triggered with a "Create Invoice" button on the opportunity. When the user clicks the "Create ...
2
votes
1
answer
672
views
Illegal conversion from List<String> to List<Beverage__c>
I have trouble with a component in an Experience site.
I'm doing a search bar, which makes a search in the information of two components.
It has to show the coincidence or a message like "there's ...
0
votes
2
answers
2k
views
Lightning Inputfield Conditional Required Field
I am trying to make one of my input fields conditionally required based on a checkbox value of false. Is this possible using a standard 'required' attribute in Lightning/Aura? The below doesn't seem ...
0
votes
1
answer
707
views
Alternatives for multiple If statements
I need to compare the fields and depending on that if its true then update a boolean variable and if its false then capture this field and get the label and append it to a string. I have like 10-12 ...
0
votes
1
answer
149
views
Render code if condition is true
I want to render the span syntax only if the wrapper.AccHead is not empty.
I tried the code below, but it does'nt work.
I tried also to use the rendered syntax in span but it does' nt work.
Is there a ...
0
votes
1
answer
266
views
Declare CSS stylesheet based on condition in controller
I have a Visualforce page which has a default CSS stylesheet declared, which is always used for general styling. What I would like to do, however, is have alternate stylesheets to change brand colours ...
3
votes
1
answer
352
views
replacing visualforce conditional rendering formulas in LWC
so I'm migrating a visualforce component into LWC. In that component, there is a table rendered, and a lot of columns are rendered differently depending on data field values and/or some other ...
1
vote
1
answer
16k
views
Adding conditional logic (IF, THEN) in Salesforce HTML email templates
I'm struggling with adding IF, THEN conidition to my HTML Classic Email template and hoping someone can help.
I am trying to say if Cohort Owner's name is 'X', then post the X link, if Cohort Owner's ...
0
votes
2
answers
220
views
Aura Redirect Component Only if CustomerID is not Null
I wrote code for an Aura Redirect Component but I'm having trouble getting it to redirect only if the CustomerId is not null. Here's my code.
Apex Controller
public with sharing class NetsuiteQuote {
...
1
vote
1
answer
497
views
How to do binary conditional rendering lightning web component [duplicate]
I have created a lightning web component to show several related object tables on a detailpage. Above one of the tables I want to show some extra specific data related to one of the object tables.
We ...
7
votes
2
answers
7k
views
LWC: Do I have to use a template element with if:true?
The Lightning Web Components Dev Guide gives this example in the article titled Render HTML Conditionally, where a conditionally-rendered div element is wrapped in a template element containing an if:...
2
votes
3
answers
6k
views
IF with && and || condition SalesForce Apex
I have a trigger that checks the stage of an OPP before it updates.
What I want to do is check if the new Stage is 'X' then the Old Stage is not 'Y' or 'Z' there could be 4 more stages, so if a new ...
0
votes
1
answer
37
views
Why this set does not contain my data?
I have this data:
Account.Zone__c = 'A';
Zone_set = '{ B, A, C}';
if(!Zone_set.contains(Account.Zone__c)) {
//do this
}
Account.Zone__c = 'B';
Zone_set = '{ B, A, C}';
if(!Zone_set.contains(Account....
1
vote
1
answer
631
views
Is it possible to delete a record created during a flow interview that has been interrupted?
I have a screen flow where a user creates a record in one screen, and in the next screen the user uploads a file to the record that has just been created. Then, the user presses a button that launches ...
1
vote
1
answer
119
views
Inner query - last date clause
I have a trigger on after Insert and after update on Contact.
This trigger updates Account.SalatySumLastContactsLast, with sum of Contact.Salary where Contact.mydate__c is latest.
I simplified the ...
0
votes
1
answer
2k
views
I want to render two data table based on condition..both data table are present in the same lightning web component!
here I have one product data table without checkbox,this is the default one,but when I navigate from opportunity page to product page to add products to opportunity,to add product I need to render ...
1
vote
2
answers
3k
views
LWC Get record field values and render DOM elements conditionally
I want to create a custom component for a record page that gets a field value for the record, determines if the value is null or not. If it is null, some content will be shown and some will be hidden. ...
0
votes
1
answer
122
views
How to use conditionals in an apex: repeat and place a custom link in a visualforce email template?
I am creating a visualforce email template that sends contact data to salespeople.
In this email there are two points that I am not able to advance:
In the section "Informações sobre o ...