You need to sign in to do that
Don't have an account?
sObject Type is not supported / Managed object
Hey folks -
So I have a VF page that accepts a contact ID in the URL and looks like this:
<apex:page standardController="Contact" extensions="AppTrackerLanding" showHeader="false">
<head>
<style>
#pageWrapper { width: 80%; margin: 20px auto; }
</style>
</head>
<divid="pageWrapper">
<apex:form>
<apex:pageBlocktitle="User Edit"mode="edit">
<apex:pageBlockButtons>
<apex:commandButtonaction="{!battle}"value="Battle"></apex:commandButton>
</apex:pageBlockButtons>
<apex:selectListvalue="{!appId}">
<apex:selectOptionsvalue="{!applications}"/>
</apex:selectList>
</apex:pageBlock>
</apex:form>
</div>
</apex:page>
Which is made public via a site. here's what the controller extension looks like, which handles the "battle" function (i named it battle because that's exactly what this has been)
public class AppTrackerLanding
{
privatefinalContact c;
public String appId {get; set;}
public AppTrackerLanding(ApexPages.StandardController stdController)
{
this.c = (Contact)stdController.getRecord();
}
public List<selectOption> getApplications()
{
List<selectOption> options = new List<selectOption>();
for(Application__c app :
[SELECT Id, NameFROMApplication__c
WHERE Contact__c = : this.c.Id])
{
options.add(new selectOption(app.Id,app.Name));
}
return options;
}
public PageReference battle()
{
System.debug(this.appId + ' ::::: APPID');
PageReference ref = new PageReference('/apex/AppTracker?id=' + this.appId);
ref.setRedirect(true);
return ref;
}
So you can see here how I'm generating the list of select options and also what happens when you click 'Battle'. It gathers the application ID from the picklist on the VF page, and redirects you to a different VF page called AppTracker and sends along the ID.
All I have in the AppTracker page is this:
<apex:pagestandardController="Application__c"showHeader="FALSE"sidebar="FALSE">
</apex:page>
If i preview the site in admin mode i get the error:
sObject 'Application__c' is not supported.
I've granted read access to all objects in the public access settings for the site. I've added the second visualforce page to the list of pages the site has access to. Could this have something to do with the fact that the object is part of a managed package?
If I do this through apex as a logged in user, it all works fine. Does it have something to do with the record owner? I still wouldn't understand though, since it doesn't have any trouble looking up the contact in the first page, only the second page has an issue.
Any help would be great.
Hey... I did have the namespaces in there but stripped them in this post.
The issue was that the managed package had not been deployed.
So, for future reference, if you see the error "sobject type is not supported" for an object that is part of a managed package -- in your site but not in your apex page, that could be the issue.
Thanks for the help guys
All Answers
for whatever reason the editor stripped all spaces out of the markup tags.
If the object is managed but the Apex Code is not, you must specify the namespace of the object in your code, such as managedpackagename__Application__c. You can see the managedpackagename in the package itself.
For future reference, when posting on this forum, it is normally rendered in HTML, such that extra spaces will not appear at the beginning of a paragraph (e.g. your copy and pasted code). To make the code display correctly, use the "Insert Code" button on the toolbar on the top of the editor (). This pops up a new window where you can paste your code in. It will look like this:
Let me know if my suggestion worked for your code.
Hey... I did have the namespaces in there but stripped them in this post.
The issue was that the managed package had not been deployed.
So, for future reference, if you see the error "sobject type is not supported" for an object that is part of a managed package -- in your site but not in your apex page, that could be the issue.
Thanks for the help guys
como_estas,
I think I am in same boat, but did not quite get your solution "The issue was that the managed package had not been deployed."
I have a manged package which has a custom object and pirce of code that refrences this custom object and I get the same error.
I have not included the namespace in the code , as both code and object are part of the package.
What am I missing here?
regards
ISV Partner
If you go to setup -> installed packages you'll see a list of installed packages. If you click the package in question, look for a button to deploy the package. That's what worked for me. When you do a fresh install of a package that contains its own custom objects, they aren't available until the package is deployed.
This was in the past, now when you install the app, it gets deployed stratight away.