• ajay ambati
  • NEWBIE
  • 45 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 33
    Questions
  • 23
    Replies

iam finding below error while iam enabiling the lightning in my developer account
User-added image
Iam developed one vfpage using custom controller.In this my requiremnt is retrieve all parent records(account related) in one pageblock table and all childrecords(contact related ) in one pgblocktable.so i done with this and its working iam retriving rcords of both but my another requiremnt is iam placed another button for save the records its not working iam getting error and also iam used inlineedit in this but not working below is my code 

vfpage:
<apex:page controller="soql1" showHeader="false" >
    <apex:form >
    <apex:pageBlock title="listofparentrecordsacc" >
        <apex:pageBlockButtons location="top" >
            <apex:commandButton value="listofaccountsparent" action="{!myparentrecords}"  />
        <apex:commandButton value="listofcontactchid" action="{!mychildrecords}" />
                <apex:commandButton value="save" action="{!save}" />

        </apex:pageBlockButtons>
    <apex:pageBlockTable value="{!lst}" var="a"  rendered="{!show}" >
        <apex:column value="{!a.name}"/>
                <apex:column value="{!a.industry}"/>
                    <apex:column headerValue="contacts">
                        <apex:repeat value="{!a.contacts}" var="b">
                    {!b.firstname}<br/>
                        </apex:repeat>
            </apex:column>
        </apex:pageBlockTable>
        <apex:pageBlockTable value="{!cnt}" var="c" rendered="{!show1}">
            <apex:column value="{!c.firstname}"/>
                        <apex:column value="{!c.lastname}"/>
                        <apex:column value="{!c.account.name}"/>
                       </apex:pageBlockTable>
        <apex:inlineEditSupport />
                     
                      <apex:pageblockTable value="{!lst1}" var="s">
                      <apex:column value="{!s.name}"/>
                                            <apex:column value="{!s.industry}"/>

                      </apex:pageblockTable>
                       </apex:pageBlock> 
                      </apex:form>
</apex:page>


controller:
public class soql1 
{
    public string na {get;set;}
     public string ind {get;set;}
     public list<account> lst2 {get;set;}
    public boolean show {get;set;}
    public boolean show1 {get;set;}
   public list<account> lst {get;set;}
    public list<account> lst1 {get;set;}
    public list<schema.contact> cnt{get;set;}
    public void myparentrecords()
    {
        show=true;
        show1=false;
        lst=[select id,name,industry,(select id,firstname from contacts)from account];
        
        }
    
    public void mychildrecords()
    {
         show=false;
        show1=true;
       cnt=[select id,firstname,lastname,account.name from contact]; 
    }
    
    public PageReference save(){
        
        account a=new account();
        a.Name=na;
        a.industry=ind;
       // lst2 = [select id,name,industry from account ];
        //if(a.name =='')
        //{
        //a.name=na;
        lst1.add(a);
        //}
                insert lst1;
                return null;
        
    }
}
 
1,hi,iam having two objects oppurtunity(parent) and another is custom object name is TopXDesignation__c(child)  having MDR RELATIONSHIP and i want to retrieve records from parent i,e opportunity so, i wriiten soql query below
           lstopp=[select id,Name,CloseDate,StageName,(select id,name,Document_Attached__c from  TopXDesignation__r) from Opportunity];
 
but iam getting below error:
Didn't understand relationship 'aTopXDesignation__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.


2,and also iam tried follwing type query not geeting
lstopp=[select id,Name,CloseDate,StageName,(select id,TopXDesignation__c.name,TopXDesignation__c.Document_Attached__c from TopXDesignation__c.TopXDesignation__r) from Opportunity];

ERROR IS :
TopXDesignation__c.Document_Attached__c from TopXDesignation__c.TopXDesignation__r)
                                             ^
ERROR at Row:1:Column:116
Didn't understand relationship 'TopXDesignation__c' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
PLEASE ANSWER IT


   
 i am entering new values in account if phone is anything in account that must be same related contact phone and create related contact for that account.so its firing. but, after this i want to check the checkbox field in account thats not firing pls hlp me

trigger creatingcasebasedonaccounttrigger on Account (after insert) 
{
    list<schema.contact> lst = new list<schema.contact>();
    list<account> gh = new list<account>();
     list<Id> listIds = new List<Id>();
    
   //schema.accc=new schema.contact();
   if(trigger.isafter) 
   {
       if(trigger.isinsert)
       {
          for(account acc:trigger.new) 
          {
             System.debug('@@@@id is: ' + acc.Id);
            System.debug('####name is : ' + acc.Name);
            if(acc.phone !=null)
            {
            schema.contact cs = new schema.contact();
                  //cs.Account=acc.Name;
                  cs.lastname=acc.name;
                 //cs.closed Date='';
                  cs.accountid =acc.id;
                  cs.phone=acc.phone;
                  cs.contactrelaioncheckbox__c=true;
                  lst.add(cs);
          
                
              }
          }
       }
    //acc.CHECKEDACCOUNT__c=true;
     insert lst; 
      
       
 list<account> lk =[select id,name,CHECKEDACCOUNT__c from account where id in:listIds];
         for(account an:lk)
         {
             an.CHECKEDACCOUNT__c=true;
             gh.add(an);
         }
       
   }
           update gh;
         
   }

 
1,how many soql queries allowed in trigger not in apex class?
2,can we process one record in batch apex class?
Retrieving more than 100.000 records using select statement in visual force how can it possible?pls help me with exact soql query?  but soql support only 50000 rows please hlp me.
iam executing this code in anonymous block iam getting error like my requirment is only in anonumos window
Line: 35, Column: 1
System.ListException: Duplicate id in list: 00128000003LLRkAAO
OK
pls hlp me
:*the following below  is my code:*
list<account> lst1 = new list<account>();
 list<schema.contact> lst = [select id,name,account.name,account.Fax from contact where account.Fax != null];
for(schema.contact c:lst)
{
   system.debug('DISPLAY'+c.account.name); 
       system.debug('@@@@@@'+c.account.Fax);
    //Account ac = [select id,name,fax from account where id=:c.account.id];
  c.account.Fax='040-567-234';
    
   lst1.add(c.account);
}  
update lst1;
 
iam new to the batch apex.here my question is batch apex job in exeute method iam passing list of accounts i,e 50,000 record ascynchronously and only 30,000 records inserted and remaining failed so,how to recognize the filed records where you found and how to reprocess that failed records?
iam having list of account records and i want to pass in @FUTURE method is it possible or not? if not possible how can you pass the records with neat explanation i want step-wise procedure pls hlp me
iam getting  this Error: Compile Error: Variable does not exist: account at line 10 column 3

public class my
{

public void my1()
{
list<schema.contact> lst = [Select id,name,account.name,account.Phone from contact where Phone=null];

for(contact c:lst)
{
  c.account.phone='9177818131';
   update c.account;
}
}
}
i will cal above method in anonymous block
iam account and contact in account object iam having phonenumber=9999999999 and i need to update all contact mobilephone feild which are accosiated particular account i done with follwing code no error bt trigger not firing pls hlp....
trigger accountupdatetrigger on account (after update) {



    if(trigger.isafter)
    {
        if(trigger.isupdate)
        {
   list<contact> lst = new list<contact>();
            
    
  list <Account> a = [Select id,Name,phone, (Select id, Contact.FirstName,contact.LastName,contact.MobilePhone from Account.Contacts) From Account where phone ='99999999999'];
       
            
            for(Account acc1:a)
               {
                   
                 for(schema.Contact cn:acc1.Contacts)
                     
                       {
                         //  lst.add(cn);
                      // }
                           
                          // if(cn.MobilePhone!=null && cn.MobilePhone==null)
                          // {
                           cn.MobilePhone ='99999999999';
                          update cn;
                           
                           }            
                           
       }
    }
              
}
       

    }