• Onki
  • NEWBIE
  • 29 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 20
    Replies

Hi,

 

public void groupAdminEngineBatch(Set<Id> AccountId)
     {    
      List<Contact> contactsList = new List<Contact>([Select Id from Contact where AccountId in : AccountId]);
      for(Contact C : contactsList )
      {
       ContactId.add(C.Id);  
      }
     Query= 'Select Id from user where ContactId  in  '+ContactId+'';
    Database.Query(query);
}

This is Error I got in system debug.

09:43:57.047 (47263000)|SYSTEM_METHOD_ENTRY|[27]|System.debug(ANY)
09:43:57.047 (47309000)|USER_DEBUG|[27]|DEBUG|>>> Test >>>>>> Select Id from user where ContactId  in  (0038000000fVQIUAA4, 0038000000fVRloAAG, 0038000000fVQw3AAG, 0038000000fVQw4AAG, 0038000000fVQw5AAG, 0038000000fVQw6AAG, 0038000000fVRlpAAG, 0038000000fVRlqAAG, 0038000000fVRlrAAG, 0038000000fVSNUAA4, ...) ------ this is Last string created by sfdc if colleaction string is more than 255.
09:43:57.047 (47320000)|SYSTEM_METHOD_EXIT|[27]|System.debug(ANY)
09:43:57.047 (47341000)|SYSTEM_METHOD_ENTRY|[28]|Database.getQueryLocator(String)
09:43:57.047 (47527000)|EXCEPTION_THROWN|[28]|System.QueryException: expecting a right parentheses, found 'fVQIUAA4'
09:43:57.047 (47575000)|SYSTEM_METHOD_EXIT|[28]|Database.getQueryLocator(String)
09:43:57.047 (47645000)|FATAL_ERROR|System.QueryException: expecting a right parentheses, found 'fVQIUAA4'

Seems Query is fine but error is unexpected.


I am getting error seems like dynamic Query not support the IN parameter,if Collection of ID is more than 255.

  • November 21, 2011
  • Like
  • 0

Hi

 

I need to give contect acess for user or group by using apex. How we will do this? Is salesforce expose content related object in apex.

 

 

 

 

  • November 10, 2011
  • Like
  • 0

 

Error:Apex trigger Lead caused an unexpected exception, contact your administrator: Lead: execution of BeforeUpdate caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. Even if a field is indexed a filter might still not be selective when: 1. The filter value includes null (for instance binding with a list that contains null) 2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times): Class.LeadPopulateExistingRelatedObjectFlags.populateFlags: line 71, column 14

 

set<String> T = new Set<String>();

             T.add(test.com');

            

             for(Lead leadObj : [select id,email from lead where isConverted=false and  email_domain__c in : T and Id not in : currnetLeadId  limit 100])

             {      

                  emailLeadMap.put(leadObj.email,true);   

             }

and  email_domain__c Is formula filed for testing I am passing single value using T. In my system only 2 records with “test.com”.

 

Anyone can help me why this error is coming if record is only 2.

  • July 07, 2011
  • Like
  • 0

 Hi I am trying to excute this SOSLbutit will give error.

 

       String searchquery='FIND \'KS*\' IN billingstate  FIELDS RETURNING Account(id,Name,billingstate)';
       List<List<SObject>> searchList=search.query(searchquery);
     
        Accounts  = ((List<Account>)searchList[0]);

 

ERROR : 

 

System.Exception: Invalid IN fields group: billingstate

Class.customSearchcls.Search1: line 23, column 39 External entry point

 

But its working fine with Name.

 

  • November 11, 2009
  • Like
  • 0

Hi

 

How can i pass selected checkbox value from one page to other page using wizard. 

  • August 17, 2009
  • Like
  • 0

Hi

 

Can any one help me to how can we count the repeat counter.I want display sequeance number when display data using repeat.

  • July 21, 2009
  • Like
  • 0

Please Helpe to solve this

 

I want access Trigger value with dynamic Name

 

Trigger.New[0].Name -  It will return Name value

 

i need these thing like

 

string Name1 = 'Name';

 

Trigger.New[0].Name1 ---- I want do this way

 

 

can any one help to do this or this will not possible?

 

 

 

 

 

  • July 14, 2009
  • Like
  • 0

Hi,

 

public void groupAdminEngineBatch(Set<Id> AccountId)
     {    
      List<Contact> contactsList = new List<Contact>([Select Id from Contact where AccountId in : AccountId]);
      for(Contact C : contactsList )
      {
       ContactId.add(C.Id);  
      }
     Query= 'Select Id from user where ContactId  in  '+ContactId+'';
    Database.Query(query);
}

This is Error I got in system debug.

09:43:57.047 (47263000)|SYSTEM_METHOD_ENTRY|[27]|System.debug(ANY)
09:43:57.047 (47309000)|USER_DEBUG|[27]|DEBUG|>>> Test >>>>>> Select Id from user where ContactId  in  (0038000000fVQIUAA4, 0038000000fVRloAAG, 0038000000fVQw3AAG, 0038000000fVQw4AAG, 0038000000fVQw5AAG, 0038000000fVQw6AAG, 0038000000fVRlpAAG, 0038000000fVRlqAAG, 0038000000fVRlrAAG, 0038000000fVSNUAA4, ...) ------ this is Last string created by sfdc if colleaction string is more than 255.
09:43:57.047 (47320000)|SYSTEM_METHOD_EXIT|[27]|System.debug(ANY)
09:43:57.047 (47341000)|SYSTEM_METHOD_ENTRY|[28]|Database.getQueryLocator(String)
09:43:57.047 (47527000)|EXCEPTION_THROWN|[28]|System.QueryException: expecting a right parentheses, found 'fVQIUAA4'
09:43:57.047 (47575000)|SYSTEM_METHOD_EXIT|[28]|Database.getQueryLocator(String)
09:43:57.047 (47645000)|FATAL_ERROR|System.QueryException: expecting a right parentheses, found 'fVQIUAA4'

Seems Query is fine but error is unexpected.


I am getting error seems like dynamic Query not support the IN parameter,if Collection of ID is more than 255.

  • November 21, 2011
  • Like
  • 0

Hi

 

I need to give contect acess for user or group by using apex. How we will do this? Is salesforce expose content related object in apex.

 

 

 

 

  • November 10, 2011
  • Like
  • 0

Currently my related list shows 3 lines of a custom "Comment" field. I would like it to show more or all of the lines. Is this possible?

 

thanks,

Paul

Hi,

When I was checking the 'Account Name' field in Contact Object it is appearing as a 'Lookup(Account)'.But when I am deleting Account record it is deleting Contact record also means it is behaving like a Master-Detail relationship.

I observed same behaviour with Opportunity and Accounts.

Kindly let me know which type of relationship is there between Standard Objects.

 

Thanks,

Eswar.

I have a try/catch block around my System.schedule method (for scheduling) but the UnexpectedException that I keep getting doesn't seem to get caught. I've also tried catching jus the generic Exception but still nothing.

 

Any ideas?

On a VF page, I have a pageBlockTable.  There are times where there are more than 1000 records in the collection to be rendered.  When this occurs, the Visualforce collection limit of 1000 is hit and the page doesn't load.  I need to figure out a creative solution for getting around this.  In the end...

 

  1. I need all records to render on the page. If I do any pagination, it'll happen client-side after the records are loaded in the HTML.  I know the first responses to this will be about whether I really need to have all those records on the page and how there is doubt about whether I need to, but for the purposes of this forum post, please work with me here.
  2. I want to keep the look and feel of a pageBlockTable if possible.

 

When not using pageBlockTables, I have used a construct similar to the following to get through a collection of more than 1000 items.

 

<apex:repeat value="{!myCollection}" var="item" rows="1000" first="0">
{!item.text}
</apex:repeat>
<apex:repeat value="{!myCollection}" var="item" rows="1000" first="1000">
{!item.text}
</apex:repeat>
<apex:repeat value="{!myCollection}" var="item" rows="1000" first="2000">
{!item.text}
</apex:repeat>

 

pageBlockTable has the rows and first parameters, but if I do that, I'd be getting a new pageBlockTable everytime.

 

The options I can think of are:

 

  • Get a creative solution from the forums to actually utilize the pageBlockTable (purpose of this post)
  • Use apex:dataTable and try to use style classes to mimix the pageBlockTable look and feel. This is a nice possibility I haven't tried yet.
  • Use apex:repeat tags and make up my own HTML styling

 

Any help is appreciated.

 

 

  • September 13, 2010
  • Like
  • 0

Hi, I need help in developing a custom formula field that calculates the Age from a given date, in terms of years and months, like this:

 

MyDate: 18/05/1990  (dd/mm/yyyy)

 

Calculated Age: 19 year(s), 11 month(s)

 

I have tried several formulas, but I only could get the year and I got problems with the months calculation.

 

Could someone help with this?

 

Regards,

 

Wilmer

Hi all,
 
I am new to Apex programming and am getting weird little error when i try to attach a PDF to Notes and Attachments.  I'm rendering a Visualforce page as a PDF, with an extension to an "EstimateProposal" Apex class.  The project compiles fine, but when I run it in the UI, I get an error "EXCEPTION_THROWN|[70,24]|System.VisualforceException: Too many nested getContent calls."  Funny thing is, the code block works when I execute it anonymously, just not it's part of my VF controller execution flow.  Anyone seen this before or could point me to a resource to fix it?  Any help would be greatly appreciated!
 
****APEX CLASS**** 
    public PageReference attachQuote() {
        PageReference pdfPage = Page.GenerateProposal;
        pdfPage.getParameters().put('id',this.opp.Id);
        Blob pdfBlob = pdfPage.getContent(); 
        Attachment proposalPDF = new Attachment (parentId = this.opp.Id, name=this.opp.name + '.pdf', body = pdfBlob);
        insert proposalPDF;
        return null;  
    } 
}
 

 
****VISUAL FORCE PAGE****
<apex:page standardController="Opportunity" extensions="EstimateProposal" renderAs="pdf" showHeader="false" sidebar="false" >
  • March 31, 2010
  • Like
  • 0

Is there any method in Apex which allows to move a selected opportunity to next stage.

 

Something like

opportunity o = [Select Id from Opportunity where Id ='asdsdasd' limit 1]; o.StageName = o.nextStage(); update o;

 

Hi

 

Can any one help me to how can we count the repeat counter.I want display sequeance number when display data using repeat.

  • July 21, 2009
  • Like
  • 0

Please Helpe to solve this

 

I want access Trigger value with dynamic Name

 

Trigger.New[0].Name -  It will return Name value

 

i need these thing like

 

string Name1 = 'Name';

 

Trigger.New[0].Name1 ---- I want do this way

 

 

can any one help to do this or this will not possible?

 

 

 

 

 

  • July 14, 2009
  • Like
  • 0

Hello all.

 

This is the most simple example of something I'm trying (and failing) to achieve with triggers:

 

 

trigger AccountOriginalName on Contact (before insert) { for (Contact c : Trigger.new){ c.Account_Original_Name__c = c.Account.Name; } }

 

So, when an contact is created, a field on the contact is populated with the name of the associated account. Except it isn't - it comes out null. Why's that, then?

 

Thanks

 

 

Hi Guys,

 

I wrote an 'after insert, after update' trigger on Opportunity, which updates a field(say, A) in Opportunity depending on the value of another field(say, B)  on Opportunity. Now when I convert a lead, the opportunity gets created but the value of A doesn't update, though the value of B is flowing from Lead itself ie B is populated but the trigger doesn't fire resulting in no population of A.

 

Could anyone of you help me overcome this?

 

Thanks 

  • July 09, 2009
  • Like
  • 0

There are a few required fields in both standard objects and custom objects that I would like to pre-populate when they are created so that the user doesn't feel compelled to fill them in (since they are required).  What I'm talking about is having the data in the field box before the user clicks "save".  I know I can do this after the user clicks "save" (and that is what I'm already doing), but I want the fields filled as soon as the user sees the blank form.

 

Alternatively, is there a way I can make an exception to hide required fields that a trigger will populate before insert?

I'm new to Apex, so I hope there is a simple answer here. I've got a class with two methods that I'm trying to pass the trigger.new results to from two different triggers respectively.  I think I'm doing the same thing with both triggers and methods, but one trigger works fine and the other has a save error "Method does not exist or incorrect signature: closeOpportunity.insertNewProperty(LIST:SOBJECT: Opportunity)". Here is the basic declaration for the class (I've removed the guts for simplicity): 

 

public with sharing classcloseOpportunity {

      public static voidcheckAcceptedOffers(Opportunity[] opps){

      }

     

      public static voidinsertNewProperty(Opportunity[] opps){

      }

} 

Here are the two triggers respectively:

This one works:

 triggercheckOpportunityForClose on Opportunity (before insert, before update) {

      Opportunity[] opps = trigger.new;

      closeOpportunity.checkAcceptedOffers(opps);

}

 

This one does not work: 

 triggergenerateNewProperty on Opportunity (after insert, after update) {

      Opportunity[] opps = trigger.new;

      closeOpportunity.insertNewProperty(opps);

}

 

I was trying to do all of the processing at the class method level, so I was just passing the entire list to the class.  If this is bad practice, let me know.  If I'm passing the list the wrong way, please let me know what the correct way is. Why does one work an the other not work? Thanks in advance.