• NuDev
  • NEWBIE
  • 75 Points
  • Member since 2011

  • Chatter
    Feed
  • 3
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 21
    Replies

Hi,

Is there a way I can disable/precent a trigger from firing if the trigger comes from a managed application?

 

The problem is that I have a managed package which has been released. There is a trigger which is useful to some cutomers and not useful to other and I need a way to disable it from those who do not want it.

 

Thanks,

Kos

We have a custom app set up on our system with the customer objects Training Events and Enrolments.  An enrolment links an Opportunity to a Contact and the training event and appears as a related list on the training event.  I have created a few VF pages with Enrolment as the standard controller which are accessed via a custom button on the related list on Training Event page. 

 

The idea is that relevant enrolments are selected and when the VF page is access they can all be edited in one go and the changes saved.  IN the last few weeks I am continually receiving the following error message when I click save:

 

An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using salesforce.com!

Error ID: 166244247-41322 (-259332223)

 

This has only started happening recently (around the time Spring 12 was released to our Sandbox) and SFDC seem to be unable to support as is it a developer issue.  The code has not been altered at all and still works perfectly in production.  Does anyone know if there could be something in Spring 12 whcih is causing this?

 

The basic code for the pages is as follows:

 

<apex:page standardController="Enrollment__c" recordSetVar="Enrollments" sidebar="false">
    <apex:sectionHeader title="Email/Print Certificates"/>
        <apex:form >
          <apex:pageBlock >
             <apex:pageMessages />
                <apex:pageBlockButtons >
                    <apex:commandButton value="Save/Send Email" action="{!save}" />
                    <apex:commandButton value="Cancel" action="{!cancel}" />
                </apex:pageBlockButtons>
             <apex:pageBlockSection title="Selected Enrollments" columns="1" collapsible="False">
                    <apex:pageBlockTable value="{!selected}" var="Enrollment">
                       <apex:column value="{!Enrollment.name}"/>
                       <apex:column value="{!Enrollment.Delegate_name__c}"/>
                       <apex:column value="{!Enrollment.Booking_status__c}"/>
                       <apex:column value="{!Enrollment.Invoice_status__c}"/>
                       <apex:column value="{!Enrollment.Exam_results__c}"/>
                       <apex:column value="{!Enrollment.Exam_percentage__c}"/>
                       <apex:column value="{!Enrollment.Hold_Certificate__c}"/>
                       <apex:column value="{!Enrollment.Certificate_status__c}"/>
                       <apex:column headerValue="Review PDF/Open to print">
                       <apex:outputlink target="_blank" value="https://eu1.salesforce.com/apex/ReviewPDFcert?id={!Enrollment.id}">review pdf</apex:outputlink> <br/>
                       <apex:outputlink target="_blank" value="https://eu1.salesforce.com/apex/ReviewPDFcertnoback?id={!Enrollment.id}">review pdf no background</apex:outputlink><br/>         
                       <apex:outputlink rendered="{!IF((CONTAINS($Profile.Name, "System")||(CONTAINS($Profile.Name, "Japan"))),TRUE, FALSE)}"   target="_blank" value="https://eu1.salesforce.com/apex/ReviewPDFcert_Japan?id={!Enrollment.id}">Japan certificate (except IRCA)</apex:outputlink><br/>
                       <apex:outputlink target="_blank" value="https://eu1.salesforce.com/apex/coverletter?id={!Enrollment.id}">coverletter</apex:outputlink></apex:column>
                       <apex:column headerValue="Cert Printed?"><apex:inputField value="{!Enrollment.Certificate_Printed__c}"/></apex:column>
                       <apex:column headerValue="Select PDF Certificates to Email"><apex:inputField value="{!Enrollment.Email_PDF_Certificate__c}"/></apex:column>
                   </apex:pageBlockTable>
              </apex:pageBlockSection>                        
        </apex:pageBlock>
    </apex:form>    
</apex:page>

 

 

Many Thanks for any help anyone can offer on this - I am new to development.

 

  • February 01, 2012
  • Like
  • 0

Hi folks.   I've run into an issue which looks to be associated with the Spring '12 platform as we have not run into this prior.  I have submitted a case with support regarding this but they have not been able to help and have since closed the case.

 

Here's the scenario:

Within my package I have a custom layout on the Opportunity object.  As a pre-install step, only certain profiles are given access to the package contents (custom profiles based on the standard profile).  As a post-install step, this layout is assigned to one (or more) Opportunity Record Types. Pretty standard stuff.

 

Previously,  to uninstall the package all I would have to do is reassign the layout on these record types to a standard Opportunity layout.  Once done, the package would install without issue.   But recent attempts to execute this process have been unsuccessful due to the following errors:

 

This installed component is referenced by a locally created component. Standard Platform User

This installed component is referenced by a locally created component. System Administrator

 

The System Administrator link above will bring me to the 'Force.com - Free User' profile.

 

Not sure what's going on with this, if it's a 'bug' or I missed something in the release notes pertaining to this.

 

Any ideas?

  • February 20, 2012
  • Like
  • 1

Hi peoples, after a good deal of research it appears that a call in to an Apex method will be aborted after 30 seconds.   I'm not seeing any mention of this within the Salesforce documentation.   Has anyone else seen this behavior and, if so, did you find any way around it? 

  • January 23, 2012
  • Like
  • 0

Wondering if anyone else is running into this issue.  In my development org I have a number of custom objects containing fields with default values set (mainly picklist fields).  After packaging and installing this package in a target org, none of the default values are set.   This is a recent occurance and I have yet to find the cause or a workaround.  A case was submitted on 6/11 and has since been escalated.

  • June 14, 2011
  • Like
  • 0

I'm attempting to create a custom grid to display values from a single object record.  The page will be use in both View and Edit modes, and looks OK when in Edit mode (displaying inputFields).  I have yet to find a good option to keep the alignment consistent when simply viewing the data in a read-only state.  In this mode, I'd like to use outputField to retain the correct formatting of data. 

 

Here are some screens.  It's probably difficult to see, but the row/column headers (Type 1, Type 2... Count 1, Amount 1..) are being rendered as Labels. I'd like to keep the formatting the same here as on standard field labels.


1:  Edit mode, no issues.

 

2: View mode, obvious alignment issues:

 

  • February 25, 2011
  • Like
  • 0

Hi folks.   I've run into an issue which looks to be associated with the Spring '12 platform as we have not run into this prior.  I have submitted a case with support regarding this but they have not been able to help and have since closed the case.

 

Here's the scenario:

Within my package I have a custom layout on the Opportunity object.  As a pre-install step, only certain profiles are given access to the package contents (custom profiles based on the standard profile).  As a post-install step, this layout is assigned to one (or more) Opportunity Record Types. Pretty standard stuff.

 

Previously,  to uninstall the package all I would have to do is reassign the layout on these record types to a standard Opportunity layout.  Once done, the package would install without issue.   But recent attempts to execute this process have been unsuccessful due to the following errors:

 

This installed component is referenced by a locally created component. Standard Platform User

This installed component is referenced by a locally created component. System Administrator

 

The System Administrator link above will bring me to the 'Force.com - Free User' profile.

 

Not sure what's going on with this, if it's a 'bug' or I missed something in the release notes pertaining to this.

 

Any ideas?

  • February 20, 2012
  • Like
  • 1

Hi folks.   I've run into an issue which looks to be associated with the Spring '12 platform as we have not run into this prior.  I have submitted a case with support regarding this but they have not been able to help and have since closed the case.

 

Here's the scenario:

Within my package I have a custom layout on the Opportunity object.  As a pre-install step, only certain profiles are given access to the package contents (custom profiles based on the standard profile).  As a post-install step, this layout is assigned to one (or more) Opportunity Record Types. Pretty standard stuff.

 

Previously,  to uninstall the package all I would have to do is reassign the layout on these record types to a standard Opportunity layout.  Once done, the package would install without issue.   But recent attempts to execute this process have been unsuccessful due to the following errors:

 

This installed component is referenced by a locally created component. Standard Platform User

This installed component is referenced by a locally created component. System Administrator

 

The System Administrator link above will bring me to the 'Force.com - Free User' profile.

 

Not sure what's going on with this, if it's a 'bug' or I missed something in the release notes pertaining to this.

 

Any ideas?

  • February 20, 2012
  • Like
  • 1

My Apex unit tests, which were all working in v23.0, are now failing in my v24.0 sandbox because there are no Pricebook2 records in the test database. I'm not sure how to fix this -- I've tried inserting my own Pricebook2 record but it doesn't make any difference, because it's not the Standard Price Book.

 

Here's my code, abbreviated:

 

Product2 newProd = new Product2(Name = 'test product', family = 'test family');
insert newProd;

PriceBookEntry pbEntry = new PriceBookEntry(
    UnitPrice = 300,
    PriceBook2Id = [select id from PriceBook2 where isStandard = true].Id,
    Product2Id = newProd.Id
);

 The query on line 6 fails with "List has no rows". But if I try this instead:

 

Product2 newProd = new Product2(Name = 'test product', family = 'test family');
insert newProd;

PriceBook2 pb = new PriceBook2(Name = 'test price book');
insert pb;

PriceBookEntry pbEntry = new PriceBookEntry(
    UnitPrice = 300,
    PriceBook2Id = pb.Id,
    Product2Id = newProd.Id
);

insert pbEntry;

 Then the last line fails with a STANDARD_PRICE_NOT_DEFINED exception.

 

Not sure how to get around this -- my understanding is that this code has stopped working in v24.0 because unit tests no longer have access to real data. How does one test opportunity line items, then?

Hi,

Is there a way I can disable/precent a trigger from firing if the trigger comes from a managed application?

 

The problem is that I have a managed package which has been released. There is a trigger which is useful to some cutomers and not useful to other and I need a way to disable it from those who do not want it.

 

Thanks,

Kos

We have a custom app set up on our system with the customer objects Training Events and Enrolments.  An enrolment links an Opportunity to a Contact and the training event and appears as a related list on the training event.  I have created a few VF pages with Enrolment as the standard controller which are accessed via a custom button on the related list on Training Event page. 

 

The idea is that relevant enrolments are selected and when the VF page is access they can all be edited in one go and the changes saved.  IN the last few weeks I am continually receiving the following error message when I click save:

 

An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using salesforce.com!

Error ID: 166244247-41322 (-259332223)

 

This has only started happening recently (around the time Spring 12 was released to our Sandbox) and SFDC seem to be unable to support as is it a developer issue.  The code has not been altered at all and still works perfectly in production.  Does anyone know if there could be something in Spring 12 whcih is causing this?

 

The basic code for the pages is as follows:

 

<apex:page standardController="Enrollment__c" recordSetVar="Enrollments" sidebar="false">
    <apex:sectionHeader title="Email/Print Certificates"/>
        <apex:form >
          <apex:pageBlock >
             <apex:pageMessages />
                <apex:pageBlockButtons >
                    <apex:commandButton value="Save/Send Email" action="{!save}" />
                    <apex:commandButton value="Cancel" action="{!cancel}" />
                </apex:pageBlockButtons>
             <apex:pageBlockSection title="Selected Enrollments" columns="1" collapsible="False">
                    <apex:pageBlockTable value="{!selected}" var="Enrollment">
                       <apex:column value="{!Enrollment.name}"/>
                       <apex:column value="{!Enrollment.Delegate_name__c}"/>
                       <apex:column value="{!Enrollment.Booking_status__c}"/>
                       <apex:column value="{!Enrollment.Invoice_status__c}"/>
                       <apex:column value="{!Enrollment.Exam_results__c}"/>
                       <apex:column value="{!Enrollment.Exam_percentage__c}"/>
                       <apex:column value="{!Enrollment.Hold_Certificate__c}"/>
                       <apex:column value="{!Enrollment.Certificate_status__c}"/>
                       <apex:column headerValue="Review PDF/Open to print">
                       <apex:outputlink target="_blank" value="https://eu1.salesforce.com/apex/ReviewPDFcert?id={!Enrollment.id}">review pdf</apex:outputlink> <br/>
                       <apex:outputlink target="_blank" value="https://eu1.salesforce.com/apex/ReviewPDFcertnoback?id={!Enrollment.id}">review pdf no background</apex:outputlink><br/>         
                       <apex:outputlink rendered="{!IF((CONTAINS($Profile.Name, "System")||(CONTAINS($Profile.Name, "Japan"))),TRUE, FALSE)}"   target="_blank" value="https://eu1.salesforce.com/apex/ReviewPDFcert_Japan?id={!Enrollment.id}">Japan certificate (except IRCA)</apex:outputlink><br/>
                       <apex:outputlink target="_blank" value="https://eu1.salesforce.com/apex/coverletter?id={!Enrollment.id}">coverletter</apex:outputlink></apex:column>
                       <apex:column headerValue="Cert Printed?"><apex:inputField value="{!Enrollment.Certificate_Printed__c}"/></apex:column>
                       <apex:column headerValue="Select PDF Certificates to Email"><apex:inputField value="{!Enrollment.Email_PDF_Certificate__c}"/></apex:column>
                   </apex:pageBlockTable>
              </apex:pageBlockSection>                        
        </apex:pageBlock>
    </apex:form>    
</apex:page>

 

 

Many Thanks for any help anyone can offer on this - I am new to development.

 

  • February 01, 2012
  • Like
  • 0

Here's some code that works on a winter 12 dev org bug fails on a Spring 12 sandbox:

 

VisualForce controller:

 

public class Spring12Bug
{
    private Map<String, String> m_entries;

    public Map<String, String> Entries {
        get
        {
            if(m_entries==null) 
                m_entries = new Map<String, String>{'A'=>'Red','B'=>'Green','C'=>'Blue'};
            return m_entries;
        } 
    }

    public Set<String> getKeys()
    {
        return Entries.keyset();
    }


}

 

VisualForce page markup:

 

<apex:page controller="Spring12Bug" >
  <h1>Demonstration of bug</h1>
  <apex:dataTable var="thekey" value="{!Keys}">
      <apex:column headerValue="Entries" value="{!Entries[thekey]}" />
  </apex:dataTable>
</apex:page>

 

On Winter 12 you get:

 

Demonstration of bugEntries

Red
Green
Blue

 

 

On Spring preview you get:

 

Visualforce Error


Map key null not found in map.


(Color changed for readability).

 

There is a workaround - to put the lookup in an OutputText tag inside of the column instead of using the Value attribute. But I figure someone should know about this bug as well.

Hi peoples, after a good deal of research it appears that a call in to an Apex method will be aborted after 30 seconds.   I'm not seeing any mention of this within the Salesforce documentation.   Has anyone else seen this behavior and, if so, did you find any way around it? 

  • January 23, 2012
  • Like
  • 0

Hello,

 

Over the weekend, our sandbox was upgraded to Winter '12, and many of my Apex tests have failures now.

 

For instance, I have a test that tries to save a Lead without a Last Name (which should lead to an error for a required field missing).

 

My test:

 

static testMethod void testExceptionsConvertCloseNoLead() { 
  myGenHelpers gh = new myGenHelpers();
		
  Lead testLead = gh.getUptimeTestLead();
  insert testLead;
	            	
  testLead.LastName = null;
	            	
   myLeadConvertCloseExtension lcc = new myLeadConvertCloseExtension(new ApexPages.StandardController(testLead));
   lcc.save();
}

 

Last week, and still in production, this test passes successfully.  However, today, it fails.

 

The problem is in this code segment:

 

                try {
	                update this.myLead;
                } catch (DmlException e) {
                    for (Integer i = 0; i < e.getNumDml(); i++) {
				    	System.debug('myClass.save: error: ' + e.getDmlMessage(i));
                        this.myLead.addError(e.getDmlMessage(i)); 
                    }
                    return null;
                }

 

Instead the error being handled gracefully, the test just fails at the upsert.

 

Any thoughts?

Wondering if anyone else is running into this issue.  In my development org I have a number of custom objects containing fields with default values set (mainly picklist fields).  After packaging and installing this package in a target org, none of the default values are set.   This is a recent occurance and I have yet to find the cause or a workaround.  A case was submitted on 6/11 and has since been escalated.

  • June 14, 2011
  • Like
  • 0

We use Visualforce binding to display results from different object queries based on user selection. An admin can dynamically define the query we run so Visualforce binding is perfect for this.

 

Our code has broke in Summer 11. We get errors whenever results for a different object are retrieved. The new field change does not appear to be respected by Visual Force.

 

I was able to write the following test code to illustrate. When you run you will see 10 accounts in your org. Now change the dropdown to contacts, and you see a binding error.  It looks like Visualforce isn’t refreshing the QueryViewDisplayFields as expected. As mentioned, this functionality worked before but is broken in the Summer release.  If you change the selected option to ‘Contacts’ in the constructor, you’ll see that the contacts display fine. Now if the user changes the options to accounts the binding breaks.

 

<apex:page controller="BindingTest">
<apex:form >

<apex:outputLabel dir="" value="Showing: " />
                &nbsp;&nbsp;&nbsp;
<apex:selectList multiselect="false" value="{!SelectedOption}" size="1">    
        <apex:selectOptions value="{!OptionsList}" id="recordOptions" />
        <apex:actionSupport event="onchange" status="counterStatus"
            oncomplete="ReadData();" rerender="none"  />                
</apex:selectList>

<apex:actionFunction name="ReadData"
    action="{!ReadData}" rerender="SearchResults" />

<apex:pageBlock id="SearchResults" >
     
        <apex:pageblocktable value="{!QueryViewRecords}" var="viewRow">

        <apex:repeat value="{!QueryViewDisplayFields}" var="myfield" id="innerset">
        <apex:column value="{!viewRow[myfield]}" />
        </apex:repeat>
                                        
        </apex:pageblocktable>                

</apex:pageBlock>

</apex:form>
</apex:page>

 

 

public with sharing class BindingTest
{
    public String SelectedOption {get; set;}

    public List<SelectOption> OptionsList {get; set;}
    public List<SObject> QueryViewRecords {get; set;}
    
    public List<String> QueryViewDisplayFields
    {
        get
        {
            List<String> returnResults = new List<String>();    
            
            if( SelectedOption == 'Accounts' )
            {            
                returnResults.add('name');
                returnResults.add('phone');
                returnResults.add('annualrevenue');
            }
            else
            {            
                returnResults.add('firstname');
                returnResults.add('lastname');
            }

            return returnResults;            
        }
    }
    
    public BindingTest()
    {
        OptionsList = new List<SelectOption>();
        OptionsList.add(new SelectOption('Accounts', 'Accounts'));
        OptionsList.add(new SelectOption('Contacts', 'Contacts'));
        
        SelectedOption = 'Contacts';
        ReadData();
    }

    public void ReadData()
    {
         if( SelectedOption == 'Accounts' )
         {
             QueryViewRecords = [select name, phone, annualrevenue from account limit 10];
         }
         else
         {
             QueryViewRecords = [select firstname, lastname from Contact limit 10];         
         }
    }
}