• rklaassen
  • NEWBIE
  • 100 Points
  • Member since 2008

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

Hi,

 

I try to have a table in a visualforce page, but not a repeating table, so i cannot use <apex:dataTable>.

First column with label (big width) and then 2 columns with input fields (smaller width).

 

Have i to use the <apex:inputfield> for the fields ? 

If yes, how can i make them appear on the same line ? They appear always on separate line.

If no, how can i make the <input> related to the SFDC fields so as to save the value in the correct field ?

 

I tried this : 

<table border="1">
<tr><td colspan="2"></td><td  colspan="2">Total</td><td  colspan="2">Part</td></tr>
<apex:outputText >Label bla bla</apex:outputText>
<apex:inputField value="{!Building_Cost__c.CA1a_Real_Rent_Total__c}" label=""/>
<apex:inputField value="{!Building_Cost__c.CA1a_Real_Rent_Part__c}" label=""/>
</table>

 

Thanks for your help

Ced

 

 

  • July 10, 2012
  • Like
  • 0

I'm writing a visualforce page that is intended to edit values displayed in a table. I'm having some issues with the inlineEditSupport tag, though, in particular with multi-select picklists. If I try to put a column like this in the table,

 

<apex:column styleClass="dataCell">
	<apex:facet name="header">Subtype</apex:facet>
	<apex:outputField value="{!mask.subtype__c}">
		<apex:inlineEditSupport event="ondblclick"/>
	</apex:outputField>
</apex:column>

 then the page loads with a garbage dialog underneath the table that I can't seem to find in the page source:

 

 

Then if I double-click on the field, the dialog gets replaced with a picklist window that's too far off to the left to really see its contents.

 

Anyone know what's going on?

Hi Friends,

 

I have salesforce customer portal which is up and running and assignedd to the production.Now I have to add class and  visual force page to it..

 

I have developed page and apex class in sandbox.However,I am not able to test it as when portal customer logs in ,his inofmation such as firstname,lastname ,email has to be queried and  retrieved from the database .

 

My situation,  when customer registers on the portal his infomation is going directlty in the production .Now ,How do I ensure that when customer enter's his information on the portal then it can go to the test instance(sandbox) so that I can test my class and visual force page functionality.

 

Thanks in advance 

 

Thanks,

Trick

I'm trying to use custom fields of the user object in the email template that's send to new community users. Somehow, the email doesn't show the values of the custom fields. Then I tried some standard user fields like Street and City and found out that these are also empty in the email when creating a new user. Is there a standard set of fields on user you CAN use in the new community user email template?

Winter '12 gives the option to assign a task to multiple users. However, if you create a Visual Force page to overwrite the task edit screen, then the multiple user selection option isn't given in the popup, so you cannot use it there.

Does somebody know if this will become available from within Visual Force? Or maybe I'm overlooking something?

Anyone having troubles using Eclipse today? I keep getting timeouts refreshing or saving classes/pages...

I created a page in Visual Force / Apex where I show 5 google graphs based on figures I get from 6 count() queries. 1 of them counts the total contacts under an account, the other 5 count the contacts based on criteria (like passed course = yes). 

This works fine if the account has less then 100 contacts. I now have an account that has 2700 contacts in total and the script totally fails because the execution time > 120 seconds. When I take a look at the debug log, I notice that the count() queries take very much time to execute, the count of total contacts takes 40 (!) seconds. Our customer doesn't accept this, but I can't figure out how to reduce this. 

 

Anyone here has an idea?

I would like to fill the field 'Entitlement Process' on the object Entitlement automatically with an Apex trigger, but I can't find the field on the object??? Found out that the api name for the field is 'SlaProcess', but the object explorer in the IDE doesn't show the field and the code doesn't recognize the field.
Am i missing something here? The field needs to be saved somewhere?

Hi,

 

I'm trying to create dependent picklists using custom settings in Visual Force and facing a problem. When I change the master picklist I'm getting the error: A4J not defined. I think that's a really strange message, because that's a library salesforce automatically adds when necessary.

Anyone faced this problem before of any ideas how to solve this?

The page doesn't post anything to the server, because it can't find the A4J library/object...

 

A piece of my code:

 

<apex:pageBlockSectionItem >
	<apex:outputLabel value="{!$ObjectType.Task.fields.FR_Type2__c.label}" for="FR_Type2__c" />
	<apex:selectList value="{!task.FR_Type2__c}" id="FR_Type2__c" size="1">
		<apex:selectOptions value="{!FR_Type2_Options}" />
		<apex:actionSupport event="onchange" action="{!refresh}" rerender="thePageBlock" status="status_FR_Aim2" />
	</apex:selectList>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem />
<apex:pageBlockSectionItem >
	<apex:outputLabel value="{!$ObjectType.Task.fields.FR_Aim2__c.label}" />
	<apex:outputPanel >
		<apex:actionStatus id="status_FR_Aim2">
			<apex:facet name="start">
				<apex:image url="{!$Resource.FR_Loader}" />
			</apex:facet>
			<apex:facet name="stop">
				<apex:selectList value="{!task.FR_Aim2__c}" required="true" size="1">
					<apex:selectOptions value="{!FR_Aim2_Options}" />
				</apex:selectList>
			</apex:facet>
		</apex:actionStatus>
	</apex:outputPanel>
</apex:pageBlockSectionItem>

 

 

I'm trying to use custom fields of the user object in the email template that's send to new community users. Somehow, the email doesn't show the values of the custom fields. Then I tried some standard user fields like Street and City and found out that these are also empty in the email when creating a new user. Is there a standard set of fields on user you CAN use in the new community user email template?

Trying to upload a new managed package, this URL:

 

https://na15.salesforce.com/packaging/exportPackage.apexp?p1=033i0000000EisO&p2=41471

 

I get this error:

 

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: 1929777022-196 (782432086)

  • July 20, 2013
  • Like
  • 0

Winter '12 gives the option to assign a task to multiple users. However, if you create a Visual Force page to overwrite the task edit screen, then the multiple user selection option isn't given in the popup, so you cannot use it there.

Does somebody know if this will become available from within Visual Force? Or maybe I'm overlooking something?

Hi,

 

I try to have a table in a visualforce page, but not a repeating table, so i cannot use <apex:dataTable>.

First column with label (big width) and then 2 columns with input fields (smaller width).

 

Have i to use the <apex:inputfield> for the fields ? 

If yes, how can i make them appear on the same line ? They appear always on separate line.

If no, how can i make the <input> related to the SFDC fields so as to save the value in the correct field ?

 

I tried this : 

<table border="1">
<tr><td colspan="2"></td><td  colspan="2">Total</td><td  colspan="2">Part</td></tr>
<apex:outputText >Label bla bla</apex:outputText>
<apex:inputField value="{!Building_Cost__c.CA1a_Real_Rent_Total__c}" label=""/>
<apex:inputField value="{!Building_Cost__c.CA1a_Real_Rent_Part__c}" label=""/>
</table>

 

Thanks for your help

Ced

 

 

  • July 10, 2012
  • Like
  • 0

I'm writing a visualforce page that is intended to edit values displayed in a table. I'm having some issues with the inlineEditSupport tag, though, in particular with multi-select picklists. If I try to put a column like this in the table,

 

<apex:column styleClass="dataCell">
	<apex:facet name="header">Subtype</apex:facet>
	<apex:outputField value="{!mask.subtype__c}">
		<apex:inlineEditSupport event="ondblclick"/>
	</apex:outputField>
</apex:column>

 then the page loads with a garbage dialog underneath the table that I can't seem to find in the page source:

 

 

Then if I double-click on the field, the dialog gets replaced with a picklist window that's too far off to the left to really see its contents.

 

Anyone know what's going on?

Hello,

 

The example provided by Salesforce:

 

<!-- Page: --> 
    

<apex:page controller="repeatCon" id="thePage">

    <apex:repeat value="{!strings}" var="string" id="theRepeat">

        <apex:outputText value="{!string}" id="theValue"/><br/>

    </apex:repeat>

</apex:page>

			

/*** Controller: ***/ 
    

public class repeatCon {



    public String[] getStrings() {

        return new String[]{'ONE','TWO','THREE'};

    }

}

 Displays 

 

<span id="thePage:theRepeat:0:theValue">ONE</span><br/>

<span id="thePage:theRepeat:1:theValue">TWO</span><br/>

<span id="thePage:theRepeat:2:theValue">THREE</span><br/>

 

How can I code it in a way it'll show the following:


ONE

TWO

THREE

 

Instead of

 

<span id="thePage:theRepeat:0:theValue">ONE</span><br/>

 

I plan on doing an export on the VF page using contentType and will display the following

 

<salorder>
"sForce",,,"The Landmark @ One Market",,"San Francisco","CA","94087","US"
"1","00004757" ,"7-9-2012","7-9-2012","0.00","0.00" 
"","1.0000","0.0000","0.00" Fieldworker Rate
</salorder>

 

I should be able to display the following above in the same format, spacing etc. The above would be considered one record so there will be multiple <salorder> </salorder> based off my data construction.

How to remove the action column in a related list in salesforce.Do we have to write a visual force page or Is there an alternative ?

  • July 09, 2012
  • Like
  • 0

Hi Friends,

 

I have salesforce customer portal which is up and running and assignedd to the production.Now I have to add class and  visual force page to it..

 

I have developed page and apex class in sandbox.However,I am not able to test it as when portal customer logs in ,his inofmation such as firstname,lastname ,email has to be queried and  retrieved from the database .

 

My situation,  when customer registers on the portal his infomation is going directlty in the production .Now ,How do I ensure that when customer enter's his information on the portal then it can go to the test instance(sandbox) so that I can test my class and visual force page functionality.

 

Thanks in advance 

 

Thanks,

Trick

Hello,

 

I have a visualforce page with a form I have created as a component.  Within the form component I have included a reference to another component which holds the commandButton.  There are 3 output panels within my form.  Within my component for the commandButton I have entered reRender="myStatus,FormFields,FormActions" . When I click on the button the page just refreshes with all panels redisplayed but this is incorrect as the form should have rerendered with different fields.

If I don't use a component for the commandButton and instead use the code for the commandButton in the form component the panels rerender ok.   is it possible that one component cannot rerender panels in a parent component?

 

Any help on this would be appreciated.   I tried to use a container panel as suggested in the following blog but this did not seem to work either.  http://bobbuzzard.blogspot.co.uk/2011/02/visualforce-re-rendering-woes.html

 

Maybe what I'm trying is not possible?

 

Thanks in advance!

Hi,

 

I am creating a VF page with custom stylesheets ( <apex:page standardStylesheets="false">)

I'm trying to create an registration form which updates my custom object.

 

 

<apex:page sidebar="false" standardStylesheets="false" showHeader="false" controller="MyObjectController">
<head>
<apex:stylesheet value="{!URLFOR($Resource.common, 'common/css/mystyles.css')}"/>
</head>
<body>

<apex:form id="registrationForm">

<table>
<tr>
<th>Name<span class="important">*</span></th>
<td><apex:inputText value="{!myObj.Name}" size="40" maxlength="120" styleClass="input-m"/></td>
</tr>
<tr>
<th>Start date<span class="important">*</span></th>
<td><!--apex:inputField value="{!myObj.start_date__c}" styleClass="input-m"/--></td>
</tr>
</table>

....

 

Everything works fine until I include <apex:InputField> tag with Date type custom field (commented out in the code above).

However, once I uncomment the inputField with myObj.start_date__c (Date type field), my custom styles seemed to be overwritten and styles got messed up.

Seems like when I include Date type field, "common.css" got loaded and override the styles.

 

What is the best way to avoid this problem?

Is there any way to disable loading default stylesheets with Date type inputField?

 

Thanks and best regards,

 

 

  • August 17, 2010
  • Like
  • 0

Anyone having troubles using Eclipse today? I keep getting timeouts refreshing or saving classes/pages...

Hi,

 

I'm trying to create dependent picklists using custom settings in Visual Force and facing a problem. When I change the master picklist I'm getting the error: A4J not defined. I think that's a really strange message, because that's a library salesforce automatically adds when necessary.

Anyone faced this problem before of any ideas how to solve this?

The page doesn't post anything to the server, because it can't find the A4J library/object...

 

A piece of my code:

 

<apex:pageBlockSectionItem >
	<apex:outputLabel value="{!$ObjectType.Task.fields.FR_Type2__c.label}" for="FR_Type2__c" />
	<apex:selectList value="{!task.FR_Type2__c}" id="FR_Type2__c" size="1">
		<apex:selectOptions value="{!FR_Type2_Options}" />
		<apex:actionSupport event="onchange" action="{!refresh}" rerender="thePageBlock" status="status_FR_Aim2" />
	</apex:selectList>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem />
<apex:pageBlockSectionItem >
	<apex:outputLabel value="{!$ObjectType.Task.fields.FR_Aim2__c.label}" />
	<apex:outputPanel >
		<apex:actionStatus id="status_FR_Aim2">
			<apex:facet name="start">
				<apex:image url="{!$Resource.FR_Loader}" />
			</apex:facet>
			<apex:facet name="stop">
				<apex:selectList value="{!task.FR_Aim2__c}" required="true" size="1">
					<apex:selectOptions value="{!FR_Aim2_Options}" />
				</apex:selectList>
			</apex:facet>
		</apex:actionStatus>
	</apex:outputPanel>
</apex:pageBlockSectionItem>

 

 

In Sweden and some other parts of Europe the week numbering is often using the ISO 8601 standard that says that the first week of the year is the first week with at least 4 days in the new year. Some consequences of this is that the final dates of one year can be week 52, 53 or even week 1( in the following year). The same goes for the first dates of a year.

 

To be able to do weekly comparison report Year-to-Year with this weeknumbering it is necessary to create custom fields for the opportunity that calculates the Year and Week number for a given close date. Here is one solution using three custom formula fields.

 

Field: Global Sales Report Weekday

Description:  Day 1 = Sunday, 2 = Monday....., 7=Saturday

Formula:  MOD( CloseDate  - DATE(1900, 1, 7), 7)+1

 

Field: Global Sales Report Week Year

Formula: YEAR(CloseDate + (MOD(8- Global_Sales_Report_Weekday__c ,7)-3))

 

Field: Global Sales Report Week

Formula:

FLOOR((CloseDate - DATE( Global_Sales_Report_Week_Year__c ,1,1) +
MOD(
(MOD( DATE(Global_Sales_Report_Week_Year__c,1,1) - DATE(1900, 1, 7), 7)+1)
+1,7)-3) / 7 + 1)

 

Hope this can be of use for anyone else

 

Peter Baeza

InfoAction AB, Sweden

 

  • March 15, 2010
  • Like
  • 3

Code has worked in the past, and suddenly stopped.  I have simplified it as much as possible ...

 

VF Page:

 

<apex:page standardController="Event">
<apex:form> 
Start: &nbsp;&nbsp; <apex:inputField value="{!event.startdatetime}"/><br/>
End: &nbsp;&nbsp;  <apex:inputField  value="{!event.enddatetime}" /><br/>
<apex:commandButton value="Save"  action="{!save}"/>
</apex:form>

</apex:page>

 

Please assist.

 

Vanya

  • January 06, 2010
  • Like
  • 0

I created a send email class that accepts a bunch of parameters. It's currently used by two visualforce pages and 1 trigger/class.

 

The trigger/class setup is currently failing when I deploy to production. However, when I run the tests in the sandbox it comes back completely fine. The trigger is fired on an update of a case. When I update the case to fire the trigger - I get the expected result (an email).

 

I am creating my objects in the test class - except my Email Template and SF user (which are in both sandbox and production). All other objects - Account, Contact, and Case are created in the test class directly.

 

I added a system.debug('THIS IS THE MAIL:" + mail); to my send email class and this is what I see in the debug log when I deploy.

 

20090417151127.818:Class.Send_Single_Email_Class.SendEmail: line 111, column 9: THIS IS THE MAIL:Messaging.SingleEmailMessage[getBccAddresses=();getCcAddresses=();getCharset=null;getDocumentAttachments=null;getFileAttachments=null;getHtmlBody=null;getPlainTextBody=null;getTargetObjectId=005700000017EbwAAE;getTemplateId=00X70000001F7ESEA0;getToAddresses=(support@pharmacyonesource.com);getWhatId=50070000008R2QFAA0;isUserMail=false;] System.EmailException: SendEmail failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, java.lang.NullPointerException: Argument Error: Parameter value is null

 

 

You can see it stats Unknown_Exception - then tells me a parmaeters is null. I've compared these lines to a successful test that's run (using the same class but on different objects) - and with the exception of the TemplateID (not used) and the specific Email Address/WhatID it looks 100% the same.

 

I thought it might be my template problem - but I'm setting it like this

***Trigger's Class*** EmailTemplate ThisTemplate = [Select e.Id From EmailTemplate e where e.developerName= 'Case_Notification_of_New_Task_or_Comment']; ID TemplateID = ThisTemplate.Id; ***Send Email Class*** mail.setTemplateId(TemplateID); system.debug('Template is Valid: ' + TemplateID);

 

I'm really scratching my head on this one. I figured I must be missing something when I pass things over. But the SendEmail class works with my visualforce pages - just not this Trigger/Class. The main difference is I'm using a template ID and not setting the mail.setToAddresses to anything other than null.

 

Current UnitTest - The Trigger loops through trigger.new and assigns to variables the items passed over to each send email.

 

static testMethod void testTriggerCase_Interface_Before_Insert_Before_Update() 
{
	RecordType CaseRecordType = [Select r.SobjectType, r.Id, r.DeveloperName From RecordType r where r.DeveloperName='Standard' and sObjectType = 'Case'];
	User CSRQueue = [Select u.Username, u.UserRoleId, u.ProfileId, u.ManagerId, u.LastName, u.IsActive, u.Id, u.FirstName, u.Name,u.Email, u.CommunityNickname, u.Alias From User u where u.Id = '005700000017Ebw' and u.IsActive = True limit 1];
			
		Account NewAccount1 = new Account(name='Test Code Account',
			Hospital_Bed_Size__c = -1,
			BillingStreet = '7780 Elmwood Ave',
			BillingCity = 'Middleton', 
			BillingState = 'WI', 
			BillingPostalCode = '5356'
	   	);
	        insert NewAccount1;
		Contact NewContact = new Contact(
	   		LastName='Test',
	   		firstname='Contact',
	   		Email=CSRQueue.Email,
	   		AccountId = NewAccount1.id
	   	);	
	   	insert NewContact;	    
		Implementation__c NewS7IF = new Implementation__c 
	   	(
	   		RecordTypeId = '012500000009EQZ',
	   		Name = 'Test Code Implementation',
	   		Account__c = NewAccount1.id,
	   		//i.Product__c = 'Unit Stock',
	   		Sale_Date__c = date.Today(),
	   		Implementer__c = '005700000017Ebw', //CSR Queue   			
	   		Action_Requirement__c = 'POS',
	   		Stage__c = 'Initiation',
	   		Status__c = 'Moving Along',
	   		Status_Reason__c = 'N/A',
	   		Product__c = 'Sentri7 Interfaces',
	   		Interface_Products__c = 'Quantifi',
	   		Feed_Status__c = 'No Data Received Yet'
	   	);	
	   	insert NewS7IF;	   	
		Case NewStandardCase = new Case
		(
		  OwnerId = '005700000017Ebw', //CSR Queue 
		  //Implementation_Issue__c = ImpIssueTestUnit().id, //Issue to be used 
		  Type = 'Interfaces', 
		  Project_Type__c = 'Hold',
		  Implementation__c = NewS7IF.Id,
		  Products__c = 'Interfaces',		  
		  ContactId = NewContact.Id,
		  Origin = 'Internal',
		  Subject = 'This is a test subject used to test trigger',
		  RecordTypeId = CaseRecordType.Id		
		);
		Case NewStandardCase2 = new Case
		(
		  OwnerId = CSRQueue.ID, //'005700000017Ebw', //CSR Queue 
		  //Implementation_Issue__c = ImpIssueTestUnit().id, //Issue to be used 
		  Type = 'Interfaces', 
		  Project_Type__c = 'Hold',
		  Implementation__c = NewS7IF.Id,
		  Products__c = 'Interfaces',		  
		  ContactId = NewContact.Id, 
		  Origin = 'Internal',
		  Subject = 'This is a test subject used to test trigger2',
		  RecordTypeId = CaseRecordType.Id		
		);
		list<case> InsertCases = new list<case>();
		
		InsertCases.add(NewStandardCase);
		InsertCases.add(NewStandardCase2);			
		insert InsertCases;
		
        NewStandardCase.Notification_to_Owner__c = 1;
        NewStandardCase2.Notification_to_Owner__c = 0;
        list<case> UpdateCases = new list<case>();
        UpdateCases.add(NewStandardCase);
        UpdateCases.add(NewStandardCase2);        
        update UpdateCases;	
				
	} 

 

The Class that calls the SendEmail Class - this is done on a before update. Trigger is fired before update of case, and only cases with Notification_To_Owner__c set to 1 are sent to the NotificationToOwner class method below. The class loops through the list pulling the information and sending the e-mail and also returns the value to Notification_To_Owner__c to 0.

There's a lot of "empty" variables here since they get passed in other classes that use the SendEmail class. When I tested it doesn't appear that anything goes wrong if these are null as long as the required items are also present. (Example either a TemplateID or a HTMl/Plain body)

 

public static void NotificationToOwner(list<case> TheseCases) { set<id> OwnerID = new set<id>(); for(case c: TheseCases) { OwnerID.add(c.OwnerID); } map<id, User> MapUsers = new map<id,user>([Select u.Title, u.ManagerId, u.Id, u.Email From User u where u.id in :OwnerID]); /*Required SendEmail Variables */ list<string> ToEmail = new list<string>(); Contact eContact; list<string> CC = new list<string>(); list<string> BCC = new list<string>(); Boolean eAttach = False; Blob eAttachment; string eName; Boolean Activity = False; ID WhatID; Boolean Attach = False; String aName; String eSubject; String eBody; list<ID> DocAttach = new list<ID>(); EmailTemplate ThisTemplate = [Select e.Id From EmailTemplate e where e.developerName= 'Case_Notification_of_New_Task_or_Comment']; /*This template is present in both Sandbox and Production with the SAME developername */ ID TemplateID = ThisTemplate.Id; ID TargetObjectId; //list<case> UpdateCases = new list<case>(); /*Loop through cases and send Email */ for(case c: thesecases) { ToEmail.Clear(); //ToEmail.add(MapUsers.get(c.OwnerID).Email); WhatID = c.id; TargetObjectID = c.OwnerID; c.Notification_to_Owner__c=0; system.debug('Case Number, Case ID: ' + c.CaseNumber +' ID: '+ c.ID); system.debug('Email Variable OwnerID: ' + c.OwnerID); system.debug('Email Variable Email: ' + ToEmail); system.debug('Email Variable Case WhatID: ' + WhatID); Send_Single_Email_Class.SendEmail(ToEmail,eContact, CC,BCC, eAttach, eAttachment,eName, Activity,WhatId,Attach, aName,eSubject,eBody,DocAttach,TemplateID,TargetObjectID); } }