Questions tagged [conditional]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
17 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 ...
user avatar
0 votes
0 answers
15 views

Custom lookup not only Object but also field value filter

I made custom lookup. In the PM.cmp I set to lookup the object "User" but this attribute all users display including inactive users. So I want to display only users whose Department in the ...
user avatar
  • 31
1 vote
1 answer
19 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 ...
user avatar
0 votes
1 answer
15 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 ...
user avatar
  • 3
0 votes
0 answers
13 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 ...
user avatar
  • 1
0 votes
2 answers
45 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. ...
user avatar
  • 2,090
1 vote
1 answer
26 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 ...
user avatar
2 votes
1 answer
136 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 ...
user avatar
0 votes
1 answer
93 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 ...
user avatar
  • 55
0 votes
1 answer
89 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 ...
user avatar
0 votes
1 answer
29 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 ...
user avatar
  • 95
0 votes
1 answer
32 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 ...
user avatar
  • 1,377
3 votes
1 answer
121 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 ...
user avatar
0 votes
1 answer
813 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 ...
user avatar
0 votes
2 answers
64 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 { ...
user avatar
1 vote
1 answer
79 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 ...
user avatar
  • 2,090
0 votes
0 answers
45 views

Can't show the desired LWC into the screen

I have to show different layouts depending of the user selection from a searchbar, but once I select something nothing appears. As you can see in the code bellow if I click a result with type:Users, I ...
user avatar
  • 29
0 votes
0 answers
33 views

Einstein analytics\App template\Dataflow and recipe

i have a problem with my app template because i mixed dataflow and recipe. There is an dataflow/recipe/dataflow order execution to build the dataset whereas when you run the app template it runs ...
user avatar
5 votes
1 answer
2k 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:...
user avatar
2 votes
3 answers
1k 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 ...
user avatar
0 votes
1 answer
25 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....
user avatar
  • 155
1 vote
0 answers
139 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 ...
user avatar
  • 125
1 vote
1 answer
54 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 ...
user avatar
  • 433
0 votes
1 answer
410 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 ...
user avatar
1 vote
2 answers
1k 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. ...
user avatar
0 votes
1 answer
27 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 ...
user avatar
0 votes
2 answers
12 views

Advance formula field nested condition not working

I want a formula like this: IF ( (Field1 = 'Value1' AND Field2 = 'Value2') OR ( NOT (ISBLANK (Field3))) ), "Output1", "Output2") This is my actual formula: IF( (...
user avatar
  • 97
1 vote
1 answer
2k views

A special ternary condition in apex (safe navigation operator)

I've seen this somewhere, sometime before but I can't remember how it's used and I can't find anything about it online (Probably because I don't know what to search for). So please help me understand ...
user avatar
  • 598
0 votes
2 answers
795 views

Conditional Styling of Map Results in Salesforce LWC Table

I am trying to change the font color of a custom field values displayed in a table. This is based on a condition wherein if this custom field's value is less than a specific amount, it will display ...
user avatar
  • 321
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
28 views

Conditional not rendering output section

I have a pageblockSection I want to render if a conditional evaluates to true. This is my VF code <apex:page standardController="Intake__c" extensions="IntakeExtension,...
user avatar
1 vote
0 answers
303 views

Contact duplicate rule condition is not working on Lead convert (Apex)

I have written custom Lead Convert apex class and vf page. I have a duplicate rule "active" on contact. The issue i am facing - When i try to convert a lead, contact duplicate rule's ...
user avatar
0 votes
1 answer
720 views

SOQL in Apex IF-Else Condition

I am trying to filter records based on the below if-else condition in apex code if (salesId != NULL) { List<Entity__c> entity = [SELECT Status__c, Item__r.Vendor_ID__c ...
user avatar
1 vote
2 answers
1k views

AMPscript issue with a conditional (boolean)

how are you? My excersize is to compare 3 clients with a boolean and i would like if my code is okay. Let me show my code. I just checked the ampscript guide but it isnt enough. Looks easy but i'vent ...
user avatar
0 votes
0 answers
335 views

Process Builder - Auto Create Event after a call is logged

What I am trying to do ? When a Call is logged (via Log a Call), Create a follow up event automatically. How did I do this ? I created a workflow via Process Builder to auto Create Events when a call ...
user avatar
0 votes
1 answer
497 views

Conditionally disabling an editable field in lightning Datatable

I have a requirement that an editable field in Datatable should be editable on certain conditions for example lets say, i have a field Disable_Action__c which is a formula field , when this field ...
user avatar
0 votes
1 answer
38 views

I'm trying to avoid or at least organize better expressions inside if statement in my code

Need help, my code has a lot of expressions in if statement and I'm trying to get rid of it or organize it in a better way. for example like this: if (fieldNumber==1 && (language=='en' || ...
user avatar
  • 1
1 vote
1 answer
2k views

LWC conditional display on load of component not working

Based on the field values of the Account, I want to display/hide parts of the component when it loads for the first time. I have tried so many things unsuccessfully and am hoping someone can help me ...
user avatar
  • 1,377
0 votes
1 answer
22 views

Control going inside 'If' block even when it should not (only for 1 value)

I am trying to count the number of weekdays (Monday - Friday) by taking the number of days since 01-07-1900 (7th January, 1900), for a given date, and checking the modulus by 7. For modulus values 0 - ...
user avatar
0 votes
2 answers
313 views

Is there a way to dynamically generate conditions in a loop

I currently have a batch proces which gets an amount of records as a scope. I want to execute some manipulations on these records based on some conditions where only 1 value changes and where the ...
user avatar
  • 2,090
2 votes
1 answer
2k views

My LWC radio button select is not working - not getting selection

I have a Lightning Web Component with a radio button group. If I select one, I need to capture the selection and conditionally display a div based on that selection. I can't seem to get it working - ...
user avatar
  • 1,377
0 votes
0 answers
34 views

Never left if condition

I've got a tricky question, my code doesn't work - suprise. I would like to return only a list of 'filtred' data but my code never leav a if condition. So when if condition return true and my script ...
user avatar
  • 135
0 votes
0 answers
76 views

Replace default Lightning Table Sort Icons with Custom Icons

We have a table this is referencing the default lightning sort icons and need to replace all three(up, down, both) with different svg images from static resources. The current code references ...
user avatar
0 votes
1 answer
225 views

Dataloader Condition: Accounts with Contacts, Opportunities, etc.?

Is there a way in Dataload to add the condition when exporting Accounts so that it only pulls Accounts with Contacts, Opportunities, etc.? Thanks
user avatar
  • 45
0 votes
0 answers
1k views

LWC: How create/edit record with fields displayed depending on the values ​of these fields

How create/edit record with fields displayed (hide/show) depending on the values ​​of adjacent fields? What are the best practice for that case? Thank you! For example: HTML <template if:true={...
user avatar
  • 319
0 votes
1 answer
1k views

How to show fields based on a condition for other field

I want to show 4 custom fields (W__c, X__c, Y__c, Z__c) when other custom field have the following condition: If RealNumber__c < TargetNumber__c then show this field: W__c, X__c, Y__c, Z__c else ...
user avatar
-1 votes
2 answers
224 views

Conditional formula field

If I have the object Animal__cwith the fieldsColor__c and Shape__c. How Can I make a conditional formula field Country__c which is dependent of the values ofColor__c. Example: If (Color__c ='...
user avatar
0 votes
1 answer
129 views

Outputtext rendered conditional check not working with < or >

This is my VF outputtext which works fine: <apex:repeat value="{!port.hList}" var="per"> <tr> <td> <apex:outputText value="{0, Number, #,###,###.00}" rendered="{!...
user avatar
  • 1,377
3 votes
1 answer
1k views

Is it possible to conditionally set the value of an input component?

I tried to create an input component as follows: <aura:attribute name="dataTotal" type="Map" /> <aura:attribute name="myBoolean" type="Boolean" /> <lightning:input type="number" value=...
user avatar
  • 205
3 votes
3 answers
2k views

Conditional rendering based on key in for:each

I'm stuck on how to conditionally render (let alone apply styles) while in a for:each according to an expression. <lightning-layout-item padding="around-small"> <div class="header-column"...
user avatar
  • 31