• raju p 4
  • NEWBIE
  • 5 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 17
    Replies
public class multiselectPicklistAccountANDlead {

public list<wrap>ares;
   public list<wrap> ls= new list<wrap>();
   public list<wrap>getares(){
  for(lead l:[select Account_del__r.Id,Account_del__r.Phone,account_del__r.Name,Id,Name,LastName,city,phone from lead limit 5]){
   ls.add(new wrap(false,l));
          
    return ls;
    }}
        public class wrap{
           public Boolean sel{set;get;}
           public account ac{set;get;}
           public lead ld{set;get;}
             public wrap(Boolean b,account a,lead l){
              sel=b;
              ac=a;
              ld=l;
             }
        }
}

i am geting this Error>>>>>>>>>>>>>>

Error: multiselectPicklistAccountANDlead Compile Error: Constructor not defined: [multiselectPicklistAccountANDlead.wrap].<Constructor>(Boolean, Lead) at line 7 column 11
 i am getting this error >>

System.CalloutException: Endpoint can not be null
Error is in expression '{!sendsmsTwilio}' in component <apex:commandButton> in page sendsmstwilio: Class.sendsmsTwilio.sendsmsTwilio: line 28, column 1
Class.sendsmsTwilio.sendsmsTwilio: line 28, column 1

and its apex code is>>
public class sendsmsTwilio {
public string Messages{set;get;}
public string ACCOUNTSID{set;get;}  
public string AUTHTOKEN{set;get;}
  public string Mobile{set;get;}
public string result{set;get;}
public contact con;

public sendsmsTwilio(ApexPages.StandardController controller) {
con =(contact)controller.getrecord();
}
public void sendsmsTwilio(){
BoxIntrgration__c c= [SELECT  accountsid__c, AUTHTOKEN__c from BoxIntrgration__c where name=:'twilio'];
ACCOUNTSID=c.accountSid__c;
AUTHTOKEN=c.AUTHTOKEN__c;

Http p= new http();
HttpRequest req= new HttpRequest();
 string url='https://api.twilio.com/2010-04-01/Accounts/AC58cf47802fa54fe399e85fd822bf2103/Messages.json';
   string body ='Well come';
          body=body+'&To=+con.phone';
           body=body+'&AUTHTOKEN';
            body=body+'&MessagingServiceSid=MG3d0796691bb5c2d7ed266c1850240962';               

req.setmethod('POST');
httpresponse res= new httpResponse();
res=p.send(req);
result=res.getbody();


}
       
}
public class sendsmsTwilio {
public string Messages{set;get;}
public string ACCOUNTSID{set;get;}  
public string AUTHTOKEN{set;get;}
  public string Mobile{set;get;}
public string result{set;get;}
public contact con;

public sendsmsTwilio(ApexPages.StandardController controller) {
con =(contact)controller.getrecord();
}
public void sendsmsTwilio(){
BoxIntrgration__c c= [SELECT  accountsid__c, AUTHTOKEN__c from BoxIntrgration__c where name=:'twilio'];
ACCOUNTSID=c.accountSid__c;
AUTHTOKEN=c.AUTHTOKEN__c;

Http p= new http();
HttpRequest req= new HttpRequest();
 string url='https://api.twilio.com/2010-04-01/Accounts/AC58cf47802fa54fe399e85fd822bf2103/Messages.json';
   string body ='Well come';
          body=body+'&To=+con.phone';
           body=body+'&AUTHTOKEN';
            body=body+'&MessagingServiceSid=MG3d0796691bb5c2d7ed266c1850240962';               

req.setmethod('POST');
httpresponse res= new httpResponse();
res=p.send(req);
result=res.getbody();


}
       
}

 here is  i am trying to send sms from contact  and its visualforce page

<apex:page standardController="contact" extensions="sendsmsTwilio">
<apex:form >
<apex:pageblock >
<apex:inputtext value="{!contact.phone}"/>

<apeX:pageblockButtons >
<apex:commandButton value="SendSms" action="{!sendsmsTwilio}"/>
</apeX:pageblockButtons>
</apex:pageblock>
</apex:form>
{!result}
  
</apex:page>

 i  tryed using try and catch but , but i am not geting message ,please do the needful

 
public class WhenyouCreateContactCreateAccount {
       
    public static void CreateAccount(list<contact>cons){
         set<id>ids= new set<id>();
         list<account>acc= new list<account>();
      
            for(contact c:cons){
               ids.add(c.AccountId);
  acc=[select name,phone from account where id IN:ids];
                for(account a:acc){

    a.Name=c.Name;
   a.Phone=c.phone;
 
}
 insert  acc;
}
    }}



trigger WhenyouCreateContactCreateAccount on Contact (after insert,after update) {
    WhenyouCreateContactCreateAccount.CreateAccount(trigger.new);

}

please do the needful, where i am doing wrong
Hi Developers,
when i am submit the button  ia m geting This error
<apex:page controller="BoXIntegration" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons location="Top">
<apex:commandButton value="Code" action="{!getCode}"/>
</apex:pageBlockButtons>
<apex:inputtext value="{!ClientId}" size="40"/><br/> 
URL:<apex:outputLabel value="{!uri}"/>
</apex:pageBlock>
</apex:form>
</apex:page>
>>>>>>>>>>>>>
public class BoXIntegration {
    public string ClientId{set;get;}
    public string ClientScr{set;get;}
    public string uri{set;get;}
    public string Acstoken{set;get;}
    public  BoXIntegration(){
      uri='https://c.ap4.visual.force.com/apex/BoxResponse';
    }
    public pageReference getCode(){
   string url='https://account.box.com/api/oauth2/authorize';
        url='url+esponse_type=code&client_id='+ClientId+'&redirect_uri='+uri+'&state=Raju';
        pageReference p= new pageReference(url);
         return p;
    } 
}
 and added url added in remotesite seting
even also i am using readonly  atribute ,  geting same error please do the needful,

Collection size 10,028 exceeds maximum size of 10,000. 


<apex:page controller="Leaddisplay" readOnly="true">

       <apex:pageBlock >
           <apex:DataTable value="{!ld}" var="a">
               <apex:column value="{!a.Lastname}"  headerValue="LastName"/>
            <apex:column value="{!a.company}"  headerValue="companyName"/>
               <apex:column value="{!a.status}"  headerValue="LeadStatus"/>
                     <apex:column value="{!a.phone}"  headerValue="phone"/>
               </apex:DataTable>
             
                 </apex:pageBlock>
      </apex:page>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>....


public class Leaddisplay {
    public list<lead>ld{set;get;}
    public Leaddisplay(){
       // ld= new list<lead>();
       ld=[select  lastname,phone,company,status from lead];
        
    }

}

  
 
public class AgregateFunctionOnTestObject {
    public static void Afterupdate(Map<id,Test123__c> newmap,Map<id,Test123__c>oldmap){
           list<id> ids= new list<id>();
        for(id key: oldmap.keyset()){
            Test123__c n1=newmap.get(key);
            Test123__c o1=oldmap.get(key);
             ids.add(key);
        }
    }
            list<Test__c> tc= new list<Test__c>();
    list<Test__c> t=[select Percentage__c,(select id from Test123s__r)from Test__c where id=:ids];
        for(Test__c t1:t){
            for(Test123__c r:Test123s__r){
            t1.Percentage__c= t1.Test123s__r.size();
            tc.add(t1);
        }        }  
}
        
    
         

 
This page has an error. You might just need to refresh it. Action failed: c:LightUIcomponent2$controller$callme [omponent is not defined] Failing descriptor: {c:LightUIcomponent2$controller$callme}
    when i am going to run lighting application i am getting this error 

>>1   Component 

<aura:component >
    <ui:inputText label="Enter Name" placeholder="employee Name" aura:id="name"/>
    <ui:inputText label="My name" aura:id="Myname"/>
    <ui:button label="submit" press="{!c.callme}"/>
</aura:component>
>>>>>>>>>>>>>>2 contoller
({
    callme :function(component) {
        var name=component.find("name").get("v.value");
                omponent.find("my name").get("v.value",name);

        
    }
}) 
3>>>>>>>>>>>>application 3
<aura:application >
    <c:LightUIcomponent2/>
</aura:application>

i am learning lighting >.please help me out

I'm getting the followig error in my test method:

constructor not defined: [AccountOpenCasesExtension].<Constructor>()

 

I instantiated the class file and called my initialize method that is called within the constructor.  I'm not clear on why the constructor is not defined.  Shouldn't the constructor execute when the class is instantiated?

 

Here is my class file:

 

public class AccountOpenCasesExtension { private List<Account> accounts; public List<Account> getAccounts() { return accounts; } public AccountOpenCasesExtension(ApexPages.StandardController stdController) { init((Account)stdController.getRecord()); //accounts = [Select id, name, (Select Owner.Name, Contact.Name, CaseNumber, Subject, CreatedDate From Cases WHERE IsClosed = false) From Account a WHERE id =: stdController.getId()]; } public void init(Account a) { accounts = [Select id, name, (Select Owner.Name, Contact.Name, CaseNumber, Subject, CreatedDate From Cases WHERE IsClosed = false) From Account a WHERE id =: a.Id]; } static testMethod void test() { Account acct = [Select id, name, (Select Owner.Name, Contact.Name, CaseNumber, Subject, CreatedDate From Cases WHERE IsClosed = false) From Account a LIMIT 1]; AccountOpenCasesExtension ctrl = new AccountOpenCasesExtension(); ctrl.init(acct); } }