• nagachandra kn
  • NEWBIE
  • 85 Points
  • Member since 2014

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 15
    Replies
Hi All,

Why do we write webservice classes when there is enterprise and partner wsdl? I would like to know in what scenario we write webservice classes instead of enterprise and partner wsdl. Can anyone explain me with real time example.
User-added image

Hi everyone,

Please help me setup self service portal. As you can see in the above screenshot self service portal is not present, so please suggest me how to enable it.

Thanks in advance

 
Hi All,

Can any one Please help to write a test class to my Trigger


trigger sendNotificationTrigger on CampaignMember (after insert) {
    Set<Id> LeadIds = new Set<ID>();
    Test_Setting__c tm;//Assinging Custom setting To the variable tm
    tm=Test_Setting__c.getorgdefaults();
    String Template=tm.Template__c;
    Decimal Days=tm.Threshold_Days__c;
     
    
    for(CampaignMember campMem : Trigger.new){//
        if(campMem.leadid != null){
            LeadIds.add(campMem.leadid);
         
            }
            
    List<Messaging.SingleEmailMessage> mails =new List<Messaging.SingleEmailMessage>();   
    for(Lead ld : [select id, Lead_age__c, Status, owner.email from Lead where id IN : LeadIds])
    if(ld.Status!='Qualified'&&ld.Lead_Age_In_days__c>=Days)
    //Checking Condition Status not equal to Qualified and Lead_Age_In_days__c greater than equal to 30
    {
     Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();// For Email
                             
      List<String> sendTo = new List<String>();
      sendTo.add(ld.Owner.Email);//sending message via Email to the Owner of the lead
      mail.setToAddresses(sendTo);
      mail.saveAsActivity = false;
      mail.setTemplateId(Template);//Using custom setting field template as template id
       mail.setTargetObjectId(ld.Ownerid);                           
      mails.add(mail);
  Messaging.sendEmail(mails);
}
}
}

Thanks
​Raj.
Hi,

I have created a visualforce email template on which fetches the lead details and we have one custom object called leadinfo__c from this one as well. Now the problem is the lead id from template is not getting passed to the vf component. could you please help?

Vf template
<messaging:emailTemplate subject="test" recipientType="Lead" relatedToType="Lead">
<messaging:plainTextEmailBody >

<c:getLeadInfo LeadId="{!RelatedTo.Id}"/>


</messaging:plainTextEmailBody>
</messaging:emailTemplate>

vf component
 
<apex:component controller="LeadInfocon" access="global">
    <apex:attribute name="LeadId" 
                    type="id" required="required" assignTo="{!leadVarId}" description="To get the lead id from template"/>
    
    <apex:outputText value="{!leadVarId}"></apex:outputText>
 
    Hi {!leadinfo.lead__r.name}, 
    
    You were recently on realtor.com and saw a property that you were looking to get some information on {!leadinfo.Street_Address__c} ADDRESS, {!leadinfo.City__c} .it is the four plex property. I have a team of agents here in our Fresno office and any one of them would be happy to assist you and answer any questions may have along the journey to your new home. Feel free to give me a call so that I can connect you to them, my direct line is 559-517-3436. 
    
    Thanks {!leadinfo.lead__r.name}
    Have a good day.
</apex:component>

controller for compoent
public with sharing class LeadInfocon {
    
    public LeadInfo__c leadinfo ;
    
    public LeadInfo__c getleadinfo(){
        
        if(leadVarId == null)
            leadinfo = [Select ID, Street_Address__c, City__c,Lead__r.name, CreatedDate from LeadInfo__c where Lead__c = :leadVarId order by CreatedDate desc limit 1];
        //system.debug('Lead name::'+leadinfo.lead__r.name);
        return leadinfo;
    }
    
    public void setleadinfo(){
        
    }
    public id leadVarId {
       get;set;
    }
        
        
     
    public lead ld {get;set;}
    
    
    
    public LeadInfocon(){
        
    }
    
}

What i am doing wrong? Please help.

 
Hi All,

I have  a requirement where i need write a batch class to delete all the records which are older than 14 days . How to write the SOQL for the same? 
Hi All,

I am writing a basic lightning component. please find the code below. I am just getting the value from the inputtext component and displaying it on the console. But it is giving me following error. what i m doing wrong.?
 
<aura:component >
    <aura:attribute name="newExpense" type="KNNaga__Expense__c" access="public"/>
    
    <ui:inputText value="{!v.newExpense.KNNaga__Amount__c}" label="Expense Name" aura:id="Amount"/>
    <ui:button label="submit" press="{!c.createExpense}"/>
    
	
</aura:component>

controller.
({
	createExpense : function(component, event, helper) {
        
        var name = component.find("Amount");
        var value = name.get("v.value");
        
        console.log("value::"+value);
       
		
	}
})

Error which i m getting  aftter clicking the button. No error displayed in javascript console.

This page has an error. You might just need to refresh it. Error in $A.getCallback() [Cannot read property 'KNNaga__Amount__c' of null] Failing descriptor: {markup://ui:input} 

Thanks in advance.

 
Hi All,

I am writing a basic program by using selectcheckboxes tag. But Once i click the button and panel is rerendered. the below is list is not displaying the selected values. what i m missing?


VF Page
 
<apex:page controller="selectcheckcon">
    <Apex:form>
    <apex:pageBlock title="Select checkboxes">
        <apex:pageMessages  id="page" />
        <apex:pageBlockSection title="Demo of select checkboxes">
            <apex:outputLabel value="Select the countries"/>
            <apex:selectCheckboxes value="{!countries}">
                <apex:selectOptions value="{!items}">
                </apex:selectOptions>
            </apex:selectCheckboxes>
        </apex:pageBlockSection>
        
       
        <apex:pageBlockButtons>
            <apex:commandButton action="{!test}" rerender="out,page" status="status" value="Click me!"></apex:commandButton>
        </apex:pageBlockButtons>
        
        
    </apex:pageBlock>
</Apex:form>

 <apex:outputPanel id="out">
                <apex:actionStatus startText="Fetching Data..."  id="status">
                <apex:dataList value="{!countries}" var="con">
                    {!con}
                </apex:dataList>
                </apex:actionStatus>
            </apex:outputPanel>
</apex:page>

Controller class:
 
public class selectcheckcon {
    
    public String[] countries = new String[]{};
    
    
    public String[] getcountries(){
        
        return countries;
    }
    
    public void setcountries(string[] country){
        
        countries = country;
    }
    
    
    public selectcheckcon(){
        
       
    }
    
    public list<selectoption> getItems(){
        
        list<selectoption> options =  new list<SelectOption>();
        
        options.add(new SelectOption('USA','USA'));
        options.add(new SelectOption('INDIA','INDIA'));
        options.add(new SelectOption('AUS','AUS'));
    
        return options;
    }
    
    public pageReference test(){
        
        return null;
    }

}

 
Hi Everyone,

I need capital info solution salesforce integration materials. if anyone is having any pdf doc. Please send me
Hi,

I have a picklist field on contact called function__c and each value of the picklist has translation enabled. i have another object called contact team member which is related to contact by master detail and it has a formula field which is assigned the picklist value from contact.

But when i change the language, translation value is not showing up in formula field. please help me with this ?


 
Hi All,

I am writing a basic lightning component. please find the code below. I am just getting the value from the inputtext component and displaying it on the console. But it is giving me following error. what i m doing wrong.?
 
<aura:component >
    <aura:attribute name="newExpense" type="KNNaga__Expense__c" access="public"/>
    
    <ui:inputText value="{!v.newExpense.KNNaga__Amount__c}" label="Expense Name" aura:id="Amount"/>
    <ui:button label="submit" press="{!c.createExpense}"/>
    
	
</aura:component>

controller.
({
	createExpense : function(component, event, helper) {
        
        var name = component.find("Amount");
        var value = name.get("v.value");
        
        console.log("value::"+value);
       
		
	}
})

Error which i m getting  aftter clicking the button. No error displayed in javascript console.

This page has an error. You might just need to refresh it. Error in $A.getCallback() [Cannot read property 'KNNaga__Amount__c' of null] Failing descriptor: {markup://ui:input} 

Thanks in advance.

 
Hi All,

I am writing a basic program by using selectcheckboxes tag. But Once i click the button and panel is rerendered. the below is list is not displaying the selected values. what i m missing?


VF Page
 
<apex:page controller="selectcheckcon">
    <Apex:form>
    <apex:pageBlock title="Select checkboxes">
        <apex:pageMessages  id="page" />
        <apex:pageBlockSection title="Demo of select checkboxes">
            <apex:outputLabel value="Select the countries"/>
            <apex:selectCheckboxes value="{!countries}">
                <apex:selectOptions value="{!items}">
                </apex:selectOptions>
            </apex:selectCheckboxes>
        </apex:pageBlockSection>
        
       
        <apex:pageBlockButtons>
            <apex:commandButton action="{!test}" rerender="out,page" status="status" value="Click me!"></apex:commandButton>
        </apex:pageBlockButtons>
        
        
    </apex:pageBlock>
</Apex:form>

 <apex:outputPanel id="out">
                <apex:actionStatus startText="Fetching Data..."  id="status">
                <apex:dataList value="{!countries}" var="con">
                    {!con}
                </apex:dataList>
                </apex:actionStatus>
            </apex:outputPanel>
</apex:page>

Controller class:
 
public class selectcheckcon {
    
    public String[] countries = new String[]{};
    
    
    public String[] getcountries(){
        
        return countries;
    }
    
    public void setcountries(string[] country){
        
        countries = country;
    }
    
    
    public selectcheckcon(){
        
       
    }
    
    public list<selectoption> getItems(){
        
        list<selectoption> options =  new list<SelectOption>();
        
        options.add(new SelectOption('USA','USA'));
        options.add(new SelectOption('INDIA','INDIA'));
        options.add(new SelectOption('AUS','AUS'));
    
        return options;
    }
    
    public pageReference test(){
        
        return null;
    }

}

 
Hi All,

Why do we write webservice classes when there is enterprise and partner wsdl? I would like to know in what scenario we write webservice classes instead of enterprise and partner wsdl. Can anyone explain me with real time example.
User-added image

Hi everyone,

Please help me setup self service portal. As you can see in the above screenshot self service portal is not present, so please suggest me how to enable it.

Thanks in advance

 
On Getting Started with Apex Triggers module but getting compile error in my Dev Console - Variable does not exist: EmailManager.

Have manually typed sample code, and pasted from module with same error.  Should I be looking for a setup item in my dev org, thats not enabled?

Code

trigger ExampleTrigger on Contact (after insert, after delete) {
    if (Trigger.isInsert) {
        Integer recordCount = Trigger.New.size();
        // Call a utility method from another class
        EmailManager.sendMail('Your email address', 'Trailhead Trigger Tutorial', 
                    recordCount + ' contact(s) were inserted.');
    }
    else if (Trigger.isDelete) {
        // Process after delete
    }
}

What am I not seeing?
Hi All,

Can any one Please help to write a test class to my Trigger


trigger sendNotificationTrigger on CampaignMember (after insert) {
    Set<Id> LeadIds = new Set<ID>();
    Test_Setting__c tm;//Assinging Custom setting To the variable tm
    tm=Test_Setting__c.getorgdefaults();
    String Template=tm.Template__c;
    Decimal Days=tm.Threshold_Days__c;
     
    
    for(CampaignMember campMem : Trigger.new){//
        if(campMem.leadid != null){
            LeadIds.add(campMem.leadid);
         
            }
            
    List<Messaging.SingleEmailMessage> mails =new List<Messaging.SingleEmailMessage>();   
    for(Lead ld : [select id, Lead_age__c, Status, owner.email from Lead where id IN : LeadIds])
    if(ld.Status!='Qualified'&&ld.Lead_Age_In_days__c>=Days)
    //Checking Condition Status not equal to Qualified and Lead_Age_In_days__c greater than equal to 30
    {
     Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();// For Email
                             
      List<String> sendTo = new List<String>();
      sendTo.add(ld.Owner.Email);//sending message via Email to the Owner of the lead
      mail.setToAddresses(sendTo);
      mail.saveAsActivity = false;
      mail.setTemplateId(Template);//Using custom setting field template as template id
       mail.setTargetObjectId(ld.Ownerid);                           
      mails.add(mail);
  Messaging.sendEmail(mails);
}
}
}

Thanks
​Raj.
what is the @future annotation? what is the use of @future annotation explain briefly
Hi All

We have integrated salesforce using SOAP in C#. We are trying to send mail using salesforce templates through the code. But we are unable to provide fromAddress in the mail. Below is the code for the same : 

SingleEmailMessage message = new SingleEmailMessage();
                message.emailPriority = EmailPriority.High;
                message.saveAsActivity = false;
                message.useSignature = true;
                message.templateId = templateId;
                message.targetObjectId = CrmId;
                SingleEmailMessage[] messages = { message };
                SendEmailResult[] results = _sf.sendEmail(messages);

Please let us know a way to add fromAddress while sending mail as we are unable to find any option for that.

Regards
​Ankit

By selecting the value of picklist it should display different value in pageblock table
I have a scenario where too many calculations to be done with large volume of data to load a custom visualforce page report. I have almost avoided unnecessary loop in Apex code. Since it is more than 100k records, calculation is taking long time which is exceeding limit of 10000ms. So it is hitting CPU Limit Exceeded error. Is there a way to increase CPU time?