• RossK
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
Hi
I am experiencing unexpected behavoir with a map that contains sets of strings. The controller is below:
 
public class testbogusmap {
    public map<string,set<string>> BogusMap {get{
         map<string,set<string>> ret = 
                  new map<string,set<string>>();
         set<string> hiSet = new set<String>();
         hiSet.add('ho');
         ret.put('hey',hiSet);   
        return ret; }
    } 
}


The VF page is here:

 
<apex:page controller="testbogusmap">
    {!bogusmap}
    </apex:page>
My VF page displays

{hey=common.apex.runtime.impl.SetValue@d08}

instead of {hey='ho'} which is what is displayed in the developer console.  Why is this?

Thank you!
 

 
  • January 08, 2016
  • Like
  • 0
Hi,
I need a little assistance on the following situation

1) We have a business partner who has a secure portal (not salesforce) accessed by their customers.
2) We want the business partner's portal user to be able to access a secure Visualforce page that displays fields from a custom object.

I think the approach to this is as follows:
Business Partner's Portal would contain a button that looks like this    businesspartnerdomain/privatepage?customernumber=xyz&mode=edit&object=contact

The "privatepage" referred to above handles authentication and forwards the user to the secure Visualforce page with the customer information displayed. The customer should never know that they left the business partners website.

We are planning to use Communities liscenses where we pay for each login.   

I have read the following documents.
1) Using oauth with VF: https://developer.salesforce.com/blogs/developer-relations/2011/09/using-oauth-2-0-with-visualforce-in-winter-12.html
2) oauth SF Documentation/Setuphttps://developer.salesforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com
3) Code: Sample/Package  https://www.npmjs.com/package/salesforce-oauth2 


What is the preferred approach to doing this?

Is it  using OAuth2.0, an API Key, rather than username/pwd/token?  Is this do-able?  What would the reccommended o-auth flow be (Web-Server)? It is critical is that I do not want to have any login or confirmation window pop-up when the user views our secure vf page.  

Thank you so much for your help!




 
  • October 15, 2015
  • Like
  • 0

Hello!

 

I have a class that I created.  The objects from this class are in a list and I am unable to display the list using the APEX repeat tag.  See the code below.  When I try to save the visualforce page, I get the following error.


Error: Unknown property 'repeatCon.objQuestion.Name'

 

My question is does Apex:Repeat support collections of non-SObject objects? If yes, what am I doing wrong? If not is there a work around?

 

<apex:page controller="repeatCon" id="thePage">
    <apex:repeat value="{!listquestions}" var="q" id="theRepeat">
        <apex:outputText value="{!q.Name}" id="theValue"/><br/>
    </apex:repeat >
</apex:page>

<!-- Controller -->

public class repeatCon {
    public class objQuestion{
    public string Name;
    public string SearchLabel;
   } 
    public list<objQuestion> listquestions {get; set;}
    
public repeatcon(){
      listquestions = new list<objQuestion>();
      objQuestion a = new objQuestion();
      objQuestion b = new objQuestion();
      a.name='a';
      a.SearchLabel='a';
      b.name='b';
      b.SearchLabel='b'; 
      listquestions.add(a);
      listquestions.add(b);
    }

}

 Thank you so much!!!

  • May 17, 2013
  • Like
  • 0

Hello!

 

I am having a problem with test methods written in API version 28.0.  The following code snippet gives a  

 

Compile Error: Test methods must be in test classes at line 3 column 28 

 

It works fine in API 27.0.  Why is this occurring? Was this change to the API done with intent?  Is it documented anywhere? Do I need to move all of my Test Methods into a Test Class to use the most recent API?

 

Thanks so much!

 

public class myClass {
    static testMethod void myTest() {
       // Add test method logic using System.assert(), System.assertEquals()
       // and System.assertNotEquals() here.
     }
}
  • May 15, 2013
  • Like
  • 0
Hi
I am experiencing unexpected behavoir with a map that contains sets of strings. The controller is below:
 
public class testbogusmap {
    public map<string,set<string>> BogusMap {get{
         map<string,set<string>> ret = 
                  new map<string,set<string>>();
         set<string> hiSet = new set<String>();
         hiSet.add('ho');
         ret.put('hey',hiSet);   
        return ret; }
    } 
}


The VF page is here:

 
<apex:page controller="testbogusmap">
    {!bogusmap}
    </apex:page>
My VF page displays

{hey=common.apex.runtime.impl.SetValue@d08}

instead of {hey='ho'} which is what is displayed in the developer console.  Why is this?

Thank you!
 

 
  • January 08, 2016
  • Like
  • 0

Hello!

 

I have a class that I created.  The objects from this class are in a list and I am unable to display the list using the APEX repeat tag.  See the code below.  When I try to save the visualforce page, I get the following error.


Error: Unknown property 'repeatCon.objQuestion.Name'

 

My question is does Apex:Repeat support collections of non-SObject objects? If yes, what am I doing wrong? If not is there a work around?

 

<apex:page controller="repeatCon" id="thePage">
    <apex:repeat value="{!listquestions}" var="q" id="theRepeat">
        <apex:outputText value="{!q.Name}" id="theValue"/><br/>
    </apex:repeat >
</apex:page>

<!-- Controller -->

public class repeatCon {
    public class objQuestion{
    public string Name;
    public string SearchLabel;
   } 
    public list<objQuestion> listquestions {get; set;}
    
public repeatcon(){
      listquestions = new list<objQuestion>();
      objQuestion a = new objQuestion();
      objQuestion b = new objQuestion();
      a.name='a';
      a.SearchLabel='a';
      b.name='b';
      b.SearchLabel='b'; 
      listquestions.add(a);
      listquestions.add(b);
    }

}

 Thank you so much!!!

  • May 17, 2013
  • Like
  • 0

Hello!

 

I am having a problem with test methods written in API version 28.0.  The following code snippet gives a  

 

Compile Error: Test methods must be in test classes at line 3 column 28 

 

It works fine in API 27.0.  Why is this occurring? Was this change to the API done with intent?  Is it documented anywhere? Do I need to move all of my Test Methods into a Test Class to use the most recent API?

 

Thanks so much!

 

public class myClass {
    static testMethod void myTest() {
       // Add test method logic using System.assert(), System.assertEquals()
       // and System.assertNotEquals() here.
     }
}
  • May 15, 2013
  • Like
  • 0