• pinky1
  • NEWBIE
  • 20 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 5
    Replies
Hi,

I have a form with fields displaying and creating computer record in salesforce. The form is called in the Community. I need help with Styling/ UI.

Right now my UI is as below:
UI But i need to move the Name, Brand, Account text labels beside the fields like below:

User-added image
My code is as below:

<aura:component implements="forceCommunity:availableForAllPageTypes,force:hasRecordId" access="global" controller="ComputerController">
    <aura:attribute name="fields" type="String[]" default="['Name','Carrier_Account__c','Brand__c']" />
    <aura:attribute name="recordId" type="String"/>
    <aura:attribute name="AccId" type="String"/>
    <aura:attribute name="strBrand" type="String"/>
    <aura:attribute name="strName" type="String"/>
    <aura:attribute name="strPrice" type="String"/>
    <aura:attribute name="showSuccess" type="boolean"/>
    <aura:attribute name="showError" type="boolean"/>
    <aura:attribute name="showPrice" type="Boolean" default="false"/>
    <lightning:navigation aura:id="navigation"/>
    <!--lightning:notificationsLibrary aura:id="notifLib"/>
    
    <lightning:recordForm objectApiName="Computer__c" fields="{!v.fields}" onsuccess="{!c.handleSuccess}">
       
        
    </lightning:recordForm-->
    <lightning:recordEditForm objectApiName="Computer__c"  >
        <div class="slds-grid">
            <div class="slds-col slds-size_4-of-5">
                <div class="slds-grid slds-p-around_medium">
                    <div class="slds-col slds-size_1-of-5">
                        <span>
                            <div>Name: </div>
                            
                        </span>
                    </div>
                    <div class="slds-col slds-size_4-of-5">
                        <span>
                            <lightning:inputField fieldName="Name" value = "{!v.strName}" onchange="{!c.onChangeVal}" variant="label-hidden"/>
                        </span>
                    </div>
                </div>
                <div class="slds-grid slds-p-around_medium">
                    <div class="slds-col slds-size_1-of-5">
                        <span>
                            <div>Brand: </div>
                            
                        </span>
                    </div>
                    <div class="slds-col slds-size_4-of-5">
                        <span>
                            <lightning:inputField fieldName="Brand__c" value = "{!v.strBrand}" onchange="{!c.onChangeVal}"  variant="label-hidden"/>
                        </span>
                    </div>
                </div>
                <div class="slds-grid slds-p-around_medium">
                    <div class="slds-col slds-size_1-of-5">
                        <span>
                            <div>Account: </div>
                            
                        </span>
                    </div>
                    <div class="slds-col slds-size_4-of-5">
                        <span>
                            <lightning:inputField fieldName="Carrier_Account__c"  onchange="{!c.handleChange}" value = "{!v.AccId}" aura:id="field1" variant="label-hidden"/>
                        </span>
                    </div>
                </div>
                <aura:if isTrue="{!v.showPrice}">
                    <div class="slds-grid slds-p-around_medium">
                        <div class="slds-col slds-size_1-of-5">
                            <span>
                                <div>Price: </div>
                                
                            </span>
                        </div>
                        <div class="slds-col slds-size_4-of-5">
                            <span>
                                <lightning:inputField fieldName="Price__c" value = "{!v.strPrice}" variant="label-hidden"/>
                            </span>
                        </div>
                    </div>
                </aura:if>
            </div>
            <div class="slds-col slds-size_1-of-3">
                <span></span>
            </div>
        </div>
        
        
    </lightning:recordEditForm>
    <br/>
    <div class="slds-align_absolute-center">
        <aura:if isTrue="{!v.showSuccess}">
            <div class="slds-text-color_success">Record saved successfully</div>
        </aura:if>
        <aura:if isTrue="{!v.showError}">
            <div class="slds-text-color_success">Some error occured, Please try later</div>
        </aura:if>
    </div>
  <!--  <div class="slds-grid "> -->
        <div class="slds-col slds-size_2-of-3">
            <div class= "slds-align_absolute-center"> 
                <lightning:button variant="Destructive" label="Save" title="Primary action" onclick="{!c.handleSave}" class="widebutton"/>
            </div>
            
        </div>
        <div class="slds-col slds-size_1-of-3">
             <span></span>
        </div>
    <!--</div> -->
    
</aura:component>


Any help is appreciated.
 
  • August 11, 2020
  • Like
  • 0
Need help:

I am sending am email when opportunity status is approved. My user is geeting below error. Opportunity: System.LimitException: Too many Email Invocations: 11. Please see my code below and help.

public class OpportunityAfterUpdateHandler implements TriggerDispatcher.ITriggerEntry {
    public void mainEntry(TriggerDispatcher.TriggerParameters tp) {
        List<Opportunity> opptyLstEmail = new List<Opportunity>(); //for email sending
        Map<Id, Opportunity> oldOppMap = (Map<Id, Opportunity>)tp.oldMap;

        for(opportunity opp : (List<Opportunity>)tp.newList) {
            opportunity oldopp = oldOppMap.get(opp.Id);
            system.debug('oldopp'+ oldopp);
            string recordtypename = Schema.SObjectType.Opportunity.getRecordTypeInfosById().get(opp.recordtypeid).getname();
            system.debug('recordtypename' + recordtypename);
            system.debug('Approved_Rejected__c' + opp.Approved_Rejected__c);
            system.debug('approval authority level' + opp.Approval_Authority_Level__c);


            if(recordtypename == 'Approved' && opp.Approved_Rejected__c=='Approved' && opp.Approval_Authority_Level__c != 'Manager' &&  (opp.Approved_Rejected__c != oldopp.Approved_Rejected__c))
            {
                opptyLstEmail.add(opp);
                system.debug('opptesting' + opp);
                Sendemailforoppty.SendingEmail(opptyLstEmail);
            }
            if(recordtypename == 'Other' && opp.Approved_Rejected__c=='Rejected' && opp.Approval_Authority_Level__c != 'Manager' &&  (opp.Approved_Rejected__c != oldopp.Approved_Rejected__c))
            {
                opptyLstEmail.add(opp);
                system.debug('opptesting' + opp);
                Sendemailforoppty.SendingEmail(opptyLstEmail);
            }
        }
    }

   
Hi,

I have requirement to create a lightning component to show custom object (Computer__c) field on the form. Computer object has lookup relationship to Account object. So, when a user is creating a computer record when selected Account related field Industry has a value of "Energy" then only show Price__c field from the Computer__c object on the page if not hide the Price__c field from the Page.

I trie to create the Lightning Component but not sure how to display fields based on the Condition. The code is as follow's

Component:
<aura:component implements="forceCommunity:availableForAllPageTypes,force:hasRecordId" access="global" >
            <aura:attribute name="fields" type="String[]" default="['Name','Carrier_Account__c','Brand__c']" />
            <aura:attribute name="recordId" type="String"/>
            <lightning:notificationsLibrary aura:id="notifLib"/>
  <lightning:recordForm objectApiName="Computer__c" fields="{!v.fields}" onsuccess="{!c.handleSuccess}" />
</aura:component>

Controller:
({
    handleSuccess : function(component, event, helper) {
        component.find('notifLib').showToast({
            "variant": "success",
            "title": "Computer Created",
            "message": "Record ID: " + event.getParam("id")
        });
    }
})

Output:
User-added image
This is the first time am working with Lightnng component. Any help with coding is much appreciated.
Hi,

I have a requirement where i need to create a form of Custom Object (Computer__c) which has Lookup Realetionship to Account Object. On the form i need to show field's First name, Last name, Price and Account fields.

But on the form when First name, Last Name and Account fields are filled out and the selected Account, Brand Source (field on Account Object) value is WEB then only show Price field on the form otherwise Just Show First Name, Last Name and Account Fields on the Form and Crreat a Computer Record. 

Can anyone help me with the above requirement and help me with VF page and Controller class. Any help would be appreciated.
Hi,

When these 5 fields are marked "TRUE"
Field 1
Field 2
Field 3
Field 4
Field 5

Update "GOLD " to TRUE automatically.

These field are on Account object. Can someone help with the formula for this.
  • April 09, 2019
  • Like
  • 0
We have two custom fields on leads pardot hard bounced and pardot hard bounced cloned. if pardot hard bounced is true, we need to make pardot hard bounced cloned, if a lead updates a field on the record.

For this i have written Trigger and the code coverage is 0%. I want to deploy it to production. If i need to deploy  need to write a test class and apex class. Can someone help me with this. I am new to coding.

below is the trigger i have written:


trigger UpdateLead on Lead (before update) {
for(Lead l: Trigger.new) {
        If (l.pi__pardot_hard_bounced__c == true ){
           l.Pardot_Hard_Bounce_Cloned__c = true;
        }
        else {
        l.Pardot_Hard_Bounce_Cloned__c = False;
        }
    }
    }
  • March 19, 2019
  • Like
  • 0
Hi,

I have a form with fields displaying and creating computer record in salesforce. The form is called in the Community. I need help with Styling/ UI.

Right now my UI is as below:
UI But i need to move the Name, Brand, Account text labels beside the fields like below:

User-added image
My code is as below:

<aura:component implements="forceCommunity:availableForAllPageTypes,force:hasRecordId" access="global" controller="ComputerController">
    <aura:attribute name="fields" type="String[]" default="['Name','Carrier_Account__c','Brand__c']" />
    <aura:attribute name="recordId" type="String"/>
    <aura:attribute name="AccId" type="String"/>
    <aura:attribute name="strBrand" type="String"/>
    <aura:attribute name="strName" type="String"/>
    <aura:attribute name="strPrice" type="String"/>
    <aura:attribute name="showSuccess" type="boolean"/>
    <aura:attribute name="showError" type="boolean"/>
    <aura:attribute name="showPrice" type="Boolean" default="false"/>
    <lightning:navigation aura:id="navigation"/>
    <!--lightning:notificationsLibrary aura:id="notifLib"/>
    
    <lightning:recordForm objectApiName="Computer__c" fields="{!v.fields}" onsuccess="{!c.handleSuccess}">
       
        
    </lightning:recordForm-->
    <lightning:recordEditForm objectApiName="Computer__c"  >
        <div class="slds-grid">
            <div class="slds-col slds-size_4-of-5">
                <div class="slds-grid slds-p-around_medium">
                    <div class="slds-col slds-size_1-of-5">
                        <span>
                            <div>Name: </div>
                            
                        </span>
                    </div>
                    <div class="slds-col slds-size_4-of-5">
                        <span>
                            <lightning:inputField fieldName="Name" value = "{!v.strName}" onchange="{!c.onChangeVal}" variant="label-hidden"/>
                        </span>
                    </div>
                </div>
                <div class="slds-grid slds-p-around_medium">
                    <div class="slds-col slds-size_1-of-5">
                        <span>
                            <div>Brand: </div>
                            
                        </span>
                    </div>
                    <div class="slds-col slds-size_4-of-5">
                        <span>
                            <lightning:inputField fieldName="Brand__c" value = "{!v.strBrand}" onchange="{!c.onChangeVal}"  variant="label-hidden"/>
                        </span>
                    </div>
                </div>
                <div class="slds-grid slds-p-around_medium">
                    <div class="slds-col slds-size_1-of-5">
                        <span>
                            <div>Account: </div>
                            
                        </span>
                    </div>
                    <div class="slds-col slds-size_4-of-5">
                        <span>
                            <lightning:inputField fieldName="Carrier_Account__c"  onchange="{!c.handleChange}" value = "{!v.AccId}" aura:id="field1" variant="label-hidden"/>
                        </span>
                    </div>
                </div>
                <aura:if isTrue="{!v.showPrice}">
                    <div class="slds-grid slds-p-around_medium">
                        <div class="slds-col slds-size_1-of-5">
                            <span>
                                <div>Price: </div>
                                
                            </span>
                        </div>
                        <div class="slds-col slds-size_4-of-5">
                            <span>
                                <lightning:inputField fieldName="Price__c" value = "{!v.strPrice}" variant="label-hidden"/>
                            </span>
                        </div>
                    </div>
                </aura:if>
            </div>
            <div class="slds-col slds-size_1-of-3">
                <span></span>
            </div>
        </div>
        
        
    </lightning:recordEditForm>
    <br/>
    <div class="slds-align_absolute-center">
        <aura:if isTrue="{!v.showSuccess}">
            <div class="slds-text-color_success">Record saved successfully</div>
        </aura:if>
        <aura:if isTrue="{!v.showError}">
            <div class="slds-text-color_success">Some error occured, Please try later</div>
        </aura:if>
    </div>
  <!--  <div class="slds-grid "> -->
        <div class="slds-col slds-size_2-of-3">
            <div class= "slds-align_absolute-center"> 
                <lightning:button variant="Destructive" label="Save" title="Primary action" onclick="{!c.handleSave}" class="widebutton"/>
            </div>
            
        </div>
        <div class="slds-col slds-size_1-of-3">
             <span></span>
        </div>
    <!--</div> -->
    
</aura:component>


Any help is appreciated.
 
  • August 11, 2020
  • Like
  • 0
Hi,

I have requirement to create a lightning component to show custom object (Computer__c) field on the form. Computer object has lookup relationship to Account object. So, when a user is creating a computer record when selected Account related field Industry has a value of "Energy" then only show Price__c field from the Computer__c object on the page if not hide the Price__c field from the Page.

I trie to create the Lightning Component but not sure how to display fields based on the Condition. The code is as follow's

Component:
<aura:component implements="forceCommunity:availableForAllPageTypes,force:hasRecordId" access="global" >
            <aura:attribute name="fields" type="String[]" default="['Name','Carrier_Account__c','Brand__c']" />
            <aura:attribute name="recordId" type="String"/>
            <lightning:notificationsLibrary aura:id="notifLib"/>
  <lightning:recordForm objectApiName="Computer__c" fields="{!v.fields}" onsuccess="{!c.handleSuccess}" />
</aura:component>

Controller:
({
    handleSuccess : function(component, event, helper) {
        component.find('notifLib').showToast({
            "variant": "success",
            "title": "Computer Created",
            "message": "Record ID: " + event.getParam("id")
        });
    }
})

Output:
User-added image
This is the first time am working with Lightnng component. Any help with coding is much appreciated.
Hi,

When these 5 fields are marked "TRUE"
Field 1
Field 2
Field 3
Field 4
Field 5

Update "GOLD " to TRUE automatically.

These field are on Account object. Can someone help with the formula for this.
  • April 09, 2019
  • Like
  • 0
We have two custom fields on leads pardot hard bounced and pardot hard bounced cloned. if pardot hard bounced is true, we need to make pardot hard bounced cloned, if a lead updates a field on the record.

For this i have written Trigger and the code coverage is 0%. I want to deploy it to production. If i need to deploy  need to write a test class and apex class. Can someone help me with this. I am new to coding.

below is the trigger i have written:


trigger UpdateLead on Lead (before update) {
for(Lead l: Trigger.new) {
        If (l.pi__pardot_hard_bounced__c == true ){
           l.Pardot_Hard_Bounce_Cloned__c = true;
        }
        else {
        l.Pardot_Hard_Bounce_Cloned__c = False;
        }
    }
    }
  • March 19, 2019
  • Like
  • 0