• dany__
  • NEWBIE
  • 50 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 18
    Replies
when i provide the ip address and hit the button i am getting this response 
ip:: 8.8.8.8, country_code:: US, country_name:: United States, region_code:: CA, region_name:: California, city:: Mountain View, zip_code:: 94040, time_zone:: America/Los_Angeles, latitude:: 37.386, longitude:: -122.084, metro_code:: 807
how to deserialize and move it into an object 
  • March 11, 2015
  • Like
  • 0
i want to display this field  in my vf page how to achive this  plz guide me
<apex:page standardController="employee__c" extensions="ass">
  <apex:form >
  <apex:inputField value="{!acc.account__r.phone}"/>
  </apex:form>
</apex:page>
  • January 27, 2015
  • Like
  • 0
here is my code (i just dont want to give hard code id ) . plz guide me
----------------------------------------
<apex:page standardController="contact" extensions="pg">
 <apex:form >
<apex:inputField value="{!contact.accountid}"/>

 </apex:form>
 <apex:form >
 <apex:pageBlock title="contact details">
  <apex:pageBlockSection columns="2">
  <apex:pageBlockTable value="{!cont}" var="co">
  <apex:column value="{!co.lastname}"/>
    <apex:column value="{!co.phone}"/>
      <apex:column value="{!co.email}"/>
  </apex:pageBlockTable>
  </apex:pageBlockSection>
  </apex:pageBlock>
  <apex:pageBlock title="oppty details">
  <apex:pageBlockSection >
  <apex:pageBlockTable value="{!oppty}" var="op">
  <apex:column value="{!op.name}"/>
    <apex:column value="{!op.Amount}"/>
  </apex:pageBlockTable>
  </apex:pageBlockSection>
  </apex:pageBlock>
 </apex:form>
</apex:page>
--------------------
public class pg {

    public pg(ApexPages.StandardController controller) {
     cont=[select id, firstname, lastname , email,phone from contact where accountid =:'cont.accountid']; 
      oppty=[select name, amount from opportunity where accountid='0019000001CuKu3'];
    

    }


    

    public list<contact> cont { get; set; }
        public list<opportunity> oppty{ get; set; }
    
   public pg()
    {
     
    
    }
}
  • January 22, 2015
  • Like
  • 0
hi guys i want to display 3 objects data in readonly format in a single vf page? this 3 objects are inter related to one other  . and  we must use a standars controller  . how can this be done
  • January 21, 2015
  • Like
  • 0
hi guys i am trying to write a test class for wrapper class
public class AccountSelectClassController {

    public list<account> selectedAccounts { get; set; }

    public list<wrapaccount>wrapAccountList { get; set; }
    public AccountSelectClassController(){
        if(wrapAccountList == null) {
            wrapAccountList = new List<wrapAccount>();
            for(Account a: [select Id, Name,BillingState, Website, Phone from Account limit 10]) {
                // As each Account is processed we create a new wrapAccount object and add it to the wrapAccountList
                wrapAccountList.add(new wrapAccount(a));
            }
        }
    }

    public void processSelected() {
       selectedAccounts = new List<Account>();
 
        for(wrapAccount wrapAccountObj : wrapAccountList) {
            if(wrapAccountObj.selected == true) {
                selectedAccounts.add(wrapAccountObj.acc);
            }
        }
    }
    public class wrapaccount
    {
      public account acc{get;set;}
      public boolean selected{get;set;}
      public wrapaccount(account a)
      {
       acc=a;
       selected=false;
      }
    }

}

can u plz guide  me  to write a test class 
@istest
public class AccountSelectClassControllertest
{
 static testmethod void wraptest()
  {
    account ac=new account(name='hari',billingcity='hyderabad',phone='9700956194');
    AccountSelectClassController.wrapaccount acw= new AccountSelectClassController.wrapaccount(ac);
     acw.compareTo(acw);
  }
}
 
  • November 26, 2014
  • Like
  • 0
trigger beins_duplicate on Account (after insert) {
    
    account na = trigger.new[0];
  
  contact c=new contact();
  c.lastname=na.name;
  c.phone=na.phone;
  c.accountid=na.id;
  insert c;
  
  opportunity o=new opportunity();
  o.Name = na.Name;
        
        o.CloseDate = date.today();
        o.StageName = 'Prospecting';
  o.accountid=na.id;
  insert o;
}

nd i had written the test class as 

------------------
@istest
public class benis_duplicatetest
{
    static testmethod void test1(){

 account ac=new account(name='hari', phone='9700956194');
/* ac.name='hari';
 ac.phone='9700956194';
  
*/
 insert ac;

 contact co =new contact();
 
 co.accountId=ac.Id;
 co.lastname=ac.name;
 co.phone=ac.phone;
 insert co;
 
system.AssertEquals('hari',co.lastname);
system.AssertEquals('9700956194',co.phone);

}
}
  • November 24, 2014
  • Like
  • 0
hi guys this is my code . here code is working fine but i am not getting the output what i expect 

<apex:page controller="PieChartCo" title="Pie Chart">
    <apex:chart height="350" width="450" data="{!pieData}">
        <apex:pieSeries dataField="data" labelField="name"/>
        <apex:legend position="right"/>
    </apex:chart>
</apex:page>

--------------------------
controller
---------------
public class PieChartCo {

    public list <piewidge>getPieData() {
       list<piewidge>data=new list<piewidge>();
       data.add(new piewidge('Jan', 30));
        data.add(new piewidge('Feb', 15));
        data.add(new piewidge('Mar', 10));
        data.add(new piewidge('Apr', 20));
        data.add(new piewidge('May', 20));
        data.add(new piewidge('Jun', 5));
        return data;
    }
public class piewidge
{
 public string data{get;set;}
 public Integer label{get;set;}
 public piewidge(string data , integer label)
 {
  this.data=data;
  this.label=label;
 }
}
}
  • November 21, 2014
  • Like
  • 0
<?xml version="1.0" encoding="utf-8" ?>

<env:Envelope xmlnssd="http://www.w3.org/2001/XMLSchema"

xmlnssi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">

<env:Body>

<n1:login xmlns:n1="urn:partner.soap.sforce.com">

<n1:username>username</n1:username>

<n1:password>password+securitycode</n1:password>

</n1:login>

</env:Body>

</env:Envelope>


 
  • November 13, 2014
  • Like
  • 0
trigger custom1 on student__c (before insert)
{
list <student__c>st1= new list <student__c>();

for(student__c st:trigger.new)
{
   if(st.sport__r.name=='rugby')
    {
      st.stdno__c=12345;
   
}
insert st;
}
}
  • August 20, 2014
  • Like
  • 0

can some one help me out  (for the bello w trigger i am facing this problem)


trigger auto_con_led on Account (before insert)
{
//set<id>set1=new set<id>();
//list<account>ac=new list<account>();
list<contact>co=new list<contact>();
if(trigger.isinsert)
{
  for(account a:trigger.new)
  {if (a.name!=null)
   {contact c=new contact();
     c.lastname='jansi';
     c.accountid=a.id;
   co.add(c);
   }}
}
update co;
}
  • August 18, 2014
  • Like
  • 0
i want to display this field  in my vf page how to achive this  plz guide me
<apex:page standardController="employee__c" extensions="ass">
  <apex:form >
  <apex:inputField value="{!acc.account__r.phone}"/>
  </apex:form>
</apex:page>
  • January 27, 2015
  • Like
  • 0
here is my code (i just dont want to give hard code id ) . plz guide me
----------------------------------------
<apex:page standardController="contact" extensions="pg">
 <apex:form >
<apex:inputField value="{!contact.accountid}"/>

 </apex:form>
 <apex:form >
 <apex:pageBlock title="contact details">
  <apex:pageBlockSection columns="2">
  <apex:pageBlockTable value="{!cont}" var="co">
  <apex:column value="{!co.lastname}"/>
    <apex:column value="{!co.phone}"/>
      <apex:column value="{!co.email}"/>
  </apex:pageBlockTable>
  </apex:pageBlockSection>
  </apex:pageBlock>
  <apex:pageBlock title="oppty details">
  <apex:pageBlockSection >
  <apex:pageBlockTable value="{!oppty}" var="op">
  <apex:column value="{!op.name}"/>
    <apex:column value="{!op.Amount}"/>
  </apex:pageBlockTable>
  </apex:pageBlockSection>
  </apex:pageBlock>
 </apex:form>
</apex:page>
--------------------
public class pg {

    public pg(ApexPages.StandardController controller) {
     cont=[select id, firstname, lastname , email,phone from contact where accountid =:'cont.accountid']; 
      oppty=[select name, amount from opportunity where accountid='0019000001CuKu3'];
    

    }


    

    public list<contact> cont { get; set; }
        public list<opportunity> oppty{ get; set; }
    
   public pg()
    {
     
    
    }
}
  • January 22, 2015
  • Like
  • 0
hi guys i want to display 3 objects data in readonly format in a single vf page? this 3 objects are inter related to one other  . and  we must use a standars controller  . how can this be done
  • January 21, 2015
  • Like
  • 0
hi guys i am trying to write a test class for wrapper class
public class AccountSelectClassController {

    public list<account> selectedAccounts { get; set; }

    public list<wrapaccount>wrapAccountList { get; set; }
    public AccountSelectClassController(){
        if(wrapAccountList == null) {
            wrapAccountList = new List<wrapAccount>();
            for(Account a: [select Id, Name,BillingState, Website, Phone from Account limit 10]) {
                // As each Account is processed we create a new wrapAccount object and add it to the wrapAccountList
                wrapAccountList.add(new wrapAccount(a));
            }
        }
    }

    public void processSelected() {
       selectedAccounts = new List<Account>();
 
        for(wrapAccount wrapAccountObj : wrapAccountList) {
            if(wrapAccountObj.selected == true) {
                selectedAccounts.add(wrapAccountObj.acc);
            }
        }
    }
    public class wrapaccount
    {
      public account acc{get;set;}
      public boolean selected{get;set;}
      public wrapaccount(account a)
      {
       acc=a;
       selected=false;
      }
    }

}

can u plz guide  me  to write a test class 
@istest
public class AccountSelectClassControllertest
{
 static testmethod void wraptest()
  {
    account ac=new account(name='hari',billingcity='hyderabad',phone='9700956194');
    AccountSelectClassController.wrapaccount acw= new AccountSelectClassController.wrapaccount(ac);
     acw.compareTo(acw);
  }
}
 
  • November 26, 2014
  • Like
  • 0
trigger beins_duplicate on Account (after insert) {
    
    account na = trigger.new[0];
  
  contact c=new contact();
  c.lastname=na.name;
  c.phone=na.phone;
  c.accountid=na.id;
  insert c;
  
  opportunity o=new opportunity();
  o.Name = na.Name;
        
        o.CloseDate = date.today();
        o.StageName = 'Prospecting';
  o.accountid=na.id;
  insert o;
}

nd i had written the test class as 

------------------
@istest
public class benis_duplicatetest
{
    static testmethod void test1(){

 account ac=new account(name='hari', phone='9700956194');
/* ac.name='hari';
 ac.phone='9700956194';
  
*/
 insert ac;

 contact co =new contact();
 
 co.accountId=ac.Id;
 co.lastname=ac.name;
 co.phone=ac.phone;
 insert co;
 
system.AssertEquals('hari',co.lastname);
system.AssertEquals('9700956194',co.phone);

}
}
  • November 24, 2014
  • Like
  • 0
Display the total no.of contacts into respective account 
Hi All,

i wrote query like " SELECT FirstName,LastName FROM Contact WHERE Account.id IN (SELECT Name, Phone FROM Account)". but not working.

Could you pls write simple query for getting frelds from account and contact using inner query.

Thank you..
Hi Guys,

Could any one suggest how could we know that the recipient has viewed the email message that we have sent from salesforce using apex class/workflow.

 
trigger custom1 on student__c (before insert)
{
list <student__c>st1= new list <student__c>();

for(student__c st:trigger.new)
{
   if(st.sport__r.name=='rugby')
    {
      st.stdno__c=12345;
   
}
insert st;
}
}
  • August 20, 2014
  • Like
  • 0

can some one help me out  (for the bello w trigger i am facing this problem)


trigger auto_con_led on Account (before insert)
{
//set<id>set1=new set<id>();
//list<account>ac=new list<account>();
list<contact>co=new list<contact>();
if(trigger.isinsert)
{
  for(account a:trigger.new)
  {if (a.name!=null)
   {contact c=new contact();
     c.lastname='jansi';
     c.accountid=a.id;
   co.add(c);
   }}
}
update co;
}
  • August 18, 2014
  • Like
  • 0

I am trying to understand standard controllers vs. custom--and how they can be used with Custom Objects?

 

Most of the code samples I have found all use the standard Account or Contact as the example like...

 

<apex:page standardController="Account" showHeader="true"  tabStyle="Account" > 

 

I have several Custom Objects that I have created---and have trying to create a simple Tabbed view of the object detail and related lists instead of the typical list view--using VF.

 

I am just starting on VF...

 

>Do standard controllers get 'auto-created' for each custom object?--assume so and thats how the display using standard SF look?

 

> When I try starting my VF page to be used on my Custom Object with...

 

 

<apex:page standardController="ThenameIusedtocreatetheobject_c" showHeader="true"  tabStyle="ThenameIusedtocreatetheobject_c"" > 

 

 

I get errors - ThenameIusedtocreatetheobject_c Does not Exist, etc.

 

 

What am I missing about standard controllers on custom objects?  Do all custom objects require a custom controller to be coded?

 

Thanks for the assistance...

 

KS