• Keith987
  • NEWBIE
  • 50 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 41
    Replies

I have a side bar component written in Visualforce that is only relevant to one of my apps and would like its output to only be present when that app is selected. I can also imagine other use cases where knowing the currently selected app would be useful.

 

Anyone know if this information can be obtained in Apex code?

 

Thanks,

Keith

Hi,

 

When im deploying one premission set with one custom app premission it is not deploying throwing error as :

 


# Deploy Results:
   File Name:    permissionsets/SSR_Holdings_Permission_Set.permissionset
   Full Name:  SSR_Holdings_Permission_Set
   Action:  NO ACTION
   Result:  FAILED
   Problem: Unknown user permission: AllowDeleteDandBCompany

 

Plz Advice

I predominantly use system.debug to print out debug messages. I have noticed recently that if the LogLevel for apex code is set to debug, there are several messages printed in the log such as the following. These messages seems irrelevant and obscure the real messages.

08:47:01.221 (221465000)|ENTERING_MANAGED_PKG|
08:47:01.223 (223142000)|ENTERING_MANAGED_PKG|
08:47:01.223 (223247000)|ENTERING_MANAGED_PKG|
08:47:01.223 (223283000)|USER_DEBUG|[25]|ERROR|Entering Insert

 

I have resorted to using

System.debug(Logginglevel.ERROR, 'Message') and  setting the loglevel of ERROR to prevent these messages from showing. However, I was wondering if there was any other means to suppress these messages (without changing log level). Frankly these messages seem to be useless since they are not conveying anything at all.

<apex:repeat value="{!sectionOrder}" var="order">
    <apex:outputPanel layout="none" rendered="{! order == 'Reference' }">
        <apex:pageBlock title="Reference">
            <apex:pageBlockButtons location="top">
                <apex:commandButton reRender="??? what goes here to get the EligibilityPageBlock re-rendered ???"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:outputPanel>
    <apex:outputPanel layout="none" rendered="{! order == 'Synopsis' }">
        <apex:pageBlock title="Synopsis">
        </apex:pageBlock>
    </apex:outputPanel>
    <apex:outputPanel layout="none" rendered="{! order == 'Eligibility' }" id="EligibilityOutputPanel>
        <apex:pageBlock title="Eligibility" id="EligibilityPageBlock">
        </apex:pageBlock>
    </apex:outputPanel>
    <!-- More similar panels -->
</apex:repeat>

The above illustrates how I am controlling the order that some apex:pageBlocks are output by having a sectionOrder list provided by the controller. Introducing this re-ordering has however broken some reRender logic that I had, perhaps because the full ids in the generated page now include the apex:repeat index of 0, 1, 2 etc.

 

I am unclear about how the id supplied in reRender is resolved back to the full id in the page. Any insight into whether there is a way to get partial page re-rendering to work in the above situation would be appreciated.

 

Thanks,

Keith

I have some Apex code that creates a Component.Apex.PageBlockSection containing many Component.Apex.InputField objects. This works fine when invoked from an apex:dynamicComponent tag in a Visualforce page.

 

But when I run the code in this test to ensure that there are not any exceptions and to add to the code coverage total I get the "An internal server error has occurred" error page:

 

@isTest
private class DetailsDynamicComponentFactoryTest {
    @isTest
    static void test() {
    	System.assertNotEquals(null, new DetailsDynamicComponentFactory(true, true, true, true, true).create('Details', true));
    }
}

 

Has anyone succeeded in running such code from a test?

 

Thanks,

Keith

I've created this test controller to illustrate my problem

 

public class TestController {
	List<Object_A__c> Aobjects { get; set; }
	List<Object_B__c> Bobjects { get; set; }

	public TestController() {
		//assign values to the a and b lists
	}

	public PageReference pageAction() {
		Savepoint sp = Database.setSavepoint();
		try {
			//Assume this dml operation succeeds
			insert Aobjects;
			//assume this dml operation fails
			insert Bobjects;
		} catch(System.DmlException e) {
			Database.rollback(sp);
			ApexPages.addMessages(e);
		}
	}
}

 

When the pageAction is called and there is a rollback because of a problem with 'B objects', the list of 'A Objects' still have Id values.

 

This becomes a problem when the pageAction is called a second time, because the 'A objects' have Ids and an insert is performed, giving the error: Record ID: cannot specify Id in an insert call

 

What is the best way to solve this?

        Hi,I'd like to get the version number of a managed package, which installed in a salesforce org, from a Java application through Apex Web Service API, is there any workaround?


        In more detail:
        1. Create a managed package.
        2. Use the Install URL to install this managed package to another dev org.
        3. Get the version number of the managed package, which installed in the dev org, from a Java application through Apex Web Service API.

        I find in the force.com's schema, there is an object apexPackage, but the version number is the APIVersion of the salesforce, eg:19, 21...   but not the package's version number, like 1.2.4, 1.4.2 and so on.

        I also have sent a email to the salesforce support, this is the response, but not what i want:

        /*********************************
            I understand that you want to get the version number of a managed package installed in salesforce. I have located the following possible solution that may be able to guide you.

           Click Your Name | Setup | Create | Packages and click the name of a package to view its details, including any added components, whether it is a managed package, if the package has been uploaded, and so on.
The detail page has the following sections:

           * Package details
           * Package components
           * Remote access
           * Development organizations
           * Version history
       **********************************/

       Thanks for any respone!

Hi Friends,

I have created one approval process and in Final Approval Actions there are three email alerts.

How to control the order of execution.

I have tried by removed all the email alerts and add them in alphabetical order based on Email Alert Name but there is no use.

 

Please post any ideas.

 

Thanks,

Indy

 

 

I am getting a strange error message as above.

 

I have an interface {say A} which has one method. I have a class {say B} that implements the interface (the method). And I have another class/method that takes interface A as a parameter. And I call that method with an instance of the class B. All compiles ok. But I got the error when running it.

 

I do not see what can possibly be wrong with my code. If I do not implement the method in A, it fails to compile. If I remove 'implements A' from B, it fails to compile. Also I have another class {C} that implements the interface A, and is used in exact same way and it works fine.

 

Anyone has seen similar issues?

 

 

 

 

 

 

Hi

 

 Custom Setting List ,Name field if we enter more then 5 Double byte char then it gives error
Sample data
  関根 秀治

 

 Is there any restriction in Name field ? For Single bytes its accepting 38 Char.

 

 It seems 1 double bytes its calculating 9 char .So we can enter 4 Double bytes and 2 Char like this.

 

 

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: 1700040002-861 (91623632)

 

 

Thanks and Regards

Thanga

Hi, We have customised salesforce functionalities using VisualForce. I am experiencing poor Performance of these pages. The pages loads up quite slowly compared to standard salesforce pages.  What could be the reason for such slow responses? Any help in this regard will be highly appreciated . I am also looking for a ways to check the page-size when they load up on the client. What could be the easiest way to do so.

 

I would like to know if anyone else has faced similar issues.

 Thanks  Shabs Moiyed

 

First let me begin by stating that I am a beginner. Apex is the first language I have tried to learn, and I have only been trying for a few months.

I am trying to create a controller class for a page that allows the user to create records of packages that were sent via mail. When creating a new mail package the user will need to be able to select from the multiple contracts that could be included in the package. I want to override the save button so that when a new package is saved the files that are included in the package are automatically created in a Mailed Package File object. I know that my save button is working because it works if I do not select any files for the package. However, if I try to select one or more files I receive the error "Conversion Error Setting Values."  This confuses me because I thought I was working with IDs. I tried to convert the data type to string but received the same error. Any help would be much appreciated
Code:
public class Mailed_Package_Controller {
 
 public Mailed_Package_Controller(ApexPages.StandardController Controller){
  this.MP = (MailedPackage__c)controller.getRecord();
 }
  
 
 public MailedPackage__c MP;
 
 public List<ID> selectedFiles {get;set;}
 
 public List<SelectOption> getFileOptions(){
  List<SelectOption> Filefeed = new List<SelectOption>();
  File__c[] A = [select ID, Name from File__c Order By LastModifiedDate];
  for (File__c f : A){
   Filefeed.add(new SelectOption (f.ID, f.Name));
  }  
  return Filefeed;
  }
 
   
 /* next you need a save method that overrides the default save method
 it needs to create the Mailer Package
 retrieve the id of the mailer package 
 then iterate through the list of selected file IDs
 and for each file ID create a !!! mailed Package File record !!!
 where the package ID is that of the mailer package
 and the file ID is the current ID in the list of selected file IDs
 */
   
  
 public List<MailedPackageFile__c> MPFs = new List <MailedPackageFile__c>();
 
 public void newMPF(){
  MailedPackageFile__c MPF = new MailedPackageFile__c();
  for (ID c : selectedFiles){
   MPF.File__c = c;
   MPF.MailedPackage__c = this.MP.Id;
   MPFs.add(MPF);
  }
 }
   
 public PageReference save(){
  try { 
   insert this.MP;
  } catch (Exception e){}
   
  newMPF();
  insert MPFs;
  PageReference MPpage = new PageReference('/'+MP.ID);
  MPpage.setRedirect(true);
  return MPpage; 
    
 }
 
 
}

 

In http://wiki.apexdevnet.com/index.php/Tabbed_Accounts_in_30_seconds
I've done the same for my custom object and it works pretty good.
On mine I have defined  TAB-A, TAB-B, TAB-C
I have extension controller code getting called on one of my extra Tabs (TAB-B) and that works fine too.

However I want it to return the user exactly where they were (in TAB-B) but I cannot find what that tab reference/url is.
It appears to be a Frame with a hidden field (j_id0:CaseTabPanel=TAB-B)

Any ideas on how I'd re-render that back from my controller (via PageReference ?)

Thanks
Lal
Hi guys,

I'm experiencing some unexpected behavior when trying to use the apex:repeat function to render tabs....

Basically it seems that tabs cannot be created on demand?  My controller is definitely returning data... as the second page block in my sample will show... repeat works - just the tabs are not rendered..

I'm sure any of you guys can see where I was going with this - and I guess I can achieve a similar result by dropping down to boring old html - just trying to use the standard components (as per best practice)

Any assistance greatly appreciated - as the purist coder me is seriously disturbed at the moment...

here is my 'simplified' and easily testable page & controller

Code: VF PAGE
<apex:page controller="clsRecordType">
    <apex:pageBlock >
        <apex:tabPanel id="theTabPanel">
            <apex:tab label="Account Types"/>
            <apex:repeat value="{!RecordTypes}" var="types">
                <apex:tab label="{!types.Name}"/>     
            </apex:repeat>
        </apex:tabPanel>
    </apex:pageBlock>

    <apex:pageBlock >
        <apex:repeat value="{!RecordTypes}" var="types">
            {!types.Name}<br/>       
        </apex:repeat>
    </apex:pageBlock>
</apex:page>

and the controller

Code:
public class clsRecordType {

    list<RecordType> lrecordtypes;

    public list<RecordType> getRecordTypes() {
        if(lrecordtypes==null) lrecordtypes = [Select Name, Id, Description From RecordType  where SobjectType = 'Account' and IsActive=True];
        return lrecordtypes;
        }
   }

 
 

I'm having trouble setting the selectedTab attribute of a tabPanel dynamically.  It works fine if I set selectedTab to a string in the visualforce page, but if I try and use something set by the controller it doesn't work.  Am I missing something obvious or is there an issue with the tabPanel tag?  

Controller:

Code:
public class testTabController {
 String tabInFocus = System.currentPageReference().getParameters().get('tab');
 public String getTabInFocus() {
  return tabInFocus;
 }
 public void setTabInFocus( String s ) {
  this.tabInFocus = s;
 }
}

 Page:
Code:
<apex:page controller="testTabController" sidebar="false" showheader="true">

 <p>tabInFocus: &lt;{!TabInFocus}&gt;</p>
 <apex:tabPanel switchType="client" selectedTab="{!TabInFocus}" id="testTabs">
  
  <apex:tab label="Label 1" name="oneTab" id="tab1" >
   <p>This is number one</p>
  </apex:tab>
  
  <apex:tab label="Label 2" name="twoTab" id="tab2" >
   <p>This is number two</p>
  </apex:tab>
  
  <apex:tab label="Label 3" name="threeTab" id="tab3" >
   <p>This is number three</p>
  </apex:tab>
  
 </apex:tabPanel>

</apex:page>

URL:
Code:
/apex/test_tab?tab=twoTab

 


 
The tab is selected properly if I use a static string, e.g.:

Code:
<apex:tabPanel switchType="client" selectedTab="twoTab" id="testTabs">

 
Any ideas?