-
ChatterFeed
-
0Best Answers
-
1Likes Received
-
0Likes Given
-
4Questions
-
21Replies
"Too many query rows: 500001" on list?
How can I add a filter to this code to prevent this error message?
public with sharing class ApexClassHomeWork
{
public List<Account> accs {get; set;}
// retrieves the list of accounts backing the page
public ApexClassHomeWork()
{
accs=[select id, Name, BillingStreet, BillingCity, BillingPostalCode FROM Account WHERE Name LIKE 'Test%' LIMIT 10];
}
public void createContact(Id acctId)
{
list<contact>contList = newlist<contact>();
for(Integer i=0; i<500; i++)
{
Contact c = new Contact(AccountId=acctId, "last name");
contList.add(c);
}
if(contList.size()>0)
update contList;
}
}
public with sharing class ApexClassHomeWork
{
public List<Account> accs {get; set;}
// retrieves the list of accounts backing the page
public ApexClassHomeWork()
{
accs=[select id, Name, BillingStreet, BillingCity, BillingPostalCode FROM Account WHERE Name LIKE 'Test%' LIMIT 10];
}
public void createContact(Id acctId)
{
list<contact>contList = newlist<contact>();
for(Integer i=0; i<500; i++)
{
Contact c = new Contact(AccountId=acctId, "last name");
contList.add(c);
}
if(contList.size()>0)
update contList;
}
}
- Luciano Castro 2018
- January 25, 2018
- Like
- 0
- Continue reading or reply
Systems Error - Please help
Hi Team,
I have the following code which is bringing me headaches :)
public with sharing class ApexClassHomeWork
{
public List<Account> accs {get; set;}
// retrieves the list of accounts backing the page
public ApexClassHomeWork()
{
accs=[select id, Name, BillingStreet, BillingCity, BillingPostalCode FROM Account WHERE Name LIKE 'Test%' LIMIT 10];
}
public void createContact(Id acctId)
{
for(Integer i=0; i<500; i++)
{
Contact c = new Contact(AccountId=acctId);
insert c;
}
}
}
When calling the method "create contact", I get these errors messages:
1. "LastName is required" - What do I need to update to resolve this issue?
2. "Too Many DML Statements 151"
3. "Too many query rows: 500001"
Please help !!
I have the following code which is bringing me headaches :)
public with sharing class ApexClassHomeWork
{
public List<Account> accs {get; set;}
// retrieves the list of accounts backing the page
public ApexClassHomeWork()
{
accs=[select id, Name, BillingStreet, BillingCity, BillingPostalCode FROM Account WHERE Name LIKE 'Test%' LIMIT 10];
}
public void createContact(Id acctId)
{
for(Integer i=0; i<500; i++)
{
Contact c = new Contact(AccountId=acctId);
insert c;
}
}
}
When calling the method "create contact", I get these errors messages:
1. "LastName is required" - What do I need to update to resolve this issue?
2. "Too Many DML Statements 151"
3. "Too many query rows: 500001"
Please help !!
- Luciano Castro 2018
- January 25, 2018
- Like
- 0
- Continue reading or reply
How to change products from one pricebook to another.
How can I transfer one product from one pricebook to another?
I would like to know what are the impacts on the closed opportunities if I change the pricebook.
For example: we have this product called Revenue ( Schedule Revenue) from pricebook A .
I need to move that product to Pricebook B but do you know if the schedule revenue will carry over?
I would like to know what are the impacts on the closed opportunities if I change the pricebook.
For example: we have this product called Revenue ( Schedule Revenue) from pricebook A .
I need to move that product to Pricebook B but do you know if the schedule revenue will carry over?
- Luciano Castro 2018
- May 26, 2016
- Like
- 0
- Continue reading or reply
Validation Rule on lookup based on a multi-select
I am trying to create a validation rule to enforce users to fill out a lookup field based on a multi-select. Here is the trick
Multi-Select has 3 options(A,B,C) and we have 3 different lookups called A,B,C
If I select A from the picklist then I have to fill out lookup A
If I select B then fill out lookup B
If I select C then fill out lookup C
However,
if I select A,B fill out lookup A,B
if I select A,C - then lookup A, C
if I select B,C - then lookup B,C
Any thoughts how I can write this validation?
Multi-Select has 3 options(A,B,C) and we have 3 different lookups called A,B,C
If I select A from the picklist then I have to fill out lookup A
If I select B then fill out lookup B
If I select C then fill out lookup C
However,
if I select A,B fill out lookup A,B
if I select A,C - then lookup A, C
if I select B,C - then lookup B,C
Any thoughts how I can write this validation?
- Luciano Castro 2018
- March 25, 2016
- Like
- 1
- Continue reading or reply
Validation Rule on lookup based on a multi-select
I am trying to create a validation rule to enforce users to fill out a lookup field based on a multi-select. Here is the trick
Multi-Select has 3 options(A,B,C) and we have 3 different lookups called A,B,C
If I select A from the picklist then I have to fill out lookup A
If I select B then fill out lookup B
If I select C then fill out lookup C
However,
if I select A,B fill out lookup A,B
if I select A,C - then lookup A, C
if I select B,C - then lookup B,C
Any thoughts how I can write this validation?
Multi-Select has 3 options(A,B,C) and we have 3 different lookups called A,B,C
If I select A from the picklist then I have to fill out lookup A
If I select B then fill out lookup B
If I select C then fill out lookup C
However,
if I select A,B fill out lookup A,B
if I select A,C - then lookup A, C
if I select B,C - then lookup B,C
Any thoughts how I can write this validation?
- Luciano Castro 2018
- March 25, 2016
- Like
- 1
- Continue reading or reply
"Too many query rows: 500001" on list?
How can I add a filter to this code to prevent this error message?
public with sharing class ApexClassHomeWork
{
public List<Account> accs {get; set;}
// retrieves the list of accounts backing the page
public ApexClassHomeWork()
{
accs=[select id, Name, BillingStreet, BillingCity, BillingPostalCode FROM Account WHERE Name LIKE 'Test%' LIMIT 10];
}
public void createContact(Id acctId)
{
list<contact>contList = newlist<contact>();
for(Integer i=0; i<500; i++)
{
Contact c = new Contact(AccountId=acctId, "last name");
contList.add(c);
}
if(contList.size()>0)
update contList;
}
}
public with sharing class ApexClassHomeWork
{
public List<Account> accs {get; set;}
// retrieves the list of accounts backing the page
public ApexClassHomeWork()
{
accs=[select id, Name, BillingStreet, BillingCity, BillingPostalCode FROM Account WHERE Name LIKE 'Test%' LIMIT 10];
}
public void createContact(Id acctId)
{
list<contact>contList = newlist<contact>();
for(Integer i=0; i<500; i++)
{
Contact c = new Contact(AccountId=acctId, "last name");
contList.add(c);
}
if(contList.size()>0)
update contList;
}
}
- Luciano Castro 2018
- January 25, 2018
- Like
- 0
- Continue reading or reply
Systems Error - Please help
Hi Team,
I have the following code which is bringing me headaches :)
public with sharing class ApexClassHomeWork
{
public List<Account> accs {get; set;}
// retrieves the list of accounts backing the page
public ApexClassHomeWork()
{
accs=[select id, Name, BillingStreet, BillingCity, BillingPostalCode FROM Account WHERE Name LIKE 'Test%' LIMIT 10];
}
public void createContact(Id acctId)
{
for(Integer i=0; i<500; i++)
{
Contact c = new Contact(AccountId=acctId);
insert c;
}
}
}
When calling the method "create contact", I get these errors messages:
1. "LastName is required" - What do I need to update to resolve this issue?
2. "Too Many DML Statements 151"
3. "Too many query rows: 500001"
Please help !!
I have the following code which is bringing me headaches :)
public with sharing class ApexClassHomeWork
{
public List<Account> accs {get; set;}
// retrieves the list of accounts backing the page
public ApexClassHomeWork()
{
accs=[select id, Name, BillingStreet, BillingCity, BillingPostalCode FROM Account WHERE Name LIKE 'Test%' LIMIT 10];
}
public void createContact(Id acctId)
{
for(Integer i=0; i<500; i++)
{
Contact c = new Contact(AccountId=acctId);
insert c;
}
}
}
When calling the method "create contact", I get these errors messages:
1. "LastName is required" - What do I need to update to resolve this issue?
2. "Too Many DML Statements 151"
3. "Too many query rows: 500001"
Please help !!
- Luciano Castro 2018
- January 25, 2018
- Like
- 0
- Continue reading or reply
Validation Rule on lookup based on a multi-select
I am trying to create a validation rule to enforce users to fill out a lookup field based on a multi-select. Here is the trick
Multi-Select has 3 options(A,B,C) and we have 3 different lookups called A,B,C
If I select A from the picklist then I have to fill out lookup A
If I select B then fill out lookup B
If I select C then fill out lookup C
However,
if I select A,B fill out lookup A,B
if I select A,C - then lookup A, C
if I select B,C - then lookup B,C
Any thoughts how I can write this validation?
Multi-Select has 3 options(A,B,C) and we have 3 different lookups called A,B,C
If I select A from the picklist then I have to fill out lookup A
If I select B then fill out lookup B
If I select C then fill out lookup C
However,
if I select A,B fill out lookup A,B
if I select A,C - then lookup A, C
if I select B,C - then lookup B,C
Any thoughts how I can write this validation?
- Luciano Castro 2018
- March 25, 2016
- Like
- 1
- Continue reading or reply