• Barthelemy Laurans 1
  • NEWBIE
  • 24 Points
  • Member since 2020

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 14
    Replies
<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" >
    <aura:attribute name="recordId" type="ID"/>
    <aura:attribute name="lead" type="Lead"/>
    <lightning:recordViewForm recordId="{!v.recordId}" objectApiName="Lead" density="comfy" >
        <lightning:card iconName="standard:lead">
            <aura:set attribute="title">
                Lead<br></br>
                <div style="font-weight: bold;">
                    <lightning:outputField fieldName="Name" variant="label-hidden" />
                </div>
            </aura:set>
            <lightning:layout>
                <lightning:layoutItem padding="around-small" size="2">
                    <lightning:outputField fieldName="AnnualRevenue"/>
                </lightning:layoutItem>
                <lightning:layoutItem padding="around-small" size="2">
                    <lightning:outputField fieldName="Email"/>
                </lightning:layoutItem>
                <lightning:layoutItem padding="around-small" size="2">
                    <lightning:outputField fieldName="Fax"/>
                </lightning:layoutItem>
                <lightning:layoutItem padding="around-small" size="2">
                    <lightning:outputField fieldName="Industry"/>
                </lightning:layoutItem>
                <lightning:layoutItem padding="around-small" size="2">
                    <lightning:outputField fieldName="LeadSource"/>
                </lightning:layoutItem>
                <lightning:layoutItem padding="around-small" size="2">
                    <lightning:outputField fieldName="Status"/>
                </lightning:layoutItem>
            </lightning:layout> 
        </lightning:card>
    </lightning:recordViewForm>
</aura:component>
Bold the highlighted record name
 
Hi,

We created a lightning web component (LWC) which use lightning/uiRecordApi to update a case owner.

Do you know if in such situation, we need to use DmlOptions.EmailHeader like in Apex to trigger notification emails to queue ? If yes, how would we do this ?

Best regards,
Barthélemy
Hi,

We created a lightning web component (LWC) which use lightning/uiRecordApi to update a case owner.

Do you know if in such situation, we need to use DmlOptions.EmailHeader like in Apex to trigger notification emails to queue ? If yes, how would we do this ?

Best regards,
Barthélemy
<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" >
    <aura:attribute name="recordId" type="ID"/>
    <aura:attribute name="lead" type="Lead"/>
    <lightning:recordViewForm recordId="{!v.recordId}" objectApiName="Lead" density="comfy" >
        <lightning:card iconName="standard:lead">
            <aura:set attribute="title">
                Lead<br></br>
                <div style="font-weight: bold;">
                    <lightning:outputField fieldName="Name" variant="label-hidden" />
                </div>
            </aura:set>
            <lightning:layout>
                <lightning:layoutItem padding="around-small" size="2">
                    <lightning:outputField fieldName="AnnualRevenue"/>
                </lightning:layoutItem>
                <lightning:layoutItem padding="around-small" size="2">
                    <lightning:outputField fieldName="Email"/>
                </lightning:layoutItem>
                <lightning:layoutItem padding="around-small" size="2">
                    <lightning:outputField fieldName="Fax"/>
                </lightning:layoutItem>
                <lightning:layoutItem padding="around-small" size="2">
                    <lightning:outputField fieldName="Industry"/>
                </lightning:layoutItem>
                <lightning:layoutItem padding="around-small" size="2">
                    <lightning:outputField fieldName="LeadSource"/>
                </lightning:layoutItem>
                <lightning:layoutItem padding="around-small" size="2">
                    <lightning:outputField fieldName="Status"/>
                </lightning:layoutItem>
            </lightning:layout> 
        </lightning:card>
    </lightning:recordViewForm>
</aura:component>
Bold the highlighted record name
 

Hi Developers, 
I am trying to change an icon which appears by default when we use 'select' means custom dropdown in LWC but unable to do so. It appears like this : 
User-added image
I want to hide the above standard down icon on the right position and replace it with this :
User-added image

Here is the code below for COMPONENT : 

<select class="c-select-menu" id="menu" onchange={doSomething}>
                    <option class="random" value="Make a selection">Make a selection </option>
                    <option class="random" value="otheroptions">&lt; 4'10" (147cm)</option>
                    <option class="random" value="otheroptions">4'11" (150cm)</option>
                    <option class="random" value="5-0 (152cm)">5'0" (152cm)</option>
                    <option class="random" value="otheroptions">5'1" (155cm)</option>
                    <option class="random" value="otheroptions">5'2" (157cm)</option>
                    <option class="random" value="otheroptions">5'3" (160cm)</option>
                    <option class="random" value="otheroptions">5'4" (163cm)</option>
                    <option class="random" value="otheroptions">5'5" (165cm)</option>
                    <option class="random" value="otheroptions">5'6" (168cm)</option>
                    <option class="random" value="otheroptions">5'7" (170cm)</option>
                    <option class="random" value="otheroptions">5'8" (173cm)</option>
                    <option class="random" value="otheroptions">5'9" (175cm)</option>
                    <option class="random" value="otheroptions">5'10" (178cm)</option>
                    <option class="random" value="otheroptions">5'11" (180cm)</option>
                    <option class="random" value="otheroptions">6'0" (183cm)</option>
                    <option class="random" value="otheroptions">6'1" (185cm)</option>
                    <option class="random" value="otheroptions">6'2" (188cm)</option>
                    <option class="random" value="otheroptions">6'3" (191cm)</option>
                    <option class="random" value="otheroptions">> 6'4" (193cm)</option> 
                </select> 

CSS :

.c-select-menu{
    background: #fff;
    position: relative;
    border-radius: 0;
    border: 1px solid #cfcfcf;
    min-width: 300px;
    margin-left: 32rem;
    margin-right: 32rem;
    padding-right: 2rem;
    padding-left: 1rem;
    height: 55px;
    font-size: 17px;
    font-family: sans-serif;
    color: #22426d;
    font-weight: 700;
    cursor: pointer;
/*The below commented line is used to deplay the icon that is shown in the second image displayed above*/
   /* background: transparent url("https://demo.cloudberryclient.com/lho-prediabetes/r4/assets/images/select-chevron.svg") no-repeat right; */
}

Thank you so much in advance.

Ananya Dhiman

I have an issue with Custom label behavior. I have created Custom Label to Show/Hide Custom Related list. This custom label is set to false for the first time. It is made true to test but still $Label.c.Switch gives false. I tried to clear cache, tried to reload the page many times and also tried with Private window mode. Sometimes It will be true and sometimes false.
Below is the code using Custom Label
<aura:if isTrue="{! $Label.c.Switch == 'true'}">
        <aura:if isTrue="{!v.failedToLoadDynamicComponent}">
            <h3>Failed to dynamically load Safety Letters related list.</h3>
            <aura:set attribute="else">
                {!v.body}
            </aura:set>
        </aura:if>        
        <aura:set attribute="else">
            <h3>Please make Switch to true to see records</h3>
        </aura:set>
    </aura:if>
Is anyone else facing this issue or has found a solution for it?
 
Hi All...I am creating a button , where I have to put brand as variant and also need to get lead icon on it...I tried something like this but the icon doesnt appear because of the brand...is there anyway I can change icon colour to white on this button.
<lightning:button onclick="{!c.createLead}"
                                      variant="brand"
                                      abel="New Lead"
                                      iconName="standard:lead"
                                      disabled = "false"/> 
User-added image
       
If I use variant as Brand_outline , I can see the lead icon...But I cant use Brand_Outine and have to use brand only...so i thought of getting the colour changed to white for this icon...so that it becomes visible.

<lightning:button onclick="{!c.createLead}"
                                      variant="brand-outline"
                                      abel="New Lead"
                                      iconName="standard:lead"
                                      disabled = "false"/> 

User-added image
Hello,
I have fields on a custom object(B) that I need to render on another object(A).  I was thinking about creating a LWV and adding it to the the lightning page layout of (A).  Is this a sound approach.  The org is in Lightning.
Thanks,

Greetings!
We have set up case assignment rules such that when a customer selects Product A while opening a case, the case is routed to a queue called Product A Queue. If the customer chooses Product B in the dropdown, it will be routed to a queue called "Product B Queue" and so on.

We also allow community users to choose any of the 25 languages. The problem is when a customer chooses a different language, "product A" is translated to some chinese characters (for example). These characters do not match our case assignment rules and so, the case ends up in a "general" catch-all queue.

We opened a case and were told this is the way it works OOB and we have to write code so that the custom labels are looked at without translations and then compared to assignment rules.

Can anyone help us with this
cheers
Ashok

I have an Object which is n master-detail with another object 
When A record in object A is created 3 records are created in Object b automatically.(I did this through process builder)
I want to put the component on object A to show all the associate record of object B and billing details of it.

Thanks in Advance!

I have a requirement to enable a component based on selection in the page. Below is the screenshot of my page

LookupControllerImageFrom the above image, when a radio button is clicked, below lookup box should be enabled and when these two selections are made, next button should be enabled.

As of now, they are not dependent on any selections.

Below is my LWC code:

LookupController apex class:
public with sharing class LookupController {
    public LookupController() {

    }

    @AuraEnabled(cacheable=true)
    public static List<SObJectResult> getResults(String ObjectName, String fieldName, String value) {
        List<SObJectResult> sObjectResultList = new List<SObJectResult>();
        system.debug(fieldName+'-------------'+ObjectName+'---++----------'+value);
        if(String.isNotEmpty(value))
            for(sObject so : Database.Query('Select '+fieldName+' FROM '+ObjectName+' WHERE '+fieldName+' LIKE \'%' + value + '%\'')) {
                String fieldvalue = (String)so.get(fieldName);
                sObjectResultList.add(new SObjectResult(fieldvalue, so.Id));
            }
        
        return sObjectResultList;
    }
    
    public class SObJectResult {
        @AuraEnabled
        public String recName;
        @AuraEnabled
        public Id recId;
        
        public SObJectResult(String recNameTemp, Id recIdTemp) {
            recName = recNameTemp;
            recId = recIdTemp;
        }
    }
}

LookupController LWC HTML:
<template>
    <br>
    <fieldset class="slds-form-element">
        <legend class="slds-form-element__legend slds-form-element__label">Operation</legend>
        <div class="slds-form-element__control">
    <span class="slds-radio">
      <input type="radio" id="radio-43" value="radio-43" name="default" checked="" />
      <label class="slds-radio__label" for="radio-43">
        <span class="slds-radio_faux"></span>
        <span class="slds-form-element__label">Insert</span>
      </label>
    </span>
            <span class="slds-radio">
      <input type="radio" id="radio-44" value="radio-44" name="default" />
      <label class="slds-radio__label" for="radio-44">
        <span class="slds-radio_faux"></span>
        <span class="slds-form-element__label">Update</span>
      </label>
    </span>
        </div>
    </fieldset>
    <br><br>
    <lightning-card>
        <h3 slot="title">
            <lightning-icon icon-name="utility:search" size="small"></lightning-icon>
            Search Objects below
        </h3>
        <div slot="footer">

        </div>
        <div>

            <div class="slds-form-element">


                <div class="slds-form-element__control">
                    <div class="slds-combobox_container">

                        <div class={txtclassname} data-id="resultBox" aria-expanded="False" aria-haspopup="listbox" role="combobox">
                            <div class="slds-form-element__control slds-input-has-icon slds-input-has-icon slds-input-has-icon_left-right" role="none">

                                <div>
                                    <span class="slds-icon_container slds-icon-utility-search slds-input__icon iconheight">
                                        <lightning-icon class="slds-icon slds-icon slds-icon_small slds-icon-text-default" icon-name={iconName} size="x-small" alternative-text="icon" ></lightning-icon>
                                    </span>
                                </div>
                                <lightning-input required={required} read-only={inputReadOnly} data-id="userinput" label={Label} name="searchText" onchange={searchField} value={selectRecordName} class="leftspace"></lightning-input>

                                <div if:true={iconFlag}>
                                    <span class="slds-icon_container slds-icon-utility-search slds-input__icon slds-input__icon_right iconheight">
                                        <lightning-icon class="slds-icon slds-icon slds-icon_small slds-icon-text-default" icon-name="utility:search" size="x-small" alternative-text="icon" ></lightning-icon>
                                    </span>
                                </div>
                                <div if:true={clearIconFlag}>
                                    <button class="slds-input__icon slds-input__icon_right slds-button slds-button_icon iconheight" onclick={resetData}>
                                        <lightning-icon class="slds-icon slds-icon slds-icon_small slds-icon-text-default" icon-name="utility:clear" size="x-small" alternative-text="icon" ></lightning-icon>
                                        <span class="slds-assistive-text">Clear</span></button>
                                </div>
                            </div>

                            <!-- Second part display result -->
                            <div id="listbox-id-1" class="slds-dropdown slds-dropdown_length-with-icon-7 slds-dropdown_fluid" role="listbox">
                                <ul class="slds-listbox slds-listbox_vertical" role="presentation">
                                    <template for:each={searchRecords} for:item="serecord">
                                        <li role="presentation" class="slds-listbox__item" key={serecord.recId}>

                                            <div data-id={serecord.recId} data-name={serecord.recName} onclick={setSelectedRecord} class="slds-media slds-listbox__option slds-listbox__option_entity slds-listbox__option_has-meta" role="option">
                                                <span class="slds-media__figure">
                                                    <span class="slds-icon_container slds-icon-standard-account">
                                                        <lightning-icon icon-name={iconName} class="slds-icon slds-icon slds-icon_small slds-icon-text-default" size="x-small"></lightning-icon>
                                                    </span>
                                                </span>
                                                <span class="slds-media__body">
                                                    <span class="slds-listbox__option-text slds-listbox__option-text_entity">{serecord.recName}</span>
                                                    <span class="slds-listbox__option-meta slds-listbox__option-meta_entity">{objectName} • {serecord.recName}</span>
                                                </span>
                                            </div>
                                        </li>
                                    </template>
                                </ul>
                            </div>
                            <div if:true={messageFlag}>
                                No result found.
                            </div>
                            <div if:true={LoadingText}>
                                Loading...
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </lightning-card>
    <br> <br>
    <a class="slds-button slds-button_brand" href="javascript:void(0);">Next</a>
</template>

JS Code:
import { LightningElement,wire,api,track } from 'lwc';
import getResults from '@salesforce/apex/LookupController.getResults';


export default class LwcCustomLookup extends LightningElement {
    @api objectName = 'EntityDefinition';
    @api fieldName = 'QualifiedApiName';
    @api selectRecordId = '';
    @api selectRecordName;
    @api Label;
    @api searchRecords = [];
    @api required = false;
   //   @api iconName = 'standard:event'
    @api LoadingText = false;
    @track txtclassname = 'slds-combobox slds-dropdown-trigger slds-dropdown-trigger_click';
    @track messageFlag = false;
    @track iconFlag =  true;
    @track clearIconFlag = false;
    @track inputReadOnly = false;


    searchField(event) {
        var currentText = event.target.value;
        this.LoadingText = true;

        getResults({ ObjectName: this.objectName, fieldName: this.fieldName, value: currentText  })
            .then(result => {
                this.searchRecords= result;
                this.LoadingText = false;

                this.txtclassname =  result.length > 0 ? 'slds-combobox slds-dropdown-trigger slds-dropdown-trigger_click slds-is-open' : 'slds-combobox slds-dropdown-trigger slds-dropdown-trigger_click';
                if(currentText.length > 0 && result.length == 0) {
                    this.messageFlag = true;
                }
                else {
                    this.messageFlag = false;
                }

                if(this.selectRecordId != null && this.selectRecordId.length > 0) {
                    this.iconFlag = false;
                    this.clearIconFlag = true;
                }
                else {
                    this.iconFlag = true;
                    this.clearIconFlag = false;
                }
            })
            .catch(error => {
                console.log('-------error-------------'+error);
                console.log(error);
            });

    }

    setSelectedRecord(event) {
        var currentRecId = event.currentTarget.dataset.id;
        var selectName = event.currentTarget.dataset.name;
        this.txtclassname =  'slds-combobox slds-dropdown-trigger slds-dropdown-trigger_click';
        this.iconFlag = false;
        this.clearIconFlag = true;
        this.selectRecordName = event.currentTarget.dataset.name;
        this.selectRecordId = currentRecId;
        this.inputReadOnly = true;
        const selectedEvent = new CustomEvent('selected', { detail: {selectName, currentRecId}, });
        // Dispatches the event.
        this.dispatchEvent(selectedEvent);
    }

    resetData(event) {
        this.selectRecordName = "";
        this.selectRecordId = "";
        this.inputReadOnly = false;
        this.iconFlag = true;
        this.clearIconFlag = false;

    }

}

Is there any way I can enable the components based on other component selections. Please suggest
<template>
    <lightning-record-edit-form object-api-name="Case">
        <lightning-messages>
        </lightning-messages>
        <lightning-output-field field-name="CaseNumber">
        </lightning-output-field>
        <lightning-input-field field-name="Subject">
        </lightning-input-field>
        <lightning-input-field field-name="PRODUCTSUBTYPE__c">
        </lightning-input-field>
        <lightning-input-field field-name="PRODUCTTYPE__c">
        </lightning-input-field>
        <lightning-input-field field-name="RMA__c">
        </lightning-input-field>
        <lightning-input-field field-name="FunctionalArea__c">
        </lightning-input-field>
        
        <lightning-button class="slds-m-top_small"
                          variant="brand"
                          type="submit"
                          name="Create"
                          label="Create">
        </lightning-button>
    </lightning-record-edit-form>
</template>
iam using above lines of code but iam unable create record