• Pramodh_Shiva
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
Hi,
Am new to lightning and got stuck up with a small issue.
I have parent component 'TaskModel' which I will be invoking from quick action and will get record ID. I have child (inner component) which also requires record ID, hasRecordId didn't work in child component so I was trying to pass value from parent component using event. I tried all poosible ways (APPLICATION/COMPONENT event) still couldn't find out why child component event method is not executing.
<!--passAccountId.evt-->

<aura:event type="APPLICATION" description="Event template" >
<aura:attribute name="AccountId" type="String"/>
</aura:event>

<!--TaskModel.cmp--> 
<aura:component controller="AccountStatforStatus" implements="flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction" access="global" >
<aura:registerEvent name="navAccountId" type="c:passAccountId"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="showAccount" type="Boolean"/>
<aura:attribute name="recordId" type="Id"/>
<aura:if isTrue="{!v.showAccount}">
<c:accountProspectSuspectUpdate/>
</aura:if>
</aura:component>

<!--TaskModelController.js-->
({
    doInit : function(component, event, helper) {
        
        var evt = $A.get("e.c:passAccountId");
        alert('TM AID '+component.get("v.recordId"));
        var evtAid = component.get("v.recordId");
        evt.setParams({"AccountId":evtAid.toString()});
        evt.fire();
        alert('event fired');
        /*var compEvent = component.getEvent("navAccountId");
        alert('TM AID '+component.get("v.recordId"));
        var evtAid = component.get("v.recordId");
        compEvent.setParams({"AccountId":evtAid});
        compEvent.fire();*/
        var action = component.get("c.getAccountStat");
action.setParams({
"accountId": component.get("v.recordId")
});
// Register the callback function
action.setCallback(this, function(response) {
            var data = response.getReturnValue();
            component.set("v.showAccount",data);
            if(!data){
                alert('Not Fire');
                var createRecordEvent = $A.get("e.force:createRecord");
                createRecordEvent.setParams({
                    "entityApiName": "Task"
                });
                createRecordEvent.fire();
            }
        });
        $A.enqueueAction(action);
    }
})

<!--accountProspectSuspectUpdate.cmp-->
<aura:component controller="AccountStatforStatus" implements="force:appHostable,flexipage:availableForAllPageTypes">
<aura:handler event="c:passAccountId" action="{!c.ValueFromApplicationEvent}" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="accountRecordId" type="Id" />
<aura:attribute name="selectedVal" type="String" />
<aura:attribute name="picklistValues" type="Object" />
<lightning:select value="{!v.selectedVal}" name="selectSP" aura:id="selectSP" label="Suspect/Prospect" required="true" >
<option value="" >--Choose One--</option>
<aura:iteration items="{!v.picklistValues}" var="sp">
<option value="{!sp}" text="{!sp}"></option>
</aura:iteration>
</lightning:select>
<lightning:buttonGroup>
<lightning:button variant="brand" label="Update" onclick="{! c.updateAccount }"/>
<lightning:button label="Cancel" />
</lightning:buttonGroup>
</aura:component>

<!--controller-->
({
doInit : function(component, event, helper) {
        var action = component.get("c.getPickListValuesIntoList");
action.setCallback(this, function(response) {
var list = response.getReturnValue();
component.set("v.picklistValues", list);
})
// Invoke the service
        $A.enqueueAction(action);
},
ValueFromApplicationEvent : function(component,event,helper){
var evtAid = event.getParam("AccountId");
alert('Event '+evtAid);
component.set("v.accountRecordId",evtAid);
},
updateAccount : function(component, event, helper) {
var action = component.get("c.updateAccountStat");
alert('Record Id'+component.get("v.accountRecordId"));
action.setParams({
"accountId": component.get("v.accountRecordId"),
"accountStat" : component.find("selectSP").get("v.value")
});
// Register the callback function
action.setCallback(this, function(response) {
var updateResult = response.getReturnValue();
if(updateResult === 'Success'){
alert('Success '+updateResult);
var createRecordEvent = $A.get("e.force:createRecord");
createRecordEvent.setParams({
"entityApiName": "Task"
});
createRecordEvent.fire();
}
else{
alert('Error '+updateResult);
}
});
$A.enqueueAction(action);
}
})

am not getting value to accountRecordId in child.

Please Help, Thanks in advance.
 
Hi All,

I am working on task object to populate some values, as task,email and log a call will be considered as task, I want to differentiate them in my trigger before the record is inserted.
I used tasksubtype field to check whether it is task or email but seems this field is NULL in before insert only after the record is inserted it shows the value.
Please help, thanks in advance.
PFA for reference
User-added image
Hi All,

so I am facing quite strange error in email and I tried all possible ways from 3 days and I couldn't figure out why am getting this SINGLE_EMAIL_LIMIT_EXCEEDED.

In contact list view I have a custom button called mass mail which calls VF page where I will select the template and click send button.
in controller there's an sendmail method which will divide the list of contact's into 2 arrays and send mail using single email class twice (becoz we need to remove 'via') everything was working fine until in a particular list view where lets say XYZ if i select more than 50 contacts and send mail it is throwing SINGLE_EMAIL_LIMIT_EXCEEDED error. apart from XYZ list view if I select any other list view everything is working fine even for 200 records (i.e 200 mails are sent) so i modified my code and divided the list into 4 different arrays and sending mail 4 times (as limit for email invocation is 10) again this function is working for all list view except XYZ list view.

additional info:
max i will select 200 and dividing into 4 so each sendmail will have only 50 recipients.(limit is 100 recipients) 
no cc and bcc.
Hi,
Am new to lightning and got stuck up with a small issue.
I have parent component 'TaskModel' which I will be invoking from quick action and will get record ID. I have child (inner component) which also requires record ID, hasRecordId didn't work in child component so I was trying to pass value from parent component using event. I tried all poosible ways (APPLICATION/COMPONENT event) still couldn't find out why child component event method is not executing.
<!--passAccountId.evt-->

<aura:event type="APPLICATION" description="Event template" >
<aura:attribute name="AccountId" type="String"/>
</aura:event>

<!--TaskModel.cmp--> 
<aura:component controller="AccountStatforStatus" implements="flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction" access="global" >
<aura:registerEvent name="navAccountId" type="c:passAccountId"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="showAccount" type="Boolean"/>
<aura:attribute name="recordId" type="Id"/>
<aura:if isTrue="{!v.showAccount}">
<c:accountProspectSuspectUpdate/>
</aura:if>
</aura:component>

<!--TaskModelController.js-->
({
    doInit : function(component, event, helper) {
        
        var evt = $A.get("e.c:passAccountId");
        alert('TM AID '+component.get("v.recordId"));
        var evtAid = component.get("v.recordId");
        evt.setParams({"AccountId":evtAid.toString()});
        evt.fire();
        alert('event fired');
        /*var compEvent = component.getEvent("navAccountId");
        alert('TM AID '+component.get("v.recordId"));
        var evtAid = component.get("v.recordId");
        compEvent.setParams({"AccountId":evtAid});
        compEvent.fire();*/
        var action = component.get("c.getAccountStat");
action.setParams({
"accountId": component.get("v.recordId")
});
// Register the callback function
action.setCallback(this, function(response) {
            var data = response.getReturnValue();
            component.set("v.showAccount",data);
            if(!data){
                alert('Not Fire');
                var createRecordEvent = $A.get("e.force:createRecord");
                createRecordEvent.setParams({
                    "entityApiName": "Task"
                });
                createRecordEvent.fire();
            }
        });
        $A.enqueueAction(action);
    }
})

<!--accountProspectSuspectUpdate.cmp-->
<aura:component controller="AccountStatforStatus" implements="force:appHostable,flexipage:availableForAllPageTypes">
<aura:handler event="c:passAccountId" action="{!c.ValueFromApplicationEvent}" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="accountRecordId" type="Id" />
<aura:attribute name="selectedVal" type="String" />
<aura:attribute name="picklistValues" type="Object" />
<lightning:select value="{!v.selectedVal}" name="selectSP" aura:id="selectSP" label="Suspect/Prospect" required="true" >
<option value="" >--Choose One--</option>
<aura:iteration items="{!v.picklistValues}" var="sp">
<option value="{!sp}" text="{!sp}"></option>
</aura:iteration>
</lightning:select>
<lightning:buttonGroup>
<lightning:button variant="brand" label="Update" onclick="{! c.updateAccount }"/>
<lightning:button label="Cancel" />
</lightning:buttonGroup>
</aura:component>

<!--controller-->
({
doInit : function(component, event, helper) {
        var action = component.get("c.getPickListValuesIntoList");
action.setCallback(this, function(response) {
var list = response.getReturnValue();
component.set("v.picklistValues", list);
})
// Invoke the service
        $A.enqueueAction(action);
},
ValueFromApplicationEvent : function(component,event,helper){
var evtAid = event.getParam("AccountId");
alert('Event '+evtAid);
component.set("v.accountRecordId",evtAid);
},
updateAccount : function(component, event, helper) {
var action = component.get("c.updateAccountStat");
alert('Record Id'+component.get("v.accountRecordId"));
action.setParams({
"accountId": component.get("v.accountRecordId"),
"accountStat" : component.find("selectSP").get("v.value")
});
// Register the callback function
action.setCallback(this, function(response) {
var updateResult = response.getReturnValue();
if(updateResult === 'Success'){
alert('Success '+updateResult);
var createRecordEvent = $A.get("e.force:createRecord");
createRecordEvent.setParams({
"entityApiName": "Task"
});
createRecordEvent.fire();
}
else{
alert('Error '+updateResult);
}
});
$A.enqueueAction(action);
}
})

am not getting value to accountRecordId in child.

Please Help, Thanks in advance.
 
Hi All,

I am working on task object to populate some values, as task,email and log a call will be considered as task, I want to differentiate them in my trigger before the record is inserted.
I used tasksubtype field to check whether it is task or email but seems this field is NULL in before insert only after the record is inserted it shows the value.
Please help, thanks in advance.
PFA for reference
User-added image