• Bob Nagy
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 5
    Questions
  • 6
    Replies
I have a visualforce page that includes a pageBlockTable that has one readonly text column and 6 inputField columns (sort of like a spreadsheet).  The method associated with the value attribute of the pageBlockTable (getStageSpecificSCSettings()) passes the table a list of custom objects and the table is used to edit those objects. The problem is that 2 of the columns are checkbox fields and the initial display of the page shows those checkboxes checked even though the value in the field in the database is unchecked (false).  What's crazy is there is another column that is also an inputField of a checkbox field and it, along with the 3 text fields display the proper state of the checkbox.

Now you are probably thinking that I forgot to include the to misbehaving fields in the query of the records to be supplied to the data table but that's not it - I checked about a hundred times.  In fact, I put debug statements to inspect the state of the checkboes in the list of objects just before the collection is sent to the data table and the values in the objects are reflective of their state in the database (and the same value displayed on the View version of this same page).

If that is not wired enough, I have other logic on the page that if you click option button A the page rerenders and the data table is hidden.  If you click on option button B the page redisplays and the data table is displayed again and this time the value are correct!

There is NO immediate="true" anywhere on the page as I have seen references to that causing issues with chechbox rendering.

Here is the section of the VF page that shows the data table.  The "Active" and "Email Alert" columns are the chechbox fields that don't work, the "Chatter Post" column is a checkbox field that does work:
<apex:pageBlockSection columns="1"  >
  <apex:pageBlockTable value="{!StageSpecificSCSettings}" 
                                             var="SCS" id="SettingsList" 
	                                      rowClasses="odd,even" 
                                               styleClass="tableClass" 
                                               rows="100" 
                                                frame="none" >
	                                       
   <apex:column headerValue="Stage" >
	 <apex:outputText value="{!SCS.Opportunity_Stage_Name__c}" />
   </apex:column> 
	                   	                    
   <apex:column headerValue="Active" >
      <apex:inputField value="{!SCS.Active__c}" />
   </apex:column>  
	
   <apex:column headerValue="Email Alert" >
      <apex:inputField value="{!SCS.Send_Email_Alert__c}" />
   </apex:column> 
	                    
   <apex:column headerValue="Chatter Post" >
      <apex:inputField value="{!SCS.Post_Chatter_Alert__c}" />
   </apex:column> 
	                    
   <apex:column headerValue="Setting Value"  >
       <apex:inputField value="{!SCS.Param1_Value__c}" />
    </apex:column> 
	                    
   <apex:column headerValue="Alert Score" >
	<apex:inputField value="{!SCS.Status_Alert_Score__c}" />
   </apex:column> 
	                    
   <apex:column headerValue="Alert Text" >
      <apex:inputField value="{!SCS.Status_Alert_Text__c}"  />
   </apex:column> 
                                               
</apex:pageBlockTable>
</apex:pageBlockSection>
The controller method that supplies the list of custom objects looks like this:
public list<InSituOsm__Status_Check_Setting__c> getStageSpecificSCSettings() 
{	  		 		
 	
	for (InSituOsm__Status_Check_Setting__c s : m_listSCSettings)
	{	 	
		system.debug('+++Check RECORDS: ' + s.Opportunity_Stage_Name__c);
		system.debug('++++++Active  = : ' + s.Active__c); 
		system.debug('++++++Email   = : ' + s.Send_Email_Alert__c);
		system.debug('++++++Chatter = : ' + s.Post_Chatter_Alert__c);
	}
 	
 	return m_listSCSettings;
}
The debug statements confirm that the values in the sObject fields are consistent with the values in the database but when the data table displays them they are NOT correct for the first two checkbox fields but are correctly displayed for the 3rd checkbox field.

I have tried changing the order of the columns, changing the data table to only display one of the checkboxes that is misbehaving, changing the controller method to perform the database query in the method that returns the collection of records rather than the constructor and nothing seems to work.  I did discover that value that is always initially displayed id the default value of the field definition.  Right now the two misbehaving checkboxes always initially display as checked but if I chhange the default value on the fields to Unchecked then the checkboxs initially display as unchecked.

It feels like a SF bug but surley others would be seeing this if it were.  All ideas are welcome - Thanks!


 
A simple format call on a datetime is return the wrong value.  A year that should be 2015 is coming back 2016.  Am I missing something?

Here is a simple 3 line code example that demonstrates the problem:
 
// Create a DateTime of December 27, 2015
datetime dtTemp = DateTime.newInstance(2015, 12, 27, 0,0,0);
// Format that Date Time - Should Be; December 27, 2015
String sFormatedDate = dtTemp.format('MMMM d, YYYY');
system.debug('++++++++++++++++++Formatted Date  = ' + sFormatedDate);
// Actual is coming back December 27,2016

 
A simple format call on a datetime is return the wrong value.  A yaer that should be 2015 is coming back 2016.  Am I missing something?

Here is a simple 3 line code example that demonstrates the problem:
 
// Create a DateTime of December 27, 2015
datetime dtTemp = DateTime.newInstance(2015, 12, 27, 0,0,0);
// Format that Date Time - Should Be; December 27, 2015
String sFormatedDate = dtTemp.format('MMMM d, YYYY');
system.debug('++++++++++++++++++Formatted Date  = ' + sFormatedDate);
// Actual is coming back December 27,2016

 
With Winter 15 SF chnaged the Task Notification model to allow the task assignee rater than task creator to control whether an email notice is sent.  Does anyone know if a given user's Task Notification setting is available anyplce that can be queried in Apex.  I assumed it would be a new attribute on the User object but could not find anything there.
In Winter 15 (not yet released as of this post) the standard New Task notification sent by SF has values of null in the Name and Related to fields of the email message when a task is created via Apex and the assigned to user is configured to be notified when they are assigned a task.  I know the values of the whoId and WhatId are set correctly because they are displaying fine when viewing the task in the SF app.  This seems to only be a problem when creating the task via Apex in Winter 15.

Anyone else seeing this or know if SF is aware of the problem?  Not listed on the Known Issues and I can't find where one is supposed to report bugs found in prerelease versions.
We have apex classes through which we send emails based on user action in force.com sites. It was working great until Friday, But yesterday when one of our customer try to submit application, they were getting error, In debug it says “SendEmail failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, INVALID_TYPE: sObject type 'SalesforceIqDataSource' is not supported.: []”. I am pretty sure we did not change anything related to apex class, email template, vf page etc.. Does anyone know the reason or best way to fix this?
I have a visualforce page that includes a pageBlockTable that has one readonly text column and 6 inputField columns (sort of like a spreadsheet).  The method associated with the value attribute of the pageBlockTable (getStageSpecificSCSettings()) passes the table a list of custom objects and the table is used to edit those objects. The problem is that 2 of the columns are checkbox fields and the initial display of the page shows those checkboxes checked even though the value in the field in the database is unchecked (false).  What's crazy is there is another column that is also an inputField of a checkbox field and it, along with the 3 text fields display the proper state of the checkbox.

Now you are probably thinking that I forgot to include the to misbehaving fields in the query of the records to be supplied to the data table but that's not it - I checked about a hundred times.  In fact, I put debug statements to inspect the state of the checkboes in the list of objects just before the collection is sent to the data table and the values in the objects are reflective of their state in the database (and the same value displayed on the View version of this same page).

If that is not wired enough, I have other logic on the page that if you click option button A the page rerenders and the data table is hidden.  If you click on option button B the page redisplays and the data table is displayed again and this time the value are correct!

There is NO immediate="true" anywhere on the page as I have seen references to that causing issues with chechbox rendering.

Here is the section of the VF page that shows the data table.  The "Active" and "Email Alert" columns are the chechbox fields that don't work, the "Chatter Post" column is a checkbox field that does work:
<apex:pageBlockSection columns="1"  >
  <apex:pageBlockTable value="{!StageSpecificSCSettings}" 
                                             var="SCS" id="SettingsList" 
	                                      rowClasses="odd,even" 
                                               styleClass="tableClass" 
                                               rows="100" 
                                                frame="none" >
	                                       
   <apex:column headerValue="Stage" >
	 <apex:outputText value="{!SCS.Opportunity_Stage_Name__c}" />
   </apex:column> 
	                   	                    
   <apex:column headerValue="Active" >
      <apex:inputField value="{!SCS.Active__c}" />
   </apex:column>  
	
   <apex:column headerValue="Email Alert" >
      <apex:inputField value="{!SCS.Send_Email_Alert__c}" />
   </apex:column> 
	                    
   <apex:column headerValue="Chatter Post" >
      <apex:inputField value="{!SCS.Post_Chatter_Alert__c}" />
   </apex:column> 
	                    
   <apex:column headerValue="Setting Value"  >
       <apex:inputField value="{!SCS.Param1_Value__c}" />
    </apex:column> 
	                    
   <apex:column headerValue="Alert Score" >
	<apex:inputField value="{!SCS.Status_Alert_Score__c}" />
   </apex:column> 
	                    
   <apex:column headerValue="Alert Text" >
      <apex:inputField value="{!SCS.Status_Alert_Text__c}"  />
   </apex:column> 
                                               
</apex:pageBlockTable>
</apex:pageBlockSection>
The controller method that supplies the list of custom objects looks like this:
public list<InSituOsm__Status_Check_Setting__c> getStageSpecificSCSettings() 
{	  		 		
 	
	for (InSituOsm__Status_Check_Setting__c s : m_listSCSettings)
	{	 	
		system.debug('+++Check RECORDS: ' + s.Opportunity_Stage_Name__c);
		system.debug('++++++Active  = : ' + s.Active__c); 
		system.debug('++++++Email   = : ' + s.Send_Email_Alert__c);
		system.debug('++++++Chatter = : ' + s.Post_Chatter_Alert__c);
	}
 	
 	return m_listSCSettings;
}
The debug statements confirm that the values in the sObject fields are consistent with the values in the database but when the data table displays them they are NOT correct for the first two checkbox fields but are correctly displayed for the 3rd checkbox field.

I have tried changing the order of the columns, changing the data table to only display one of the checkboxes that is misbehaving, changing the controller method to perform the database query in the method that returns the collection of records rather than the constructor and nothing seems to work.  I did discover that value that is always initially displayed id the default value of the field definition.  Right now the two misbehaving checkboxes always initially display as checked but if I chhange the default value on the fields to Unchecked then the checkboxs initially display as unchecked.

It feels like a SF bug but surley others would be seeing this if it were.  All ideas are welcome - Thanks!


 
A simple format call on a datetime is return the wrong value.  A year that should be 2015 is coming back 2016.  Am I missing something?

Here is a simple 3 line code example that demonstrates the problem:
 
// Create a DateTime of December 27, 2015
datetime dtTemp = DateTime.newInstance(2015, 12, 27, 0,0,0);
// Format that Date Time - Should Be; December 27, 2015
String sFormatedDate = dtTemp.format('MMMM d, YYYY');
system.debug('++++++++++++++++++Formatted Date  = ' + sFormatedDate);
// Actual is coming back December 27,2016

 
With Winter 15 SF chnaged the Task Notification model to allow the task assignee rater than task creator to control whether an email notice is sent.  Does anyone know if a given user's Task Notification setting is available anyplce that can be queried in Apex.  I assumed it would be a new attribute on the User object but could not find anything there.

Hi all,

 

I have a question is it possible to show visualforce page on the page layout when I hit edit button ? My case is I want to show the visualforce page and standar page layout at the same time on page layout in edit mode. Is is possible to do that? Or maybe there is other suggestions for may case would be great.

 

Thanks

 

Regards,

 

Edwin

We are currently working on the requirement of using contact merge process. During the salesforce contact merge process, the system first deletes the duplicate contacts and then repoints the related records to the master contact that is to remain. As per the link below, the MasterRecordId is only available after the delete happens and after delete trigger.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_merge_statements.htm

We have a before delete trigger in our org that checks to see if a contact has related records as well as other conditions and based on that information, it allows the contact to be deleted or stops a user from deleting the contact. Our before trigger as it is currently written, stops the merge process. We are so far unable to find a way to identify within the transaction that the delete is occurring due to a merge so that we can handle merge process within the trigger. We are looking to see if someone might help with this tricky issue? We haven’t been able to identify something in the documentation of the merge process that will help us rewrite the trigger code.