• Stevev
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 15
    Replies

I want to provide my users a broader experience with the UI than is provided by the standard UI (not meant as a criticism it does a good job).

 

As the platform is opening up with the Google Visualization API I figure that I should be able to do the same using the jQuery library and the datePicker feature. I've written a simple example that shows 2 date fields. The first is a standard javascript text field implementation using the jQuery library (this also makes sure I'm picking up the library successfully). The second is  the Birthdate field for a Contact. I applied the id and style but is not overriding the standard implementation. Anyone implemented this?

 

 

<apex:page id="thePage" standardController="Contact">

<!-- Load libraries -->

<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  
  <script>
  $(document).ready(function() {
    $("#datepicker").datepicker();
  });
  </script>
</head>
  
  <apex:form >
  <apex:pageBlock>
  
  <apex:pageblockSection>
  <div type="text" id="datepicker" style="font-size:62.5%;"></div> 
  
  </apex:pageblockSection>
  </apex:pageBlock>
  <apex:pageBlock>
  
  <apex:pageblockSection>
  <apex:inputfield value="{!Contact.Birthdate}" id="datepicker" style="font-size:62.5%;"/>
  <apex:pageBlockSectionItem />
  </apex:pageblockSection>
  </apex:pageBlock>
  
  </apex:form>
</apex:page>

 I have seen some examples where the library is uploaded as a static resource but I don't think that should be necessary when using an Open Source library unless there is some security concerns. Any ideas would be appreciated.

 

  • January 04, 2011
  • Like
  • 0

I found a great example (there are probably many but follow link for code example) on the Decoding Salesforce site by Allesandro that uses the Google API to display the Google map and it work like a charm on Accounts. I then took the same code and applied it to the VF page inside a PageBlockSection for a custom object that has address fields and again works well. However, the page I used it on is also part of a tabbed set of pages and the tabs no longer work.

 

Has anyone experienced the same issue? The VF code based on the Account Sobject is:

 

 

<apex:page standardController="Account">

<head>

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">

$(document).ready(function() {

var myOptions = {
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: false
}

var map;
var marker;

var geocoder = new google.maps.Geocoder();
var address = "{!Account.BillingStreet}, " + "{!Account.BillingCity}, " + "{!Account.BillingPostalCode}, " + "{!Account.BillingCountry}";

var infowindow = new google.maps.InfoWindow({
content: "<b>{!Account.Name}</b><br>{!Account.BillingStreet}<br>{!Account.BillingCity}, {!Account.BillingPostalCode}<br>{!Account.BillingCountry}"
});

geocoder.geocode( { address: address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK && results.length) {
if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {

//create map
map = new google.maps.Map(document.getElementById("map"), myOptions);

//center map
map.setCenter(results[0].geometry.location);

//create marker
marker = new google.maps.Marker({
position: results[0].geometry.location,
map: map,
title: "{!Account.Name}"
});

//add listeners
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});
google.maps.event.addListener(infowindow, 'closeclick', function() {
map.setCenter(marker.getPosition());
});

}

} else {
$('#map').css({'height' : '15px'});
$('#map').html("Oops! {!Account.Name}'s billing address could not be found, please make sure the address is correct.");
resizeIframe();
}
});

function resizeIframe() {
var me = window.name;
if (me) {
var iframes = parent.document.getElementsByName(me);
if (iframes && iframes.length == 1) {
height = document.body.offsetHeight;
iframes[0].style.height = height + "px";
}
}
}

});
</script>

<style>
#map {
font-family: Arial;
font-size:12px;
line-height:normal !important;
height:250px;
background:transparent;
}
</style>

</head>

<body>
<div id="map"></div>
</body>
</apex:page>

 

Thanks!

 

 

  • October 25, 2010
  • Like
  • 0

I have multiple orgs and want to be able to distinguish between single currency and multi currency org implementations. I'm using the UserInfo method "IsMultiCurrencyOrganization". I have a class and Apex code that works in a multicurrency org but the VF page won't compile when on a non multi currency org. It looks like the IsoCurrency field is not recognized which renders the whole idea of using the Boolean IsMultiCurrencyOrganization to test unworkable.

 

Anyone had experience with this problem?  The code example I used is below and has the following:

 

Custom Object:  Test_Userinfo__c with a single currency field called Payment__c

VF Page: UserInfoNew

Class: UserInfoExtension

 

The VF compile error:

Could not resolve field 'CurrencyIsoCode' from <apex:inputField> value binding '{!Test_Userinfo__c.CurrencyIsoCode}'    

 

 

public with sharing class UserInfoExtension {

Boolean multicurrency = false;

public UserInfoExtension(ApexPages.StandardController controller) {

}

Public Boolean getMultiCurrency() {

multicurrency = UserInfo.IsMultiCurrencyOrganization();

return multicurrency;

}
}

 

<apex:page standardController="Test_Userinfo__c"
extensions="UserInfoExtension">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:inputField value="{!Test_Userinfo__c.Name}"/>
<apex:inputField value="{!Test_Userinfo__c.Payment__c}"/>

<apex:inputField value="{!Test_Userinfo__c.CurrencyIsoCode}" rendered="{!MultiCurrency}"/>

</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

 

 

  • August 04, 2010
  • Like
  • 0

I have an object Foo that stores the date a picklist status is changed. Right now it changes on any object update (in other words it reflect the "last modified" date of the object) but I want to narrow the condition to only write the date if the specific picklist changes value to enable me to generate formula results based on the length of time in a specific status.

 

I tried using PRIORVALUE to detect that the picklist changed but since it is a picklist it won't compile.

 

Has anyone got an example where a trigger performs an action based a change to a picklist value on an object? Any ideas?

 

 

trigger FooStatusChange on Foo__c (before update) {
  
  if (Trigger.isUpdate) {
      for (Foo__c a: Trigger.new) {
        a.date_status_changed__c = System.today();
        }
  }

}

 

 

I have a tabbed set of VF pages and to help navigation I added a "hard coded" custom link:

 

<a href="https://mySFinstanceGoesHere/a0O/o">Return to View</a

 

 

I want to generalize it for all instances using a global variable similar to  {!$Organization.xxxxx} say so that it looks something like:

 

 

<a href="https://{!$Organization.xxxx}/a0O/o">Return to View</a

 

That would allow it to work for all instances. 

 

 

I posted it as SF Case but their response was "Unfortunately we don't really support the creation of custom links or buttons"? A strange reply given that custom objects have a dedicated feature for "Custom Buttons and Links" and documentation around linking to Google. 

 

Any help would be appreciated. 

  • February 10, 2010
  • Like
  • 0

I have custom objects using VF pages where the Tagging feature has been activated but the tagging panel is not available in the VF page but is displayed in the standard SF page. I have not found a solution in the community site and searching on the word "Tagging" unfortunately brings up way too many topics on unrelated html tag issues etc. The SF documentation covers how to implement the functionality but I have not found an example in the context of Apex.

 

I checked to see if showHeaders="true" is affecting the page but it doesn't appear to be involved.How do I implement the Tagging feature in a VF page? Is there a "true"/"false" attribute setting for example?

  • February 09, 2010
  • Like
  • 0
In an Apex page does anyone know how to show the field help text (the standard question mark next to the field) when using <apex:inputField if the showHeader="false"? I noticed that in my apex code, fields show their help text when showHeaders="true" but disappears as soon as I set showHeaders to "false". Is there an attribute that needs to be set somewhere?
  • January 07, 2010
  • Like
  • 0

I'm working on a tabbed page and have set up a test control of 3 objects: Test Object A (parent object), Test Object B and Test Object C (both children of A). FYI: I did this to prevent confusing the issue with specific SF application functionality.

 

The tabbed page works fine but the default navigation is not how I would expect.

 

The scenario:  when I select a specific transaction from my list of Test Object A items it display the tabs for Test Objects A, B & C as expected. I select tab C to display the values in the Test Object C related list (OK so far). I select a row to edit a Test Object C record which is managed by a simple Apex page. Up to this point everything is working as expected. However if I save or cancel and move from the Test Object C edit page I'm returned to the tabbed page with the focus on Test Object A but I really want to be returned to Test Object C tab in focus.

 

As far as I can see there is nothing in the URL that indicates how tab focus is controlled in a tabbed page.  My guess is that the solution lies in adding code in the controller extension using "PageReference" perhaps?

 

Control of the tab focus would allow me to push a user to a specific tab based on data entered (like a wizard inside a tabbed page).

I've looked on the boards but not found any definitive solutions or suggested best practice.

 

Thanks in advance for any comments.

 

Tabbed Page:

 

<apex:page standardController="test_object_A__c" extensions="TestObjectExtension" showHeader="true" standardStylesheets="false" tabStyle="test_object_A__c"> <apex:stylesheet value="{!$Resource.Style2}"/> <apex:tabPanel switchType="client" selectedTab="tabTestObjectDetails" id="ObjectTabPanel" tabClass="activeTab" inactiveTabClass="inactiveTab" value="{!TabInFocus}"> <apex:tab label="Object A" name="test_object_A__c" id="tabTestObjectDetails"> <apex:detail relatedList="false" title="true"/> </apex:tab> <apex:tab label="Object B" name="Test_Object_B__r" id="tabObjectB"> <apex:relatedList subject="{!test_object_A__c}" list="Test_Object_B__r"/> </apex:tab> <apex:tab label="Object C" name="Test_Object_C__r" id="tabObjectC"> <apex:relatedList subject="{!test_object_A__c}" list="Test_Object_C__r"/> </apex:tab> <apex:tab label="Approvals" name="ProcessSteps" id="tabApproval"> <apex:relatedList subject="{!test_object_A__c}" list="ProcessSteps"/> </apex:tab> </apex:tabPanel></apex:page>

 Test Object C Page:

 

<apex:page standardController="test_object_C__c" id="p" extensions="TestObjectCExtension" showHeader="true" tabStyle="test_object_C__c"> <apex:form > <apex:pageBlock title="Test Object C" > <apex:pageBlockButtons location="both"> <apex:commandButton value="Save" action="{!save}"/> <apex:commandButton value="Cancel" action="{!cancel}"/> </apex:pageBlockButtons> <apex:pageBlockSection > <apex:inputField value="{!test_object_C__c.name}"/> <apex:inputField value="{!test_object_C__c.Test_Object_A__c}"/> <apex:inputField value="{!test_object_C__c.Test_Amount__c}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form></apex:page>

 Custom Controller Extension:

 

public with sharing class TestObjectExtension { private final test_object_A__c testObj; public TestObjectExtension(ApexPages.StandardController controller) { this.testObj = (test_object_A__c)controller.getSubject(); } String tabInFocus = System.currentPageReference().getParameters().get('tab'); public String getTabInFocus() { return tabInFocus; } public void setTabInFocus( String s ) { this.tabInFocus = s; } }

 

 

 

 

 

 

 

  • November 25, 2009
  • Like
  • 0

I'm using tabbed VF pages quite a bit and added in the <style> tag for inline CSS as per the cook book example and it worked great. What I tried to do next is to move the styles to an external style sheet. Unfortunately the cook book doesn't explain what to me is the next obvious requirement (a future improvement in the documentation perhaps?). The style sheet tag seems to be ignored. Can anyone suggest what I'm doing wrong? Below is the source for test objects to try things out.

 

I imported the style sheet as a Static resource file (Style2.css):

 

@charset "ISO-8859-1";

 

.activeTab {background-color: #236FBD; color:white;

            background-image:none}

            

inactiveTab {background-color: lightgrey;

             color:black;

             background-image:none}

 

Page:

 

<apex:page standardController="test_object_A__c" extensions="TestObjectExtension" showHeader="true" tabStyle="test_object_A__c"> <apex:stylesheet value="!$Resource.Style2}"/> <apex:tabPanel switchType="client" selectedTab="tabTestObjectDetails" id="ObjectTabPanel" tabClass="activeTab" inactiveTabClass="inactiveTab" value="{!TabInFocus}"> <apex:tab label="Object A" name="Test_object_A__c" id="tabTestObjectDetails"> <apex:detail relatedList="false" title="true"/> </apex:tab> <apex:tab label="Object B" name="Test_Object_B__r" id="tabObjectB"> <apex:relatedList subject="{!test_object_A__c}" list="Test_Object_B__r"/> </apex:tab> <apex:tab label="Object C" name="Test_Object_C__r" id="tabObjectC"> <apex:relatedList subject="{!test_object_A__c}" list="Test_Object_C__r"/> </apex:tab> <apex:tab label="Approvals" name="ProcessSteps" id="tabApproval"> <apex:relatedList subject="{!test_object_A__c}" list="ProcessSteps"/> </apex:tab> </apex:tabPanel> 

</apex:page> 

  • November 23, 2009
  • Like
  • 0

 

Is there a way to tell programmatically that a user logged in via (SAML) SSO?  Our users  have a choice of regular login, or via SAML SSO.  The type of login is reflected in the user login history log.  Is there a way to tell in code?  The reason for this is to have a different navigation/behavior, depending on type of login performed.   thank you!!

Hi,

 

I'm a non programmer Salesforce Administrator and one of my clients is requering to integrate information from Drupal to Salesforce. I found different modules in the Drupal module list.

 

Can anyone recomend me which one to use for a very simple integration, of not many records and most probably one way.

 

Thank you,

Carolina

I want to provide my users a broader experience with the UI than is provided by the standard UI (not meant as a criticism it does a good job).

 

As the platform is opening up with the Google Visualization API I figure that I should be able to do the same using the jQuery library and the datePicker feature. I've written a simple example that shows 2 date fields. The first is a standard javascript text field implementation using the jQuery library (this also makes sure I'm picking up the library successfully). The second is  the Birthdate field for a Contact. I applied the id and style but is not overriding the standard implementation. Anyone implemented this?

 

 

<apex:page id="thePage" standardController="Contact">

<!-- Load libraries -->

<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  
  <script>
  $(document).ready(function() {
    $("#datepicker").datepicker();
  });
  </script>
</head>
  
  <apex:form >
  <apex:pageBlock>
  
  <apex:pageblockSection>
  <div type="text" id="datepicker" style="font-size:62.5%;"></div> 
  
  </apex:pageblockSection>
  </apex:pageBlock>
  <apex:pageBlock>
  
  <apex:pageblockSection>
  <apex:inputfield value="{!Contact.Birthdate}" id="datepicker" style="font-size:62.5%;"/>
  <apex:pageBlockSectionItem />
  </apex:pageblockSection>
  </apex:pageBlock>
  
  </apex:form>
</apex:page>

 I have seen some examples where the library is uploaded as a static resource but I don't think that should be necessary when using an Open Source library unless there is some security concerns. Any ideas would be appreciated.

 

  • January 04, 2011
  • Like
  • 0

I have tried to import data for a custom object that tracks ticket purchases for our organization. According to the import wizard:

 

"Ticket Details records have lookup relationship fields that you can set to link Ticket Details with existing records in salesforce.com."

 

The lookup relationship fields that we are trying to link are existing Person Accounts. The wizard seems to recognize all of the fields that we've mapped in the csv file, but when the ticket detail is created, it does not contain the "Purchaser" field (Person Account Name). This is problematic because it is just creating ticketing details without linking to the appropriate account.

 

Does anyone have any experience with this? Any known fixes that would enable us to import this custom object while linking it to Person Accounts?

 

Thanks in advance!

I have a tabbed set of VF pages and to help navigation I added a "hard coded" custom link:

 

<a href="https://mySFinstanceGoesHere/a0O/o">Return to View</a

 

 

I want to generalize it for all instances using a global variable similar to  {!$Organization.xxxxx} say so that it looks something like:

 

 

<a href="https://{!$Organization.xxxx}/a0O/o">Return to View</a

 

That would allow it to work for all instances. 

 

 

I posted it as SF Case but their response was "Unfortunately we don't really support the creation of custom links or buttons"? A strange reply given that custom objects have a dedicated feature for "Custom Buttons and Links" and documentation around linking to Google. 

 

Any help would be appreciated. 

  • February 10, 2010
  • Like
  • 0

I have custom objects using VF pages where the Tagging feature has been activated but the tagging panel is not available in the VF page but is displayed in the standard SF page. I have not found a solution in the community site and searching on the word "Tagging" unfortunately brings up way too many topics on unrelated html tag issues etc. The SF documentation covers how to implement the functionality but I have not found an example in the context of Apex.

 

I checked to see if showHeaders="true" is affecting the page but it doesn't appear to be involved.How do I implement the Tagging feature in a VF page? Is there a "true"/"false" attribute setting for example?

  • February 09, 2010
  • Like
  • 0
In an Apex page does anyone know how to show the field help text (the standard question mark next to the field) when using <apex:inputField if the showHeader="false"? I noticed that in my apex code, fields show their help text when showHeaders="true" but disappears as soon as I set showHeaders to "false". Is there an attribute that needs to be set somewhere?
  • January 07, 2010
  • Like
  • 0

I'm working on a tabbed page and have set up a test control of 3 objects: Test Object A (parent object), Test Object B and Test Object C (both children of A). FYI: I did this to prevent confusing the issue with specific SF application functionality.

 

The tabbed page works fine but the default navigation is not how I would expect.

 

The scenario:  when I select a specific transaction from my list of Test Object A items it display the tabs for Test Objects A, B & C as expected. I select tab C to display the values in the Test Object C related list (OK so far). I select a row to edit a Test Object C record which is managed by a simple Apex page. Up to this point everything is working as expected. However if I save or cancel and move from the Test Object C edit page I'm returned to the tabbed page with the focus on Test Object A but I really want to be returned to Test Object C tab in focus.

 

As far as I can see there is nothing in the URL that indicates how tab focus is controlled in a tabbed page.  My guess is that the solution lies in adding code in the controller extension using "PageReference" perhaps?

 

Control of the tab focus would allow me to push a user to a specific tab based on data entered (like a wizard inside a tabbed page).

I've looked on the boards but not found any definitive solutions or suggested best practice.

 

Thanks in advance for any comments.

 

Tabbed Page:

 

<apex:page standardController="test_object_A__c" extensions="TestObjectExtension" showHeader="true" standardStylesheets="false" tabStyle="test_object_A__c"> <apex:stylesheet value="{!$Resource.Style2}"/> <apex:tabPanel switchType="client" selectedTab="tabTestObjectDetails" id="ObjectTabPanel" tabClass="activeTab" inactiveTabClass="inactiveTab" value="{!TabInFocus}"> <apex:tab label="Object A" name="test_object_A__c" id="tabTestObjectDetails"> <apex:detail relatedList="false" title="true"/> </apex:tab> <apex:tab label="Object B" name="Test_Object_B__r" id="tabObjectB"> <apex:relatedList subject="{!test_object_A__c}" list="Test_Object_B__r"/> </apex:tab> <apex:tab label="Object C" name="Test_Object_C__r" id="tabObjectC"> <apex:relatedList subject="{!test_object_A__c}" list="Test_Object_C__r"/> </apex:tab> <apex:tab label="Approvals" name="ProcessSteps" id="tabApproval"> <apex:relatedList subject="{!test_object_A__c}" list="ProcessSteps"/> </apex:tab> </apex:tabPanel></apex:page>

 Test Object C Page:

 

<apex:page standardController="test_object_C__c" id="p" extensions="TestObjectCExtension" showHeader="true" tabStyle="test_object_C__c"> <apex:form > <apex:pageBlock title="Test Object C" > <apex:pageBlockButtons location="both"> <apex:commandButton value="Save" action="{!save}"/> <apex:commandButton value="Cancel" action="{!cancel}"/> </apex:pageBlockButtons> <apex:pageBlockSection > <apex:inputField value="{!test_object_C__c.name}"/> <apex:inputField value="{!test_object_C__c.Test_Object_A__c}"/> <apex:inputField value="{!test_object_C__c.Test_Amount__c}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form></apex:page>

 Custom Controller Extension:

 

public with sharing class TestObjectExtension { private final test_object_A__c testObj; public TestObjectExtension(ApexPages.StandardController controller) { this.testObj = (test_object_A__c)controller.getSubject(); } String tabInFocus = System.currentPageReference().getParameters().get('tab'); public String getTabInFocus() { return tabInFocus; } public void setTabInFocus( String s ) { this.tabInFocus = s; } }

 

 

 

 

 

 

 

  • November 25, 2009
  • Like
  • 0

I'm using tabbed VF pages quite a bit and added in the <style> tag for inline CSS as per the cook book example and it worked great. What I tried to do next is to move the styles to an external style sheet. Unfortunately the cook book doesn't explain what to me is the next obvious requirement (a future improvement in the documentation perhaps?). The style sheet tag seems to be ignored. Can anyone suggest what I'm doing wrong? Below is the source for test objects to try things out.

 

I imported the style sheet as a Static resource file (Style2.css):

 

@charset "ISO-8859-1";

 

.activeTab {background-color: #236FBD; color:white;

            background-image:none}

            

inactiveTab {background-color: lightgrey;

             color:black;

             background-image:none}

 

Page:

 

<apex:page standardController="test_object_A__c" extensions="TestObjectExtension" showHeader="true" tabStyle="test_object_A__c"> <apex:stylesheet value="!$Resource.Style2}"/> <apex:tabPanel switchType="client" selectedTab="tabTestObjectDetails" id="ObjectTabPanel" tabClass="activeTab" inactiveTabClass="inactiveTab" value="{!TabInFocus}"> <apex:tab label="Object A" name="Test_object_A__c" id="tabTestObjectDetails"> <apex:detail relatedList="false" title="true"/> </apex:tab> <apex:tab label="Object B" name="Test_Object_B__r" id="tabObjectB"> <apex:relatedList subject="{!test_object_A__c}" list="Test_Object_B__r"/> </apex:tab> <apex:tab label="Object C" name="Test_Object_C__r" id="tabObjectC"> <apex:relatedList subject="{!test_object_A__c}" list="Test_Object_C__r"/> </apex:tab> <apex:tab label="Approvals" name="ProcessSteps" id="tabApproval"> <apex:relatedList subject="{!test_object_A__c}" list="ProcessSteps"/> </apex:tab> </apex:tabPanel> 

</apex:page> 

  • November 23, 2009
  • Like
  • 0

hi

 

Can u please tell me how to set SetReplyTo option for an Visualforce email template. by default it takes the User email id. but i want to change the reply to email address. how can i do this. please help me

Hi there, 

 

We're running a Sites application at http://citizenschools.force.com/ctapp/ that allows people to sign up to be volunteers with our organization.

 

On Sunday, 10/11 at 11:30PM EST, we suddenly started to receive Apex Application errors (no changes had been made to the system that day, or in the preceding days).  

 

The error is:

 

Apex script unhandled exception by user/organization: 00540000000oi8Q/00D400000008qgXVisualforce Page: /ctapp/apex/CT_Application_Page4System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: CT_Application__c.Region__cClass.ctApplicationPage4.<init>: line 17, column 14External entry pointDebug Log:

 

Any ideas about what could have gone wrong, and where? We're thinking it's a permissions/access issue, but nothing seems to have changed!

 

Thanks so much,

--Dave