-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
16Questions
-
20Replies
access to sobjType.getDescribe() method based on profile?
Via our managed package, users are getting a “Attempt to re-reference null object” error when access a VF page. The error references the following system method: sobjType.getDescribe(). Here is the full code:
Schema.SObjectType sobjType = gd.get('npe01__OppPayment__c');
Schema.DescribeSObjectResult r = sobjType.getDescribe();
I assumed this was due to a a lack of read access on the 'npe01__OppPayment__c' object but the error still occurs after access is provided ( as well as with full CRUD access). The error only goes away when the "Customize Application" permission is provided on the profile. Any insight if there is another permission that is appliable or why else this is occuring? We cannot provide the "Customize Application" permission.
Thanks!
-
- IC-Tanner
- August 05, 2016
- Like
- 0
- Continue reading or reply
VF re-render randomly creates error
A VF page has a command button that adds a new object record to a list and then re-renders the VF page which displays the list via an <apex;repeat> component. Everything works as expected though randomly the page re-render (button submission) fails and the 'Generic Error Page' page is displayed. The debug log doesn't show any errors. The only thing I can think of is possible the setter methods are randomly not running correctly before the page re-renders. Possibly due to javascript onComplete?
Button:
<apex:commandButton styleClass="btn" action="{!addDisbursmentEntry}" value="Add another student" reRender="frm" onComplete="toBottom()" disabled = "{!numberOfDisbursments > 9 || YearEndReportSubmitted || readOnlyUser}" />
Related Method:
public void addDisbursmentEntry()
{
Transactions__c transHolder = new Transactions__c(
School__c = accountHolder.id,
Year_End_Report__c = yearEndReport.id,
Transaction_Type__c = 'Disbursement'
);
disbursmentList.add(transHolder);
}
The page re-render is for the the '<apex:form> component which contains the repeat component:
<apex:repeat value="{!disbursmentList}" var="disbursment">
Javascript called:
<script>
function toBottom()
{
window.scrollTo(0, document.body.scrollHeight);
}
</script>
Thanks!!
-
- IC-Tanner
- July 24, 2014
- Like
- 0
- Continue reading or reply
Summary Layout Component preventing patch release
Has anyone seen a 'new component' issue before for a 'summary layout' component (for a patch version)? I'm assuming it was something added in Summer '12 as I haven't been able to determine what a 'summary layout' component is. It seems that something was added in Summer '12 that is going to force me to do a major release instead of being able to release a patch version. When I click on the links to the components, I just receive an 'Insufficient Privileges' message. My thought is that is related to the 'Highlights Panel' of Page Layouts though I thought this was added in Summer '11.
Thanks!
-
- IC-Tanner
- June 06, 2012
- Like
- 0
- Continue reading or reply
Bulk Trigger issue due to range lookup
-
- IC-Tanner
- February 01, 2011
- Like
- 0
- Continue reading or reply
chatterConnector.main System.Exception: Too many query rows: 1090
I tried to deploy a non 'Chatter' related Apex class & trigger today and received the following error fired by a the test method of the chatterConnector Class. Because the Chatter APEX classes/triggers are not part of a managed package, the chatter test methods are firing for my unrelated code. Therefore I cannot deploy, update, or delete any APEX classes/triggers which is a major issue. Salesforce, can you please update this test method or allow unpackaged classes/triggers to be deployed without calling the Chatter test methods?
Feel free to contact me directly with any database instance specific questions.
Thank you!
Related info from Debug log:
17:45:6.650|EXECUTION_STARTED
17:45:6.650|CODE_UNIT_STARTED|[EXTERNAL]chatterConnector.main
17:45:6.653|METHOD_ENTRY|[15,50]|MAP:String,String.get(String)
17:45:6.653|METHOD_ENTRY|[15,34]|System.PageReference.getparameters()
17:45:6.653|METHOD_ENTRY|[15,10]|ApexPages.currentpage()
17:45:6.653|METHOD_EXIT|[15,10]|currentPage()
17:45:6.653|METHOD_EXIT|[15,34]|getParameters()
17:45:6.653|METHOD_EXIT|[15,50]|get(ANY)
17:45:6.653|METHOD_ENTRY|[26,9]|chatterConnector.buildUserList()
17:45:6.653|SOQL_EXECUTE_BEGIN|[77,19]|Aggregations:0|select id, name, userroleid, profileid, department, state, country,
managerid, manager.name, manager.managerid, manager.manager.managerid, manager.manager.manager.managerid, manager.manager.manager.manager.managerid
from User
where id = :Userinfo.getUserId()
17:45:6.661|METHOD_ENTRY|[80,25]|Userinfo.getUserId()
17:45:6.661|METHOD_EXIT|[80,25]|getUserId()
17:45:6.671|SOQL_EXECUTE_END|[77,19]|Rows:1|Duration:18
17:45:6.672|METHOD_ENTRY|[84,23]|integer.valueof(String)
17:45:6.672|METHOD_EXIT|[84,23]|valueOf(String)
17:45:6.674|METHOD_ENTRY|[89,79]|UserInfo.getUserId()
17:45:6.674|METHOD_EXIT|[89,79]|getUserId()
17:45:6.678|METHOD_ENTRY|[137,24]|Database.query(String)
17:45:6.681|SOQL_EXECUTE_BEGIN|[137,24]|Aggregations:0|select id, name, managerid, title, city, state, department, createddate from User where isactive = true and usertype = 'Standard' and id <> '00550000000ymonAAA' limit 1000
17:45:6.685|SOQL_EXECUTE_END|[137,24]|Rows:41|Duration:4
17:45:6.685|METHOD_EXIT|[137,24]|query(String)
17:45:6.685|SOQL_EXECUTE_BEGIN|[141,45]|Aggregations:0|select id, subscriberid
from EntitySubscription
where subscriberid IN :uList
and parentid = :UserInfo.getUserId()
17:45:6.699|METHOD_ENTRY|[144,29]|UserInfo.getUserId()
17:45:6.699|METHOD_EXIT|[144,29]|getUserId()
17:45:6.710|SOQL_EXECUTE_END|[141,45]|Rows:0|Duration:25
17:45:6.711|SOQL_EXECUTE_BEGIN|[152,44]|Aggregations:0|select id, parentid
from EntitySubscription
where subscriberid = :UserInfo.getUserId()
and parentid IN :uList
17:45:6.715|METHOD_ENTRY|[154,35]|UserInfo.getUserId()
17:45:6.715|METHOD_EXIT|[154,35]|getUserId()
17:45:6.725|SOQL_EXECUTE_END|[152,44]|Rows:1|Duration:14
17:45:6.725|METHOD_ENTRY|[160,13]|SET:Id.add(Id)
17:45:6.727|METHOD_EXIT|[160,13]|add(ANY)
17:45:6.727|SOQL_EXECUTE_BEGIN|[163,45]|Aggregations:0|select subscriberid, count(id)
from EntitySubscription
where subscriberid IN :uList
group by subscriberid
order by count(id) desc
limit 200
17:45:6.733|SOQL_EXECUTE_END|[163,45]|Rows:21|Duration:6
17:45:6.733|EXCEPTION_THROWN|[163,45]|System.Exception: Too many query rows: 1090
17:45:6.733|METHOD_EXIT|[26,9]|buildUserList()
17:45:6.733|FATAL_ERROR|System.Exception: Too many query rows: 1090
-
- IC-Tanner
- May 13, 2010
- Like
- 0
- Continue reading or reply
ideas:listOutputLink component 'sort' attribute logic
Hi, I would like to create an <apex:dataTable> based on the logic of the 'sort="popular"' attribute of the 'ideas:listOutputLink' component. Because the code behind this component is not exposed, I'm unable to determine the query logic utilized for this attribute. I also have been able to determine the logic from reviewing the 'ideas' listed for the ''sort="popular"' attribute via testing. Does anyone know the query logic utilized for the 'sort' attibute and corresponding 'popular' value so that I can replicate it?
Thanks!
-
- IC-Tanner
- May 10, 2010
- Like
- 0
- Continue reading or reply
APEX trigger re-firing workflow rule
Hi, I have an APEX trigger that creates a new account record and then updates the contact record associating the contact to the new account via the 'account' lookup field (parent/child). Everything works correctly except that the contact update fires two workflows rules that have already fired and based on the evaluation criteria: "When a record is created, or when a record is edited and did not previously meet the rule criteria". The APEX trigger update does not update any of the fields referenced in the workflows' criterias. I tried to replicate the problem in the org.'s sandbox, but could not. It's as though the apex trigger update is erasing the workflow history that they workflow has already run. (logically as though trigger.old is not reference or is erased for the workflow). Has anyone experienced this issue before or has any idea of why this would be occuring besides a Salesforce bug?
Related code below:
Trigger:
trigger ConverttoHouseholdTrigger on Contact (before insert, before update) {contactHouseholdFellowship.contactHouseholdFellowshipMethod(trigger.new);
}
CLASS:
public class contactHouseholdFellowship
{
public static void contactHouseholdFellowshipMethod(contact[] contacts)
{
//Account - Build a "reversed" record type map for Account so that the record type name becomes the Key
//and the id is the Value.
Map<String, Id> AccountRecTypesRev = new Map<String, Id>();
for(RecordType rec :[select id, DeveloperName, sObjectType from RecordType
where sObjectType = 'Account']) {
AccountRecTypesRev.put(rec.DeveloperName, rec.Id); }
id HHaccRec = AccountRecTypesRev.get('Household');
list<contact>contactList = new list<contact>();
list<account>accountList = new list<account>();
set<id>contactSet = new set<id>();
map<id,id>accountMap = new map<id,id>();
map<id,id>contactMap = new map<id,id>();
for (contact c : contacts)
{
contactset.add(c.id);
}
//Contact list is necessary because we can't obtain parent 'account' field values without a SOQL query
contactList = [select id, name, firstName, LastName, account.recordtypeId, email, Do_Not_Mail__c,
HasOptedOutOfEmail,DoNotCall,HomePhone,Phone,MailingStreet,MailingCity,MailingState,MailingPostalCode,
OtherStreet,OtherCity,OtherState,OtherPostalCode,Fellowship_Status__c
from contact where id in : contactSet];
for (contact c : contactList)
{
//only if contact is not already the child of a 'Household' account and only if 'offer Accepted' as
//per current related workflow rule criteria
if (c.account.recordTypeId != HHaccRec && c.Fellowship_Status__c == 'Offer Accepted')
{
//Create map for contacts to be updated for contact.accountid update below
contactMap.put(c.id,c.id);
account account = new account();
account.name = c.firstname + ' ' + c.lastName + ' Household';
account.Addressee__c = c.firstname + ' ' + c.lastName;
account.Addressee_Informal__c = c.firstname;
account.Email__c = c.Email;
account.Do_Not_Mail__c = c.Do_Not_Mail__c;
account.Do_Not_Email__c = c.HasOptedOutOfEmail;
account.Do_Not_Call__c = c.DoNotCall;
account.recordtypeid = HHaccRec;
If (c.HomePhone != null)
{
account.phone = c.HomePhone;
}
else
{
account.phone = c.Phone;
}
account.BillingStreet = c.MailingStreet;
account.BillingCity = c.MailingCity;
account.BillingState = c.MailingState;
account.BillingPostalCode = c.MailingPostalCode;
account.ShippingStreet = c.OtherStreet;
account.ShippingCity = c.OtherCity;
account.ShippingState = c.OtherState;
account.ShippingPostalCode = c.OtherPostalCode;
//set primary contact record for household account
account.Primary_Contact__c = c.id;
accountList.add(account);
}
}
insert accountList;
//map primary contact id to account id so we can reference which account the contact
//should be updated to via the parent/child account/contact relationship
for (account a : accountList)
{
accountMap.put(a.Primary_Contact__c, a.id);
}
for (contact c: contacts)
{
//only update contacts that fit the criteria for the contactList
if (contactMap.get(c.id) != null)
{
c.accountid = accountMap.get(c.id);
}
}
}
-
- IC-Tanner
- March 22, 2010
- Like
- 0
- Continue reading or reply
incorrect link in 'Ideas' base theme
Hi, I have installed the 'ideas' base theme and everything is working correctly via Force Sites except for that the 'search community' form is calling the visualforce link instead of the sites link. For example, when I click on the magnifying glass image next to the input box, it calls '/apex/ideaSearchResults?s=' instead of the correct '/ideaSearchResults?s='. This appears to be related to the 'ideaSecondary' VF component and the 'IdeaController' class. This class has the following variable: private static final String PAGE_PREFIX = '/apex'.
Thanks,
Tanner
-
- IC-Tanner
- February 03, 2010
- Like
- 0
- Continue reading or reply
Saleforce sites as listener/handler for http POST?
Hi everyone,
Does anyone have any experience/example code with setting a sites page to function as a listener/handler for an http POST?
Thanks!
-
- IC-Tanner
- October 08, 2009
- Like
- 0
- Continue reading or reply
Campaign object doesn't appear to allow 'create' via force Sites
Hi everyone,
I have created a visualForce page that has a couple "<apex:inputField>" for the 'campaign' object. When I view the VF page directly in Salesforce, it appears correct with the input box. But when I view it via 'Sites', the input area/box is not displaying as though the fields are 'read only'. I assumed it was an issue with 'field security' and the guest user profile but the fields are set to 'editable'. I also verified that 'view' and 'create' were checked for the 'Standard Object Permissions' for the profile. I tested it with other objects and only campaigns seems to be an issue?
Here is the sites page:
http://icbeta1-developer-edition.na2.force.com/
http://icbeta1-developer-edition.na2.force.com/
Fields:
<apex:inputField id="inputValue" value="{!campaign.startDate}"/>
<apex:inputField id="inputValue2" value="{!campaign.isactive}"/>
Thanks ahead of time!
<apex:page standardcontroller="Campaign">
<apex:form >
<apex:pageBlock title="School Recruiter Events">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Event Details" columns="2">
<apex:inputField id="inputValue" value="{!campaign.startDate}"/>
<apex:inputField id="inputValue2" value="{!campaign.isactive}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
-
- IC-Tanner
- September 09, 2009
- Like
- 0
- Continue reading or reply
insert record owner/creator
Hi everyone,
Quick question. Is the owner/creator of a record via an 'insert' DML statement based on the owner of the APEX class that is creating the record? Is there anyway to specify the owner/creator explicity?
Thanks!
-
- IC-Tanner
- March 02, 2009
- Like
- 0
- Continue reading or reply
Avoiding double SOQL statement
-
- IC-Tanner
- February 26, 2009
- Like
- 0
- Continue reading or reply
Calling ConvertLead() method on "after update" trigger
The method works via a "after insert" trigger but I receive the following error trying to "after update":
Apex trigger autoLeadConvertTrigger caused an unexpected exception, contact your administrator: autoLeadConvertTrigger: execution of AfterUpdate caused by: System.DmlException: ConvertLead failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, autoLeadConvertTrigger: execution of AfterUpdate caused by: System.DmlException: ConvertLead failed. First exception on row 0; first error: CANNOT_UPDATE_CONVERTED_LEAD, cannot reference converted lead Class.autoLeadConvert.ConvertLead: line 100, column 3 Trigger.autoLeadConvertTrigger: line 14, column 7: Class.autoLeadConvert.ConvertLead: line 100, column 3
The main note of importance is the "CANNOT_UPDATE_CONVERTED_LEAD" error. The reason I'm doing an after update instead of after insert is to be able to have the workflow / auto-response rules run before conversion. (workflow / auto-response rules execute after triggers).
What I don't understand is why this is not working for the "after update" trigger. The error appears to be coming from the leadConvert method trying to update the convert lead record fields such as: setContactId, etc. This doesn't seem to make sense though as to why it would work in the 'after insert' trigger.
Here is the basics of my code:
public static void ConvertLead(lead[] leads){
for (lead l : leads){
account Account = new account();
contact Contact = new contact();
//convert lead
converter.setLeadId(l.id);
converter.setContactId(contact.id);
converter.setAccountId(account.id);
converter.setOwnerId(l.OwnerId);
LeadStatus convertStatus = [Select Id, MasterLabel from LeadStatus where IsConverted=true limit 1]; converter.setConvertedStatus(convertStatus.MasterLabel);
converter.setDoNotCreateOpportunity(true);
Database.ConvertLead(converter);
The apex documentation states the following in regards to considerations for trigger context variables:
Can update original object using an update DML operation:
Trigger Event: After Insert
"Allowed"
Trigger Event: After Update
"Allowed. Even though a bad script could cause an infinite recursion doing this incorrectly, the error would be found by the governor limits."
I know I'm not running governor limits so I'm a missing something or is this a SF bug?
Thanks ahead of time!
-
- IC-Tanner
- February 25, 2009
- Like
- 0
- Continue reading or reply
'Contains' logic expression operator?
-
- IC-Tanner
- October 27, 2008
- Like
- 0
- Continue reading or reply
Odd i.EA2x, i.Str, i.EmailAddr test coverages results

Message Edited by IC-Tanner on 10-23-2008 02:34 PM
Message Edited by IC-Tanner on 10-23-2008 02:35 PM
-
- IC-Tanner
- October 23, 2008
- Like
- 0
- Continue reading or reply
Problem accessing Close Case Page Layouts via Eclipse IDE
Thanks ahead of time!
-
- IC-Tanner
- October 21, 2008
- Like
- 0
- Continue reading or reply
Variable is not visible: error
- Tanner Wells
- April 13, 2016
- Like
- 0
- Continue reading or reply
Summary Layout Component preventing patch release
Has anyone seen a 'new component' issue before for a 'summary layout' component (for a patch version)? I'm assuming it was something added in Summer '12 as I haven't been able to determine what a 'summary layout' component is. It seems that something was added in Summer '12 that is going to force me to do a major release instead of being able to release a patch version. When I click on the links to the components, I just receive an 'Insufficient Privileges' message. My thought is that is related to the 'Highlights Panel' of Page Layouts though I thought this was added in Summer '11.
Thanks!
- IC-Tanner
- June 06, 2012
- Like
- 0
- Continue reading or reply
Bulk Trigger issue due to range lookup
- IC-Tanner
- February 01, 2011
- Like
- 0
- Continue reading or reply
chatterConnector.main System.Exception: Too many query rows: 1090
I tried to deploy a non 'Chatter' related Apex class & trigger today and received the following error fired by a the test method of the chatterConnector Class. Because the Chatter APEX classes/triggers are not part of a managed package, the chatter test methods are firing for my unrelated code. Therefore I cannot deploy, update, or delete any APEX classes/triggers which is a major issue. Salesforce, can you please update this test method or allow unpackaged classes/triggers to be deployed without calling the Chatter test methods?
Feel free to contact me directly with any database instance specific questions.
Thank you!
Related info from Debug log:
17:45:6.650|EXECUTION_STARTED
17:45:6.650|CODE_UNIT_STARTED|[EXTERNAL]chatterConnector.main
17:45:6.653|METHOD_ENTRY|[15,50]|MAP:String,String.get(String)
17:45:6.653|METHOD_ENTRY|[15,34]|System.PageReference.getparameters()
17:45:6.653|METHOD_ENTRY|[15,10]|ApexPages.currentpage()
17:45:6.653|METHOD_EXIT|[15,10]|currentPage()
17:45:6.653|METHOD_EXIT|[15,34]|getParameters()
17:45:6.653|METHOD_EXIT|[15,50]|get(ANY)
17:45:6.653|METHOD_ENTRY|[26,9]|chatterConnector.buildUserList()
17:45:6.653|SOQL_EXECUTE_BEGIN|[77,19]|Aggregations:0|select id, name, userroleid, profileid, department, state, country,
managerid, manager.name, manager.managerid, manager.manager.managerid, manager.manager.manager.managerid, manager.manager.manager.manager.managerid
from User
where id = :Userinfo.getUserId()
17:45:6.661|METHOD_ENTRY|[80,25]|Userinfo.getUserId()
17:45:6.661|METHOD_EXIT|[80,25]|getUserId()
17:45:6.671|SOQL_EXECUTE_END|[77,19]|Rows:1|Duration:18
17:45:6.672|METHOD_ENTRY|[84,23]|integer.valueof(String)
17:45:6.672|METHOD_EXIT|[84,23]|valueOf(String)
17:45:6.674|METHOD_ENTRY|[89,79]|UserInfo.getUserId()
17:45:6.674|METHOD_EXIT|[89,79]|getUserId()
17:45:6.678|METHOD_ENTRY|[137,24]|Database.query(String)
17:45:6.681|SOQL_EXECUTE_BEGIN|[137,24]|Aggregations:0|select id, name, managerid, title, city, state, department, createddate from User where isactive = true and usertype = 'Standard' and id <> '00550000000ymonAAA' limit 1000
17:45:6.685|SOQL_EXECUTE_END|[137,24]|Rows:41|Duration:4
17:45:6.685|METHOD_EXIT|[137,24]|query(String)
17:45:6.685|SOQL_EXECUTE_BEGIN|[141,45]|Aggregations:0|select id, subscriberid
from EntitySubscription
where subscriberid IN :uList
and parentid = :UserInfo.getUserId()
17:45:6.699|METHOD_ENTRY|[144,29]|UserInfo.getUserId()
17:45:6.699|METHOD_EXIT|[144,29]|getUserId()
17:45:6.710|SOQL_EXECUTE_END|[141,45]|Rows:0|Duration:25
17:45:6.711|SOQL_EXECUTE_BEGIN|[152,44]|Aggregations:0|select id, parentid
from EntitySubscription
where subscriberid = :UserInfo.getUserId()
and parentid IN :uList
17:45:6.715|METHOD_ENTRY|[154,35]|UserInfo.getUserId()
17:45:6.715|METHOD_EXIT|[154,35]|getUserId()
17:45:6.725|SOQL_EXECUTE_END|[152,44]|Rows:1|Duration:14
17:45:6.725|METHOD_ENTRY|[160,13]|SET:Id.add(Id)
17:45:6.727|METHOD_EXIT|[160,13]|add(ANY)
17:45:6.727|SOQL_EXECUTE_BEGIN|[163,45]|Aggregations:0|select subscriberid, count(id)
from EntitySubscription
where subscriberid IN :uList
group by subscriberid
order by count(id) desc
limit 200
17:45:6.733|SOQL_EXECUTE_END|[163,45]|Rows:21|Duration:6
17:45:6.733|EXCEPTION_THROWN|[163,45]|System.Exception: Too many query rows: 1090
17:45:6.733|METHOD_EXIT|[26,9]|buildUserList()
17:45:6.733|FATAL_ERROR|System.Exception: Too many query rows: 1090
- IC-Tanner
- May 13, 2010
- Like
- 0
- Continue reading or reply
ideas:listOutputLink component 'sort' attribute logic
Hi, I would like to create an <apex:dataTable> based on the logic of the 'sort="popular"' attribute of the 'ideas:listOutputLink' component. Because the code behind this component is not exposed, I'm unable to determine the query logic utilized for this attribute. I also have been able to determine the logic from reviewing the 'ideas' listed for the ''sort="popular"' attribute via testing. Does anyone know the query logic utilized for the 'sort' attibute and corresponding 'popular' value so that I can replicate it?
Thanks!
- IC-Tanner
- May 10, 2010
- Like
- 0
- Continue reading or reply
Case Apex trigger deployment being affected by recent install of Chatter apps
Today I was trying to deploy a small Apex Trigger from my sandbox to production. Here is the code:
trigger commentMove on Case (after update) { Case myCase = trigger.new[0]; if (myCase.Last_email__c!= null) { String caseId= myCase.ID; CaseComment cc = new CaseComment(CommentBody=myCase.Last_email__c,parentID=caseId); insert cc; } }
However I got a failed deployment and when I looked at it what failed was:
chatterFollowLists.testFollowAllRule() | Class | 181 | 6 | Failure Message: "System.Exception: Assertion Failed: Expected: 0, Actual: 1", Failure Stack Trace: "Class.chatterFollowLists.testFollowAllRule: line 181, column 6 External entry point" |
chatterFollowRules.testFollowEveryone() | Class | 650 | 55 |
Failure Message: "System.Exception: Too many query rows: 501", Failure Stack Trace: "Class.chatterFollowRules.testFollowEveryone: line 650, column 55 External entry point" |
I installed the Chatter Follow From List View yesterday. Why would this be failing my Case Apex trigger?
- MATTYBME
- April 08, 2010
- Like
- 0
- Continue reading or reply
How to show gif spinner while doing something on vforce page
Hi,
I would like to be able to show a gif spinner on my visual force page as I am doing something on the background like loading data or waiting for data to come back before I update the page.
It will be ideal if I can replace apex:tags with a stylesheet that will be turned off or on based on user click.
Does anyone have a good solution for that I ma not very ajax savvy per say so any ideas will be appreciated.
Thank you.
- kminev
- October 16, 2009
- Like
- 0
- Continue reading or reply
Saleforce sites as listener/handler for http POST?
Hi everyone,
Does anyone have any experience/example code with setting a sites page to function as a listener/handler for an http POST?
Thanks!
- IC-Tanner
- October 08, 2009
- Like
- 0
- Continue reading or reply
Campaign object doesn't appear to allow 'create' via force Sites
Hi everyone,
I have created a visualForce page that has a couple "<apex:inputField>" for the 'campaign' object. When I view the VF page directly in Salesforce, it appears correct with the input box. But when I view it via 'Sites', the input area/box is not displaying as though the fields are 'read only'. I assumed it was an issue with 'field security' and the guest user profile but the fields are set to 'editable'. I also verified that 'view' and 'create' were checked for the 'Standard Object Permissions' for the profile. I tested it with other objects and only campaigns seems to be an issue?
Here is the sites page:
http://icbeta1-developer-edition.na2.force.com/
http://icbeta1-developer-edition.na2.force.com/
Fields:
<apex:inputField id="inputValue" value="{!campaign.startDate}"/>
<apex:inputField id="inputValue2" value="{!campaign.isactive}"/>
Thanks ahead of time!
<apex:page standardcontroller="Campaign">
<apex:form >
<apex:pageBlock title="School Recruiter Events">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Event Details" columns="2">
<apex:inputField id="inputValue" value="{!campaign.startDate}"/>
<apex:inputField id="inputValue2" value="{!campaign.isactive}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
- IC-Tanner
- September 09, 2009
- Like
- 0
- Continue reading or reply
Custom Lookup Page Layout
- OrynThornwall
- April 17, 2009
- Like
- 0
- Continue reading or reply
Sites, Flex, and Web API
I am attempting to build a site with a Flex .swf in it that is accessing the database via the Flash Connection object provided in your .swc file. Do I need to call apex.login(new LoginRequest... and if so, what ID and password do I use?
Assuming this is anonymous access, is there a way to use the .swc file you provide without logging in? Or is access to the database impossible via this mechanism for sites?
Thanks!
Dave
- dfc
- March 27, 2009
- Like
- 0
- Continue reading or reply
Avoiding double SOQL statement
- IC-Tanner
- February 26, 2009
- Like
- 0
- Continue reading or reply
Calling ConvertLead() method on "after update" trigger
The method works via a "after insert" trigger but I receive the following error trying to "after update":
Apex trigger autoLeadConvertTrigger caused an unexpected exception, contact your administrator: autoLeadConvertTrigger: execution of AfterUpdate caused by: System.DmlException: ConvertLead failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, autoLeadConvertTrigger: execution of AfterUpdate caused by: System.DmlException: ConvertLead failed. First exception on row 0; first error: CANNOT_UPDATE_CONVERTED_LEAD, cannot reference converted lead Class.autoLeadConvert.ConvertLead: line 100, column 3 Trigger.autoLeadConvertTrigger: line 14, column 7: Class.autoLeadConvert.ConvertLead: line 100, column 3
The main note of importance is the "CANNOT_UPDATE_CONVERTED_LEAD" error. The reason I'm doing an after update instead of after insert is to be able to have the workflow / auto-response rules run before conversion. (workflow / auto-response rules execute after triggers).
What I don't understand is why this is not working for the "after update" trigger. The error appears to be coming from the leadConvert method trying to update the convert lead record fields such as: setContactId, etc. This doesn't seem to make sense though as to why it would work in the 'after insert' trigger.
Here is the basics of my code:
public static void ConvertLead(lead[] leads){
for (lead l : leads){
account Account = new account();
contact Contact = new contact();
//convert lead
converter.setLeadId(l.id);
converter.setContactId(contact.id);
converter.setAccountId(account.id);
converter.setOwnerId(l.OwnerId);
LeadStatus convertStatus = [Select Id, MasterLabel from LeadStatus where IsConverted=true limit 1]; converter.setConvertedStatus(convertStatus.MasterLabel);
converter.setDoNotCreateOpportunity(true);
Database.ConvertLead(converter);
The apex documentation states the following in regards to considerations for trigger context variables:
Can update original object using an update DML operation:
Trigger Event: After Insert
"Allowed"
Trigger Event: After Update
"Allowed. Even though a bad script could cause an infinite recursion doing this incorrectly, the error would be found by the governor limits."
I know I'm not running governor limits so I'm a missing something or is this a SF bug?
Thanks ahead of time!
- IC-Tanner
- February 25, 2009
- Like
- 0
- Continue reading or reply
List button on Opportunity related lists on Contact & Account
I'm trying to write a very simple list button to update Opportunities from the Opportunity related lists on contact and account. I'd like to be able to check off a few opportunity records and then click a button to change them as Closed Won or Closed Lost. Ideally, I'd like the extension to just perform the action without having to confirm/save the records on a separate VF page. In other words, all I need a VF page to do is execute the action and return the user to the contact or account record from which he/she started. Here's what I've got so far:
Visualforce page:
<apex:page standardController="Opportunity" recordSetVar="opportunities" extensions="ONEN_EXT_UpdateOpportunities" action="{!MarkAsWon}"> </apex:page>
And the extension:
public class ONEN_EXT_UpdateOpportunities { public List<Opportunity> selectedOpps = new List<Opportunity>(); public ONEN_EXT_UpdateOpportunities(ApexPages.StandardSetController controller) { this.selectedOpps = (list<Opportunity>)controller.getRecords(); } public pageReference MarkAsWon() { List<Opportunity> OppsToUpdate = new List<Opportunity>(); for (Opportunity newOpp : selectedOpps) { newOpp = new Opportunity ( id = newOpp.id, StageName = 'Won Not Thanked' ); OppsToUpdate.add(newOpp); } if (OppsToUpdate.size() > 0) { update OppsToUpdate; } PageReference p = new PageReference('/' + ApexPages.currentPage().getParameters().get('id'));
p.setRedirect(true);
return p; } }
I just don't know how to retrieve/set/manipulate the selected records in my extension. Any guidance would be greatly appreciated.
Dave
Message Edited by DManelski on 12-19-2008 08:32 AM
- DManelski
- December 19, 2008
- Like
- 0
- Continue reading or reply
'Contains' logic expression operator?
- IC-Tanner
- October 27, 2008
- Like
- 0
- Continue reading or reply
Problem accessing Close Case Page Layouts via Eclipse IDE
Thanks ahead of time!
- IC-Tanner
- October 21, 2008
- Like
- 0
- Continue reading or reply
MetaData API Bug - Code coverage of unrelated code prevents deploy of pages and static resources
So, as the final step in our app's install process (after the packageable stuff has been deployed), we use the metadata API to deploy pages and static resources. We use the declarative metadata calls to deploy zip files, to be precise.
The expected behavior is that this would work fine - the zip file contains no code at all, so code coverage isn't a concern. The packages should just upload & deploy.
However, we have run into a bug - Salesforce runs the tests for *all* unpackaged code - including things that aren't in the zipfile, and are totally unrelated to our application - and uses the results from those to prevent our deploy from succeeding.
As an example, we deploy a package of static resources. These are just static files - no code, no tests, just files.
When we deploy those static resources into an org that has downloaded other unmanaged code (in our case, a piece of sample code from Salesforce labs), the deploy call fails because Salesforce runs the tests in that other, unrelated unmanaged code and then declares that our code coverage statistics aren't good enough. Which doesn't really make sense because we're only deploying some gifs and stylesheets!
I've played with the various "deployOptions" settings but none of them help. Apparently Salesforce says "hmm, you're deploying unmanaged code. I guess I'll test all the *other* unmanaged code, and if it doesn't have good enough code coverage, I'll prevent *your* deploy from succeeding."
Here is the final error output in parse format. I can post the XML too if anyone wants it:
deploy failed: { id => "04s600000004JHKAA2", messages => { changed => "true", created => "false", deleted => "false", fileName => "resources/package.xml", fullName => "package.xml", success => "true", }, runTestResult => { codeCoverage => { dmlInfo => { column => 9, line => 66, numExecutions => 1, "time" => "0.0" }, id => "01p6000000001fPAAQ", locationsNotCovered => { column => 9, line => 70, numExecutions => -1, "time" => "-1.0" }, methodInfo => { column => 37, line => 3, numExecutions => 2, "time" => "179.0" }, name => "unsubscribe", namespace => undef, numLocations => 28, "numLocationsNotCovered" => 4, soqlInfo => { column => 20, line => 53, numExecutions => 1, "time" => "0.0" }, type => "Class", }, codeCoverageWarnings => { id => "01p700000000GCuAAM", message => "Average test coverage across all Apex Classes and Triggers is 15%,
at least 75% test coverage is required", name => undef, namespace => undef, }, numFailures => 0, numTestsRun => 2, successes => { id => "01p6000000001fPAAQ", methodName => "testUnsubscribe", name => "unsubscribe", namespace => undef, "time" => "4.6454630156326666E18", }, totalTime => "955.0", }, success => "false", }
- jhart
- July 02, 2008
- Like
- 0
- Continue reading or reply
ConvertLead doesn't work in ApexCode or with the Flex API.
LeadConvert isn’t
considered a valid class in Apex Code. Database.ConvertLead was released
with Winter ’08 but using that call requires you pass in a single LeadConvert
object or an array of LeadConvert objects but the compiler doesn’t recognize
the class. I’ve verified that I’m compiling it using the 11.1 URL.
Here’s sample Flex code that’s failing, along with the error message:
Error:
Message:
valid leadId is required
statusCode:
INVALID_CROSS_REFERENCE_KEY
Code:
private function convertSingleLead( leadId:String, accountId:String, contactId:String, ownerId:String ):void { var converter:LeadConvert = new LeadConvert; converter.accountId = accountId; converter.contactId = contactId; converter.doNotCreateOpportunity = true; converter.overwriteLeadSource = true; converter.convertedStatus = “Closed – Converted”; converter.ownerId = ownerId; converter.leadId = leadId; apex.convertLead( new Array( converter ), new AsyncResponder( postConversion, sfdcCallFailed ) ); }
Thanks,
- EJW
- January 29, 2008
- Like
- 0
- Continue reading or reply