• tobibeer
  • NEWBIE
  • 50 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 12
    Questions
  • 14
    Replies

Hi,

other than going through individual releases (http://developer.force.com/releases/release), anyone know of or have a comprehensive, yet concise list of what topics where touched in each release — just the headline and perhaps a short summary and a link to further resources — preferably categorized by product (sales-cloud, service-cloud, force.com, etc.) and further labels?

Thanks, Tobias.

Hi everyone,

 

I am a bit stumped to find myself unable to query Non-ASCII unicode characters using SOSL.

 

For example, take a word containing a German Umlaut like Äpfel and put it into the name or some other textfield you are querying.

 

How does one have to construct the SOSL query so that it actually returns something?

 

Researching for information on how to do this did not yield any helpful clues. I even created a class to convert all characters to their unicode representation and stuffed that into the sosl query without luck.

 

After some more testing it seems to get even worse.

 

Not only does my SOSL query not retrieve results for words containing non-ASCII characters. If I search for a word made of pure ASCII characters that is also contained in a record which has a non-ASCII word in it, SOSL does NOT retrieve it like it does retrieve other records?!?

 

I have tested this by puttung a non-ascii word into either the name or any other queried field. SOSL always fails to retrieve the record.

 

 

Thanks for your feedback, Tobias.

This help article seems tro provide incorrect information about formulas for default field as it suggests that one is able to use merge fields of related objects using cross-object formulas. Other than providing access to global objects, this seems not to be implemented at all when it comes to fields of related custom objects. Please correct me if I am missing something.

 

Cheers, Tobias.

I am using the same Visualforce page and its corresponding controller extension as both the index page and the 404 page.

 

My question is: How can I test the controller extension code when used as a 404 page?

 

The following fails to create a working 404 instance:

 

Test.setCurrentPage(Page.NameOfMyIndexPageThatIsAlsoUsedAsThe404Page);
//this does not work as I cannot construct a Standardcontroller for a NULL reference
ApexPages.StandardController stdController = new ApexPages.StandardController(NULL); WebPageController controller = new WebPageController (stdController);
//should not be needed, I guess, as there is no corresponding object anyways ApexPages.currentPage().getParameters().put('id',NULL);

 

In case you're interested, to test whether or not the page is being called as a 404 page I use the following expression:

 

Boolean is404 = stdController.getId() == NULL && Site.getOriginalUrl() != NULL;

 

Cheers, Tobias.

How can I programatically verify whether or not a page by the name of "xyz" exists?

 

Neither the ApexPages namespace nor the PageReference object seem to provide any such method.

I am using a single index page which I call dispatcher and which decides on what to do with any incomming call. It is using a StandardController for a custom object with a controller extension and dynamically binds templates. I have a rewriter class that maps any incomming url to a custom object, if found. All that works well. However, there are a few exeptions where I am not sure as to how to distinguish them in my controller extension from any redirected pages which are:

 

1) the index page being called as the home page

2) the index page being called as the 404 error handling page

 

So, here are my questions...

 

A) How can I detect in the controller extension for my unified startpage that it is being called as either the home page or via 404 error handling? ...the standard behaviour being implemented via /dispatcher?id=CustomObjectId.

 

B) How can I, alternatively, make my url rewriter 404 status aware, such that it not only redirects to some other url but also returns a 404 http status to the client?

 

Cheers, Tobias.

I am struggling with writing some (after event) trigger wherein it seems that a roll-up summary field that I want to check is not yet recalculated. Doing a database lookup for the children of a given master node reveals that the database indeed reflects any changed records, yet the corresponding roll-up does not.

 

Thus, is there a way to force-update a roll-up summary field, hoping that this will recalc to reflect the changes?

 

I mean, I am using a simple count of child objects and I guess I could easily calculate that in my trigger ...but that's exactly what I intended to use the roll-up summary field for, to simplify coding and to use it in other formula fields.

 

Cheers, Tobias.

I am struggling to pass down a map to a component. The following...

 

    <apex:attribute name="dict" type="map" description="descr" required="true"/>

... does not work as type map does not seem supported. So, I have set out to define my own apex class...

 

//simple wrapper for a custom map class
global with sharing class MyDict{
    global MyDict(){}

    private Map<String,String> dictionary = new Map<String,String>();
    
    public String get(String entry){
        return this.dictionary.get(entry);
    }

    public Void put(String entry, String translation){
        this.dictionary.put(entry,translation);
    }

    public map<String,String> getDict(){
        return this.dictionary;
    }
}

 

Well... so far so good, I can create, populate and retrieve an instance of MyDict in my page controller like this...

 

    //create dict instance
    private MyDict dict = new MyDict();

    //populate dict
    List<Dict__c> dic = Dict__c.getall().values();
    for (Dict__c d : dic) {
        this.dict.put(d.name,String.ValueOf(d.get(this.lang+'__c')));
    }    
    
    //return dict
    public SettingsDict getDict()  {
        return this.dict;
    }

 

Well, however, I fail to retrieve a corresponding value of said map in my Component...

 

 

<apex:component controller="SubmitCaseController" allowDML="true">
    <apex:attribute name="dict" type="MyDict" description="the dictionary" required="true"/>
    <h1>{!dict.get('someEntry')}</h1>
</apex:component>

 

How am I to access the data in the underlying map from within a Component? Or, how else could I hand down a map from a controller to a page to a component being called form within that page?

 

 

Cheers, Tobias.

I have a map of this structure...

 

private Map<String,List<MyObject__c>> mymap = new Map<String,List<MyObject__c>>();

In order to keep things generic, it is not clear at all, how many string->list pairs there are going to be in the map. Now, if I repeat over one of these lists in a VisualForce page like this...

 

<apex:repeat value="{!mymap['someindex']}" var="el">
</apex:repeat>

 ...how am I going to determine the actual size of mymap['someindex']? Eventually I want to do something as simple as this...

 

<li class="{!IF(count=mymap['someindex'].size,'active','')}">

However, the size method of a list does not seem to work in VisualForce. Anyways, this procedure already seems to require for me to wrap this stuff with a quite redundant count variable like so...

 

<apex:variable var="count" value="{!0}"/>
<apex:repeat value="{!mymap['someindex']}" var="el">
    <apex:variable var="count" value="{!count + 1}"/>
    <li class="{!IF(count=mymap['someindex'].size,'active','')}">
</apex:repeat>

So, how would you do this, because my current solution looks like this and is far from generic at all and - as for my tastes - does not look good at all...

 

<apex:repeat value="{!mymap['myindex']}" var="el">
    <li class="{!IF(el.Property__c=='knownPropertyOfLastElementInList','last','')}">
        ...
    </li>
</apex:repeat>

...or is there a way to declare a getter in my controller that can receive parameters, somewhat like this...

 

<li class="{!IF(count=listlength('mymap','someindex'),'active','')}">

Cheers, Tobias.

@ Force.com DevTeam,

 

Please implement multiple, subsequent criteria - instead of just one - for sorting related lists that are displayed for (custom) objects via their respective PageLayout.

 

Usecase

Imagine a custom object, each record having a custom field called collection and one called sort order with respect to the collection. I would want to be able to sort records in the related list as follows:

 

  1. by collection
  2. by sort order within the collection
I can easily imagine other usecases where multiple sort-criteria would facilitate working with related lists.
Cheers, Tobias.

 

Can someone explain, why this VisualForce page...

 

<apex:page showHeader="false" standardStylesheets="false" standardController="SitePage__c" extensions="pageController">
    <apex:composition template="{!myTemplate}">
        <apex:define name="content">
            <apex:outputText escape="false" value="{!SitePage__c.Content__c}"/>
        </apex:define>
    </apex:composition>
</apex:page>

produces the following exception...

 

System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: SitePage__c.Content__c

 

...yet the following, modified version of the page - introducing a quite redundant variable - does work...

 

<apex:page showHeader="false" standardStylesheets="false" standardController="SitePage__c" extensions="pageController">
    <apex:variable var="c" value="{!SitePage__c.Content__c}"/>
    <apex:composition template="{!myTemplate}">
        <apex:define name="content">
            <apex:outputText escape="false" value="{!c}"/>
        </apex:define>
    </apex:composition>
</apex:page>

?


The controller should be of no concern but looks like this...

 

 

public class pageController {

    private final SitePage__c sitepage;
    public pageController(ApexPages.StandardController stdController) {
        this.sitepage = (SitePage__c)stdController.getRecord();
    }
    
    public  PageReference getmyTemplate()  {
        return  Page.tplDefault;
    }
}

 

I have renamed my two custom objects as well as changed labels and plural labels accordingly. However, these changes do not show up in the custom tab that I have been using for these objects, nor are those changes applied to the templates where these objects are being referenced when in a Master-Detail or Lookup relation ...even though I have adjusted those accordingly.

 

As I found myself unable to edit the tabname directly (why?!?), even deleting the tab and creating it anew did not result in an update of the tab title!

 

The only thing left for me was creating new custom objects from scratch, which is ok as I am in an early development stage, but would NOT be ok at all, if I already had huge collections of data.

 

Any clues as to how and where I would have to update the names being used for custom tab and edit templates?

Hi,

other than going through individual releases (http://developer.force.com/releases/release), anyone know of or have a comprehensive, yet concise list of what topics where touched in each release — just the headline and perhaps a short summary and a link to further resources — preferably categorized by product (sales-cloud, service-cloud, force.com, etc.) and further labels?

Thanks, Tobias.

Is possible use apex:detail with different page layout? Because now is shown page layout which is assignment to record type and I want have some related lists, fields on my custom Visual force page and all on standard page of object.

I know that I can use fields and apex:relatedList, but I am searching for the simplest solution, which can customer manage (without edit of code he can not add other relatedList)

  • February 04, 2013
  • Like
  • 2

Hi everyone,

 

I am a bit stumped to find myself unable to query Non-ASCII unicode characters using SOSL.

 

For example, take a word containing a German Umlaut like Äpfel and put it into the name or some other textfield you are querying.

 

How does one have to construct the SOSL query so that it actually returns something?

 

Researching for information on how to do this did not yield any helpful clues. I even created a class to convert all characters to their unicode representation and stuffed that into the sosl query without luck.

 

After some more testing it seems to get even worse.

 

Not only does my SOSL query not retrieve results for words containing non-ASCII characters. If I search for a word made of pure ASCII characters that is also contained in a record which has a non-ASCII word in it, SOSL does NOT retrieve it like it does retrieve other records?!?

 

I have tested this by puttung a non-ascii word into either the name or any other queried field. SOSL always fails to retrieve the record.

 

 

Thanks for your feedback, Tobias.

How can I programatically verify whether or not a page by the name of "xyz" exists?

 

Neither the ApexPages namespace nor the PageReference object seem to provide any such method.

I am using a single index page which I call dispatcher and which decides on what to do with any incomming call. It is using a StandardController for a custom object with a controller extension and dynamically binds templates. I have a rewriter class that maps any incomming url to a custom object, if found. All that works well. However, there are a few exeptions where I am not sure as to how to distinguish them in my controller extension from any redirected pages which are:

 

1) the index page being called as the home page

2) the index page being called as the 404 error handling page

 

So, here are my questions...

 

A) How can I detect in the controller extension for my unified startpage that it is being called as either the home page or via 404 error handling? ...the standard behaviour being implemented via /dispatcher?id=CustomObjectId.

 

B) How can I, alternatively, make my url rewriter 404 status aware, such that it not only redirects to some other url but also returns a 404 http status to the client?

 

Cheers, Tobias.

I am struggling with writing some (after event) trigger wherein it seems that a roll-up summary field that I want to check is not yet recalculated. Doing a database lookup for the children of a given master node reveals that the database indeed reflects any changed records, yet the corresponding roll-up does not.

 

Thus, is there a way to force-update a roll-up summary field, hoping that this will recalc to reflect the changes?

 

I mean, I am using a simple count of child objects and I guess I could easily calculate that in my trigger ...but that's exactly what I intended to use the roll-up summary field for, to simplify coding and to use it in other formula fields.

 

Cheers, Tobias.

I am struggling to pass down a map to a component. The following...

 

    <apex:attribute name="dict" type="map" description="descr" required="true"/>

... does not work as type map does not seem supported. So, I have set out to define my own apex class...

 

//simple wrapper for a custom map class
global with sharing class MyDict{
    global MyDict(){}

    private Map<String,String> dictionary = new Map<String,String>();
    
    public String get(String entry){
        return this.dictionary.get(entry);
    }

    public Void put(String entry, String translation){
        this.dictionary.put(entry,translation);
    }

    public map<String,String> getDict(){
        return this.dictionary;
    }
}

 

Well... so far so good, I can create, populate and retrieve an instance of MyDict in my page controller like this...

 

    //create dict instance
    private MyDict dict = new MyDict();

    //populate dict
    List<Dict__c> dic = Dict__c.getall().values();
    for (Dict__c d : dic) {
        this.dict.put(d.name,String.ValueOf(d.get(this.lang+'__c')));
    }    
    
    //return dict
    public SettingsDict getDict()  {
        return this.dict;
    }

 

Well, however, I fail to retrieve a corresponding value of said map in my Component...

 

 

<apex:component controller="SubmitCaseController" allowDML="true">
    <apex:attribute name="dict" type="MyDict" description="the dictionary" required="true"/>
    <h1>{!dict.get('someEntry')}</h1>
</apex:component>

 

How am I to access the data in the underlying map from within a Component? Or, how else could I hand down a map from a controller to a page to a component being called form within that page?

 

 

Cheers, Tobias.

@ Force.com DevTeam,

 

Please implement multiple, subsequent criteria - instead of just one - for sorting related lists that are displayed for (custom) objects via their respective PageLayout.

 

Usecase

Imagine a custom object, each record having a custom field called collection and one called sort order with respect to the collection. I would want to be able to sort records in the related list as follows:

 

  1. by collection
  2. by sort order within the collection
I can easily imagine other usecases where multiple sort-criteria would facilitate working with related lists.
Cheers, Tobias.

 

 Hi all.  I am starting my first application, and am connecting via PHP using the partner.wsdl.  I have created a custom 'Contact' object, and am now trying to pull this data via PHP.  Here is the query:

 

$query = 'SELECT C.Id, C.Full_Name__c
          FROM Contact__c C'; 

$result = $mySforceConnection->query($query); $sObject = new SObject($result->records[0]); print_r($sObject);

 

I have successfully connected and made a query, but the query is simply returning an empty result of (using PHP's print_r):

 

 

SObject Object ( [type] => Contact__c [fields] => [Id] => a )

 

Am I dealing with some kind of visibility issue with my custom object?  I have a number of 'Contacts', and the fields I am querying are correct, but again, no data.

 

Thanks for any pointers/assistance, it is truly appreciated!

 

Can someone explain, why this VisualForce page...

 

<apex:page showHeader="false" standardStylesheets="false" standardController="SitePage__c" extensions="pageController">
    <apex:composition template="{!myTemplate}">
        <apex:define name="content">
            <apex:outputText escape="false" value="{!SitePage__c.Content__c}"/>
        </apex:define>
    </apex:composition>
</apex:page>

produces the following exception...

 

System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: SitePage__c.Content__c

 

...yet the following, modified version of the page - introducing a quite redundant variable - does work...

 

<apex:page showHeader="false" standardStylesheets="false" standardController="SitePage__c" extensions="pageController">
    <apex:variable var="c" value="{!SitePage__c.Content__c}"/>
    <apex:composition template="{!myTemplate}">
        <apex:define name="content">
            <apex:outputText escape="false" value="{!c}"/>
        </apex:define>
    </apex:composition>
</apex:page>

?


The controller should be of no concern but looks like this...

 

 

public class pageController {

    private final SitePage__c sitepage;
    public pageController(ApexPages.StandardController stdController) {
        this.sitepage = (SitePage__c)stdController.getRecord();
    }
    
    public  PageReference getmyTemplate()  {
        return  Page.tplDefault;
    }
}

 

We'd like to have some of our HTML-style comments actually render in the page vs. being stripped out by the VF compiler.  Is this possible?  

Hi,

I am trying to display idea records on a public page. For this, I created a controller where i query the idea object and list all the records on a visualforce page.

This works fine , when i open this visualforce page within salesforce. But making this page public, and viewing this page , it doesnt shows any results. The query returns 0 records, even if it has number of ideas available.

I gave "readonly" permission to ideas object for guest user profile. Am i missing something OR sites does not allow to query ideas from a guest user context. If they dont, what is the purpose of giving read only permission on guest user profile?

Any help is appreciated,

Thanks.

  • December 10, 2008
  • Like
  • 0

Is possible use apex:detail with different page layout? Because now is shown page layout which is assignment to record type and I want have some related lists, fields on my custom Visual force page and all on standard page of object.

I know that I can use fields and apex:relatedList, but I am searching for the simplest solution, which can customer manage (without edit of code he can not add other relatedList)

  • February 04, 2013
  • Like
  • 2