• pjcoco
  • NEWBIE
  • 5 Points
  • Member since 2011

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

Dear developers,

 

I have this wierd error I can't get a solution to.

 

I have a button on a custom object, which calls a "static webservice" function, which in its turn generates a pdf out of a visualforce page and attaches it to the custom object.

 

The custom object in its turn is basically a step in a big sales cycle, and gets generated whenever a lead is converted, when I try to automatically add the PDF whenever the custom object is created, I get a corrupt File, which can't be opened.

 

When I make a different function, in apex, which does the same functionality (attaching a pdf to the custom object), not making it a webservice, I have the same problem. (In both cases my pdf is only 22bytes large), when making the function @future the pdf is about the correct size (1,8kb) but is the file is still corrupt.

 

Any thoughts?

 

Thanks in advance & Kindest Regards

Dear developers,

 

I have this particular Salesforce Org, which, for some reason, causes my Force.com IDE to throw an exception when trying to make a new Force.com Project. And it's only on this org. I have over 20 orgs which i'm working for and none of them has any problems. I tried different things (reinstall orgs, reinstall jre/jdk, different jre/jdk versions, change lines in .ini) nothing works.

 

What I do is:

  1. New -> Force.com Project
  2. Fill in project details & credentials
  3. Click Next
  4. Then I have to choose project contents (I tried different things here aswel)
  5. Finish

Then it starts fetching components, and about halfway, I get this error.

 

 

Unable to fetch and save Force.com components to project:

UNKNOWN_EXCEPTION: java.lang.NullPointerException

Abort or Continue Force.com project creation?

 

Anyone has an idea on how to fix this.

Regards

Hello,

 

I'm looking into the possiblity of creating Circular Many-To-Many relationships with Salesforce. For instance if I would like to incorporate Users following other Users in some sort of Feed. Not like chatter, it's actually for use in Database.com.

 

Thanks in advance.

  • April 30, 2012
  • Like
  • 0

Hello developers,

 

I'm at the end of trying, and was wondering if it is possible to have one apex:selectList control the content of another one, i've been trying to make a visualforce page where the user gets to select from a list of email templates where the list is variable based on which Folder was selected. I've tried alot of different ways, however I don't seem to be finding a solution. Could any of you point me in the right direction, or tell me what i'm doing wrong.

 

My VF Code:

<apex:pageBlockSectionItem >
				<apex:outputLabel value="Folder" for="folders"/>
                    <apex:selectList value="{!folderId}" size="1" id="folders" required="true">
			            <apex:selectOptions value="{!folders}"/>
			            <apex:actionSupport immediate="true" event="onchange" rerender="level2" /> 
			        </apex:selectList>
			</apex:pageBlockSectionItem>
			<apex:pageBlockSectionItem >
				<apex:outputLabel value="Template" for="templates"/>
				<apex:selectList value="{!templateId}" size="1" id="level2" required="true">
			            <apex:selectOptions value="{!templates}"/>
			        </apex:selectList>
			</apex:pageBlockSectionItem>

 

my apex code:

public List<SelectOption> getFolders()
	{
		List<SelectOption> options = new List<SelectOption>();
		options.add(new SelectOption(UserInfo.getOrganizationId(), 'Unfiled Public Email Template'));
		options.add(new SelectOption(UserInfo.getUserId(), 'Personal Email Template'));
		for(Folder f : folders)
		{
			options.add(new SelectOption(f.Id, f.Name));
		}
		return options;
	}
	
	public List<SelectOption> getTemplates()
	{
		List<SelectOption> options = new List<SelectOption>();
		for(EmailTemplate e : allTemplates)
		{
			if(e.FolderId == folderId)
			{
				options.add(new SelectOption(e.Id, e.Name));
			}
		}
		return options;
	}

 

  • April 05, 2012
  • Like
  • 0

Hello Developers,

 

I have this Visualforce page which displays a apex:pageBlockTable based on data I got from an earlier step, there I need the ability to click a row, and based on the item being clicked, a new page opens. What i'm basically trying to do is, when adding a new Partner, a lookup appears in a list of records, and if multiple hits are found, the hits are shown, and the user gets the ability to choose from the list.

 

The only problem is that having to call onRowClick i need to use a apex:actionSupport which does an AJAX call.

The problem there is that the returned PageReference is another VisualForce page, and the redirect doesn't occur. adding.setRedirect(true); isn't an option because my ViewState gets flushed, and I still need the captured data.

 

My question basically is, when a PageReference gets returned to an AJAX call, is there a way of opening this reference?

 

Here is my code:

 

Visualforce:

<apex:page Controller="NewPartnerController" tabStyle="Partner__c">
<style type="text/css">
.pointer
{
	cursor: pointer;
}
</style>
	<apex:form >
		<apex:sectionHeader title="Partner" subtitle="Choose from the List"/>
		<apex:pageBlock title="Record List">
	        <apex:pageBlockTable value="{!records}" var="r" styleClass="pointer">
	        	<apex:actionSupport event="onRowClick" action="{!recordSelected}">
	        		<apex:param assignTo="{!selectedId}" value="{!r.Id}" name="selectedId"/>
	        	</apex:actionSupport>
	            <apex:column value="{!r.Name}"/>
	            <apex:column value="{!r.Zip__c}"/> 
	            <apex:column value="{!r.Address__c}"/> 
	            <apex:column value="{!r.Phone__c}"/>  
	        </apex:pageBlockTable>
   		</apex:pageBlock>
</apex:form>
</apex:page>

 

Controller:

public class NewPartnerController
{
	public Partner__c p {get;set;}
	public List<List_Record__c> records {get;set;}
	public Id selectedId {get;set;}
	
	public NewPartnerController()
	{
		p = new Partner__c();
	}
	
	public PageReference findRecords()
	{
		// list gets populated here
                return Page.PartnerListView;
	}
	
	public PageReference recordSelected()
	{
		List_Record__c sr;
		for(List_Record__c r : records)
		{
			if(selectedId.equals(r.Id))
			{
				sr = r;
				break;
			}
		}
		if(sr != null)
		{
			p.Name = sr.Name;
			p.Zip_Postcode__c = sr.Zip__c;
			p.Straat__c = sr.Address__c;
			p.Telefoon__c = sr.Phone__c;
		}
		return Page.NewPartnerInfo;
	}
}

 

  • March 08, 2012
  • Like
  • 0

Dear Developers,

 

Is it possible to check if the page has error messages? So I can stop rendering part of the page when it has error messages?

 

Thanks in advance.

  • February 17, 2012
  • Like
  • 0

I have this simple VF page with a lookup field for accounts, and a picklist for contacts,  the picklist should be empty until an account has been filled in. Whenever the account field changes, an AJAX call should be made to the server and the picklist should be populated with the results

 

I was following this tutorial:

http://wiki.developerforce.com/index.php/Extended_Functionality_of_Visualforce_-_Part_2

 

but at this time I can't seem to get my picklist populated. What is wrong with my code?

 

Objects:

 

Custom Object Communication, with master Object Account.
In communication I have a master-detail relation to Account, and a lookup relation to Contact

 

 

VF Page:

 

<apex:page standardController="Communication__c" extensions="CommunicationController" standardStylesheets="false">
<apex:form >
<apex:pageBlock title="Communication">
<apex:messages />
<apex:pageBlockSection columns="1">
<apex:pageblockSectionItem >
<apex:outputLabel value="Account:" />
<apex:inputField value="{!c.Account__c}">
    <apex:actionSupport event="onchange" rerender="contacts"/>
</apex:inputField>
</apex:pageblockSectionItem>
<apex:pageblockSectionItem >
<apex:outputLabel value="Contact:" />
<apex:selectList value="{!contact}" multiselect="false" size="1" id="contacts">
       <apex:selectOptions value="{!contacts}" />
</apex:selectList>
</apex:pageblockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>    
</apex:page>

 

Apex Class:
public class CommunicationController{
    public Account account {get;set;}
    public Communication__c c{get;set;}
    public String contact{get;set;}
  
    public CommunicationController(ApexPages.Standardcontroller controller){
        c = new Communication__c();
        cType = '';
        summary='';
        file = new ContentVersion();        
    }

    public List<SelectOption> getContacts(){
        List<SelectOption> optionList = new List<SelectOption>();
        optionList.add(new SelectOption('', '- None -'));
        for(contact co : [SELECT id, name FROM contact WHERE accountid =  :c.Account__c])
        {
            optionList.add(new SelectOption(co.id,co.name));
        }
        return optionList;
    }
}

 

Thanks in advance

 

  • April 12, 2011
  • Like
  • 0

Dear developers,

 

I have this particular Salesforce Org, which, for some reason, causes my Force.com IDE to throw an exception when trying to make a new Force.com Project. And it's only on this org. I have over 20 orgs which i'm working for and none of them has any problems. I tried different things (reinstall orgs, reinstall jre/jdk, different jre/jdk versions, change lines in .ini) nothing works.

 

What I do is:

  1. New -> Force.com Project
  2. Fill in project details & credentials
  3. Click Next
  4. Then I have to choose project contents (I tried different things here aswel)
  5. Finish

Then it starts fetching components, and about halfway, I get this error.

 

 

Unable to fetch and save Force.com components to project:

UNKNOWN_EXCEPTION: java.lang.NullPointerException

Abort or Continue Force.com project creation?

 

Anyone has an idea on how to fix this.

Regards

Hello,

 

I'm looking into the possiblity of creating Circular Many-To-Many relationships with Salesforce. For instance if I would like to incorporate Users following other Users in some sort of Feed. Not like chatter, it's actually for use in Database.com.

 

Thanks in advance.

  • April 30, 2012
  • Like
  • 0

Hello developers,

 

I'm at the end of trying, and was wondering if it is possible to have one apex:selectList control the content of another one, i've been trying to make a visualforce page where the user gets to select from a list of email templates where the list is variable based on which Folder was selected. I've tried alot of different ways, however I don't seem to be finding a solution. Could any of you point me in the right direction, or tell me what i'm doing wrong.

 

My VF Code:

<apex:pageBlockSectionItem >
				<apex:outputLabel value="Folder" for="folders"/>
                    <apex:selectList value="{!folderId}" size="1" id="folders" required="true">
			            <apex:selectOptions value="{!folders}"/>
			            <apex:actionSupport immediate="true" event="onchange" rerender="level2" /> 
			        </apex:selectList>
			</apex:pageBlockSectionItem>
			<apex:pageBlockSectionItem >
				<apex:outputLabel value="Template" for="templates"/>
				<apex:selectList value="{!templateId}" size="1" id="level2" required="true">
			            <apex:selectOptions value="{!templates}"/>
			        </apex:selectList>
			</apex:pageBlockSectionItem>

 

my apex code:

public List<SelectOption> getFolders()
	{
		List<SelectOption> options = new List<SelectOption>();
		options.add(new SelectOption(UserInfo.getOrganizationId(), 'Unfiled Public Email Template'));
		options.add(new SelectOption(UserInfo.getUserId(), 'Personal Email Template'));
		for(Folder f : folders)
		{
			options.add(new SelectOption(f.Id, f.Name));
		}
		return options;
	}
	
	public List<SelectOption> getTemplates()
	{
		List<SelectOption> options = new List<SelectOption>();
		for(EmailTemplate e : allTemplates)
		{
			if(e.FolderId == folderId)
			{
				options.add(new SelectOption(e.Id, e.Name));
			}
		}
		return options;
	}

 

  • April 05, 2012
  • Like
  • 0

Hello Developers,

 

I have this Visualforce page which displays a apex:pageBlockTable based on data I got from an earlier step, there I need the ability to click a row, and based on the item being clicked, a new page opens. What i'm basically trying to do is, when adding a new Partner, a lookup appears in a list of records, and if multiple hits are found, the hits are shown, and the user gets the ability to choose from the list.

 

The only problem is that having to call onRowClick i need to use a apex:actionSupport which does an AJAX call.

The problem there is that the returned PageReference is another VisualForce page, and the redirect doesn't occur. adding.setRedirect(true); isn't an option because my ViewState gets flushed, and I still need the captured data.

 

My question basically is, when a PageReference gets returned to an AJAX call, is there a way of opening this reference?

 

Here is my code:

 

Visualforce:

<apex:page Controller="NewPartnerController" tabStyle="Partner__c">
<style type="text/css">
.pointer
{
	cursor: pointer;
}
</style>
	<apex:form >
		<apex:sectionHeader title="Partner" subtitle="Choose from the List"/>
		<apex:pageBlock title="Record List">
	        <apex:pageBlockTable value="{!records}" var="r" styleClass="pointer">
	        	<apex:actionSupport event="onRowClick" action="{!recordSelected}">
	        		<apex:param assignTo="{!selectedId}" value="{!r.Id}" name="selectedId"/>
	        	</apex:actionSupport>
	            <apex:column value="{!r.Name}"/>
	            <apex:column value="{!r.Zip__c}"/> 
	            <apex:column value="{!r.Address__c}"/> 
	            <apex:column value="{!r.Phone__c}"/>  
	        </apex:pageBlockTable>
   		</apex:pageBlock>
</apex:form>
</apex:page>

 

Controller:

public class NewPartnerController
{
	public Partner__c p {get;set;}
	public List<List_Record__c> records {get;set;}
	public Id selectedId {get;set;}
	
	public NewPartnerController()
	{
		p = new Partner__c();
	}
	
	public PageReference findRecords()
	{
		// list gets populated here
                return Page.PartnerListView;
	}
	
	public PageReference recordSelected()
	{
		List_Record__c sr;
		for(List_Record__c r : records)
		{
			if(selectedId.equals(r.Id))
			{
				sr = r;
				break;
			}
		}
		if(sr != null)
		{
			p.Name = sr.Name;
			p.Zip_Postcode__c = sr.Zip__c;
			p.Straat__c = sr.Address__c;
			p.Telefoon__c = sr.Phone__c;
		}
		return Page.NewPartnerInfo;
	}
}

 

  • March 08, 2012
  • Like
  • 0

Hi

 

I Am getting this error because of for  loops , but when am trying to customize the for loops, my functionality is changing ,Please let me know there is any alternative solution for it.

 

Thanks in Advance.

I'm trying to streamline data entry for my organization.  We've got two objects that could be improved by a visualforce page that's cut down to just the fields used by the data entry team.  It would be even better if we could get the Save button on that page to save the two objects that get created from that.  The objects in question are a Contact and a custom object that points to the new contact.

 

I'm currently using a controller extension to save a contact and redirect the user back to the data entry page when the Save button gets pressed.  I'm thinking I need to do something like getting the ID of the contact I've just saved and then maybe call a custom controller for the custom object.  Is it possible to call a custom controller for another object from a controller extension?

 

Can anyone point me to examples of how to do something like this?

 

Thanks!

I have this simple VF page with a lookup field for accounts, and a picklist for contacts,  the picklist should be empty until an account has been filled in. Whenever the account field changes, an AJAX call should be made to the server and the picklist should be populated with the results

 

I was following this tutorial:

http://wiki.developerforce.com/index.php/Extended_Functionality_of_Visualforce_-_Part_2

 

but at this time I can't seem to get my picklist populated. What is wrong with my code?

 

Objects:

 

Custom Object Communication, with master Object Account.
In communication I have a master-detail relation to Account, and a lookup relation to Contact

 

 

VF Page:

 

<apex:page standardController="Communication__c" extensions="CommunicationController" standardStylesheets="false">
<apex:form >
<apex:pageBlock title="Communication">
<apex:messages />
<apex:pageBlockSection columns="1">
<apex:pageblockSectionItem >
<apex:outputLabel value="Account:" />
<apex:inputField value="{!c.Account__c}">
    <apex:actionSupport event="onchange" rerender="contacts"/>
</apex:inputField>
</apex:pageblockSectionItem>
<apex:pageblockSectionItem >
<apex:outputLabel value="Contact:" />
<apex:selectList value="{!contact}" multiselect="false" size="1" id="contacts">
       <apex:selectOptions value="{!contacts}" />
</apex:selectList>
</apex:pageblockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>    
</apex:page>

 

Apex Class:
public class CommunicationController{
    public Account account {get;set;}
    public Communication__c c{get;set;}
    public String contact{get;set;}
  
    public CommunicationController(ApexPages.Standardcontroller controller){
        c = new Communication__c();
        cType = '';
        summary='';
        file = new ContentVersion();        
    }

    public List<SelectOption> getContacts(){
        List<SelectOption> optionList = new List<SelectOption>();
        optionList.add(new SelectOption('', '- None -'));
        for(contact co : [SELECT id, name FROM contact WHERE accountid =  :c.Account__c])
        {
            optionList.add(new SelectOption(co.id,co.name));
        }
        return optionList;
    }
}

 

Thanks in advance

 

  • April 12, 2011
  • Like
  • 0

Hi,

 

Can someone suggest if there is any helptext kind of thing available in the Visual Force.

 

This is regarding the help icon which, when hovered by a mouse gives a help text explanation

 

which is present in the Standard objects & Custom Objects for the standard fields in them.

 

Is there a way of achieving this through javascript?

 

Please give me pointers in this issue. TIA.