• Ganesh Babu 8
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
Hi All,

I am trying to send an email setting an Order record id in setWhatId method. It is throwing error "First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY". 
List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();

list<String> toaddress = new list<String>{'gbabu.tg@xxx.com'};

mail.setToAddresses(toaddress);
mail.setTemplateId(emailtemplt.Id);
mail.setTargetObjectId(Id.valueof(uId));
//If it comment below code, it is working.
mail.setWhatId(Id.valueof('8018E000000ghha'));

mail.setSaveAsActivity(false);

mails.add(mail);
Messaging.sendEmail(mails);
If I comment that particular line, it is wokring fine. As per the document setWhatId should accept Order record id, but it is throwing error. 
Please help me to find the exact issue.

Thanks in Advance!
 
Hi All,

We have created a lightning component. Inisde the component we are refering another component. we would like to validate the data inside child component on a button click from parent component.

Can anyone give some sample code or suggestion?

Thanks and Regards,
Ganesh Babu.
Hi,

We have built a community portal with lightning components, we have a requirement like Internal users/system admin should login as other portal user and view their details. we have to restrict few pages in community based on logged in user.

Is there any option to find the logged in user is a contact or Internal user/system admin in community?

 Please help.

- Ganesh
Hi,

In my lightning component, I want a button to download email template in PDF format. we have renderAs PDF option in VF page. Do we have similar option to download page/ template in PDF?

Thanks in Advance!! :)

Regards,
Ganesh.
 
Hi,

In my lightning component, I want a button to download email template in PDF format. we have renderAs PDF option in VF page. Do we have similar option to download page/ template in PDF?

Thanks in Advance!! :)

Regards,
Ganesh.
 
We have created a lightning component. Inisde the component we are refering another component. we would like to validate the data inside child component on a button click from parent component.

Can anyone give some sample code or suggestion?

Thanks and RegardsUser-added image
Here we call child component

<div class="slds-modal__content slds-p-around--medium wide400">
                <!--Transaction Editor Component Here -->
                <!--<c:TransactionViewer thistrans="{!v.thistrans}" currencies="{!v.currencies}" 
                           tdetails="{!v.thisdetails}" /> -->
             {!v.body}
</div>


below is component  code is long so I paset only 2 field code


<div class="slds-form-element slds-size--1-of-3">
                            <!--<label class="slds-form-element__label" for="descrField">Description</label>-->
                            <!--<force:inputField aura:id="descrField" class="slds-textarea" value="{!v.thistrans.Description__c}"/> -->
                            <ui:inputText aura:id="descrField" class="slds-input" required="true" label="Description" value="{!v.thistrans.Description__c}"/>
                        </div>
                        <div class="slds-form-element slds-size--1-of-3">                            
                            <c:LookupSObject label="Deal/Tranche" pluralLabel="Deal/Tranches" sObjectAPIName="Tranche__c" instanceId="tnxTr"                          
                                             
                                             iconName="standard:process"
                                             listIconClass="slds-icon-standard-account"
                                             selectedId="{!v.thistrans.Tranche__c}"
                                             selectedName="{!v.thistrans.TName}"
                                             />
                        </div>

And here is controller code
 
okTranerror: function(component){
        var tratitle = component.find("trannameField").get("v.value");
        var haserrors = false;
        
        if(!tratitle){            
            effnamefld.set("v.errors", [{message:"Provide Name First!"}]);
            haserrors = true;
        }
please help i m try a lot but not success

thanks in advance 
Hi,

We have built a community portal with lightning components, we have a requirement like Internal users/system admin should login as other portal user and view their details. we have to restrict few pages in community based on logged in user.

Is there any option to find the logged in user is a contact or Internal user/system admin in community?

 Please help.

- Ganesh
Hi,

           I have tried to calculate sum of custom array values in lightning component. But unable to get the index values. If we get the index values means using for loop to calculate the sum. Please guide me where i made mistake and how  to solve this. 

Component:
-----------------------
<aura:component >
    <aura:attribute name="arrvals" type="integer[]" default="1,2,3,4,5"/>
    <aura:attribute name="numbers" type="integer"/>
    
    <aura:iteration var="num" items="{!v.arrvals}" aura:id="ipv" indexVar="index" >
        {!index}<ui:inputNumber label="Input value : " aura:id="{!index+'ip'}" placeholder="Enter the Vlaue"/>  
    </aura:iteration>
    
    <ui:button aura:id="addbtn" label="Calculate" press="{!c.calculate}" /><br/>     
    Sum of the Value : <ui:outputNumber aura:id="totalValue" value="{!v.totalValue}" />  
</aura:component>

Controller.js
------------------
({       
    calculate : function(component) {
       
       try {     
            debugger;
            var numbers=component.find("index+ip").get("v.value");
            console.log(numbers); 
            var arrlist =component.get("v.arrvals");
            console.log(arrvals);            
            var totalval=0;            
            for(var i=0; i<arrlist.length; i++) { 
                //var sum = parseInt(numbers)
                totalval += parseInt(numbers) ;
                console.log(totalval);                
            }          
                component.set('v.totalValue',totalval);            
        }                           
        catch (e) {
            alert('Exception : '  + e);
        }     
    } ,
})

Advance Thanks
Sivasakthi