• como_estas
  • NEWBIE
  • 50 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 10
    Replies

I'm trying to get a customer portal working in my development org.  It works but here's the catch:  It doesn't make you log in.  I essentially want any and all pages that are accessed through this site to require authentication, but I'm able to go right to the home screen without it.  I am sure this is something simple and I just don't fully understand how the portal works.  Can somebody help me?

 

Here's a link to the portal which should require you to log in but doesn't:

 

http://morganportal-developer-edition.na14.force.com/portal

 

As you can see it's just the standard Congratulations! VF page.  Funnier even is that I didn't enable VF page access to this page for the portal profile.  I'm lost.

Here is my failing VF and Apex code.  I'm trying to pass the value of a particular record's ID in a pageBlockTable to the controller with an apex:param inside an actionSupport....

 

<apex:pageBlockTable value="{!attendees}" var="a" title="Attendees">
<apex:column> <apex:facet name="header"> <apex:commandLink value="Confirmed ({!numConfirmed})" action="{!doSort}" rerender="attendees" styleClass="checkBoxes"> <apex:param name="sortField" value="Confirmed__c" assignTo="{!sortField}"/> <apex:param name="defaultSortOrder" value="desc" assignTo="{!defaultSortOrder}"/> </apex:commandLink> </apex:facet> <apex:inputField value="{!a.Confirmed__c}" styleClass="checkBoxes"> <apex:actionSupport event="onclick" action="{!updateAttendees}" rerender="attendees"> <apex:param assignTo="{!csiToUpdate}" value="{!a.Id}" /> </apex:actionSupport> </apex:inputField> </apex:column>

 For whatever reason the apex:param inside the apex:actionSupport doesn't seem to be assigning the value of a.Id to the csiToUpdate property in the controller.  Keep in mind that the apex:param elements in the headers are working as expected.  I feel like because it's within a loop, there is an issue.  Does anybody know what I'm doing wrong here?  Here's the relevant controller code:

 

    public string csiToUpdate {get;set;}
	
    public void updateAttendees()
    {
    	system.debug('FFFFF ' + csiToUpdate);
    }

 The debug always shows "FFFFF null".  What I was doing before was that the updateAttendees() method would simply update the entire list of attendees.  However, when that list gets long, it takes a long time.  I'm trying to have it update only the record that had a checkbox clicked.  i also tried using an arbitrary name attribute, which was mentioned in some other posts.

 

What am I doing wrong?

So I have a custom VF page that I wrote as an edit page for a custom object in my org.

 

<apex:page standardController="OrgEvent__c" extensions="EventEditController">

 

On this edit page, there is a button to create a new ContactScheduleItem__c, which is another custom object which has OrgEvent__c as a master detail.  Here's what the button looks like:

 

<apex:commandButton value="New Registrant" action="{!newAttendee}" rerender="attendees"/>

 

Within the EditEventController class, you guessed it, I have a method called newAttendee which is supposed to return a pagereference to a standard edit page for a new ContactScheduleItem__c:

 

	public PageReference newAttendee() {

		apexpages.pagereference ref = new apexpages.standardcontroller(new ContactScheduleItem__c()).edit();
		return ref;    	
	}

 

All looks like it should work, right?  Here's the fun part.  It doesn't.  No matter what kind of object's standard edit page I try to return in this method, It simply redirects me to an edit page for the object i'm currently viewing, which is an OrgEvent__c.

 

It's almost like since i have a standard controller in scope, i'm not allowed to create a new one in this method.  Does anybody know why I can't make this work?

Here's one that I think should be easy?

 

I have an <apex:pageBlock> and I am using an <apex:facet name="header"> to make my own custom stuff in the header.

 

I just want a button in there to create a new object.  Is there an easy way to do this?  Or do I seriously need to get the object prefix for this?

 

That would be weak.

I have a visualforce page that overrides the standard clone page for an object.  There are fieldsets on this page.  I clone the original object, then use the new object to populate the apex:inputField elements on the page.  However, within my fieldsets, it is displaying the default values for those fields, rather than the value that's stored in the sObject.  I'm sure this is a bug, does anybody know a workaround?

Hi There -

 

I am trying to figure something out involving field sets and this potentially unique situation I have.  Here's the scenario:

 

I have a standalone VF page (no header / sidebar) which is a form for editing a custom object.  This page is displayed inside an iframed window.

 

I have the save button set up like so:

<apex:commandButton action="{!save}" value="Save" onclick="setDates()" oncomplete="closeWindow(true)" rendered="{!OrgEvent__c.Event_Series_ID__c == null}" reRender="editEventForm"/>

So when the save action completes, it closes the window.  Here's the problem.  If there are validation issues with fields in the fieldset, oncomplete still gets fired and the window closes, when in fact, I only want the form, with errors, to rerender.

 

I can't see any way to determine if the operation completed with validation errors, or if it actually saved.  Does anybody know where to look?  Debug statements in my save method in the controller are not happening, so I don't think the save method even gets called when there are validation errors.

 

Thanks

Morgan

I have a scenario where I need custom fields within my custom visualforce page that cannot be generated using <apex:inputField>.  Here's a look at the code (devoid of spaces, for some reason):

 

<apex:pageBlockSectiontitle="Event Date and Time"id="dateSection">

<inputtype="text"id="startDate"style="width:120px"/>&nbsp;

<apex:selectListvalue="{!startHour}"multiselect="false"size="1"id="startHour">

<apex:selectOptionitemValue="01"itemLabel="1"/>

<apex:selectOptionitemValue="02"itemLabel="2"/>

<apex:selectOptionitemValue="03"itemLabel="3"/>

<apex:selectOptionitemValue="04"itemLabel="4"/>

<apex:selectOptionitemValue="05"itemLabel="5"/>

<apex:selectOptionitemValue="06"itemLabel="6"/>

<apex:selectOptionitemValue="07"itemLabel="7"/>

<apex:selectOptionitemValue="08"itemLabel="8"/>

<apex:selectOptionitemValue="09"itemLabel="9"/>

<apex:selectOptionitemValue="10"itemLabel="10"/>

<apex:selectOptionitemValue="11"itemLabel="11"/>

<apex:selectOptionitemValue="12"itemLabel="12"/>

</apex:selectList>:

<apex:selectListvalue="{!startMinute}"size="1"id="startMinute">

<apex:selectOptionitemValue="00"/>

<apex:selectOptionitemValue="15"/>

<apex:selectOptionitemValue="30"/>

<apex:selectOptionitemValue="45"/>

</apex:selectList>&nbsp;

<apex:selectListvalue="{!startAmPm}"size="1"id="startAmPm">

<apex:selectOptionitemValue="AM"/>

<apex:selectOptionitemValue="PM"/>

</apex:selectList>

<apex:inputHiddenvalue="{!startTimeStamp}"id="startTimeStamp"/>

</apex:pageBlockSection>

 

You get the idea.  It's a date.  It has a Date text field, and an Hour, Minue, and AM/PM selectList field.

 

I want to make it look like standard salesforce, within a pageBlockSection.  However, this makes the whole page blow up.  I tried to make the pageBlockSection tag empty and manually create the fields within a table that I made myself using the SF class names on the cells, but then the whole following section disappears in FF and IE.  I can't put them into a pageBlockSectionItem, because it complains that pageBlockSectionItem can only have 2 child elements.

 

Does this make any sense?  Anybody have any clues?

I am wondering if there is a way that I can use visualforce to create an edit page that uses the same layout from the detail page.  Inline editing is not an option for me.

 

My issue is that I have a custom edit page but when people add fields to the detail layout, I want those fields on the edit page too.

 

Something like <apex:detail mode="edit"> is sorta what I'm looking for.

 

Does anyone have any clues?

Hey folks.  I can't for the life of me figure out why I'm getting a DML exception in my trigger test suite.  Can somebody help?

 

Here's the trigger code:

 

trigger updateStatusPicklist on Application__c (after insert, after update) {
    
    updateStatusPicklist up = new updateStatusPicklist();
    Application__c[] apps = new list<Application__c>();
    
    if(trigger.isInsert) {
        apps = trigger.new;
    } else {
        for(Application__c app : trigger.new)
        {
            /* Only deal with apps whose status changed */
            if(trigger.oldMap.get(app.id).Status__c != trigger.newMap.get(app.id).Status__c)
            {
                apps.add(app);
            }
        }
    }
    
    up.handleTrigger(apps);
    
}

 

I won't paste in the handleTrigger method, but what the handleTrigger method does is loop through the apps and based on the value in the Status__c field, it sets a different field to a particular value.... I think this is where my problem lies but continuing on....

 

Here's the test method code:

 

    static testMethod void testPicklistStatus() {

        Contact con = new Contact(LastName = 'Collins');
        insert con;

            Application__c app = new Application__c(Contact__c = con.id);
            insert app;    
            system.assertEquals(app.isStatus__c,null);
            
            app.TargetX_SRMb__Status__c = 'Potential Applicant';
            update app;
            system.assertEquals(app.isStatus__c,'Inquiry','Status = ' + app.isStatus__c);
           

The DML exception is happening when I try to "update app".  I've tried putting it into a System.runAs() block but that doesn't help.  I wonder if the problem is this:

 

In the test method, I create the app record.  that fires the trigger.  then, the trigger also updates the app record, which in turn, fires the trigger again.  However, this time, it shouldn't get updated again, because trigger.old and trigger.new should have the same status..  but maybe i'm wrong.  Then, the test method tries to update the record but it fails because of some state that the record is in.  However I just don't know the root of the problem so I don't know how to fix it.  Can somebody help me out or point me in the right direction to get info about this kind of stuff?

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.  

I'm developing a software package.  It's good to go and passes all tests when I package it as managed beta or released

 

Here's the error I'm seeing when I try to install this beta package into a sandbox in a different org  (or the released package into a non-sandbox in a different org)

 

enhancedcomponenttestsuite.testTestObject()

 

Apex Classes(XXXXX) (where XXXXX is the ID of the apex class: enhancedComponentTestSuite).

 

System.AssertException: Assertion Failed
(FormationLite)
External entry point

 

 

This isn't very informative is it?  In the test method testTestObject(), there are 40 System.assert calls.

 

Here's the crazy part though:  I commented out every single one, repackaged, and I still see this error when trying to install.  Is this error message lying to me?

 

I have no idea where to turn.  Can somebody please help me?  All I want is a meaningful error message.

I'm developing a software package.  It's good to go and passes all tests when I package it as managed beta or released

 

Here's the error I'm seeing when I try to install this beta package into a sandbox in a different org  (or the released package into a non-sandbox in a different org)

 

enhancedcomponenttestsuite.testTestObject()

 

Apex Classes(XXXXX) (where XXXXX is the ID of the apex class: enhancedComponentTestSuite).

 

System.AssertException: Assertion Failed
(FormationLite)
External entry point

 

 

This isn't very informative is it?  In the test method testTestObject(), there are 40 System.assert calls.

 

Here's the crazy part though:  I commented out every single one, repackaged, and I still see this error when trying to install.  Is this error message lying to me?

 

I have no idea where to turn.  Can somebody please help me?  All I want is a meaningful error message.

I'm trying to get a customer portal working in my development org.  It works but here's the catch:  It doesn't make you log in.  I essentially want any and all pages that are accessed through this site to require authentication, but I'm able to go right to the home screen without it.  I am sure this is something simple and I just don't fully understand how the portal works.  Can somebody help me?

 

Here's a link to the portal which should require you to log in but doesn't:

 

http://morganportal-developer-edition.na14.force.com/portal

 

As you can see it's just the standard Congratulations! VF page.  Funnier even is that I didn't enable VF page access to this page for the portal profile.  I'm lost.

So I have a custom VF page that I wrote as an edit page for a custom object in my org.

 

<apex:page standardController="OrgEvent__c" extensions="EventEditController">

 

On this edit page, there is a button to create a new ContactScheduleItem__c, which is another custom object which has OrgEvent__c as a master detail.  Here's what the button looks like:

 

<apex:commandButton value="New Registrant" action="{!newAttendee}" rerender="attendees"/>

 

Within the EditEventController class, you guessed it, I have a method called newAttendee which is supposed to return a pagereference to a standard edit page for a new ContactScheduleItem__c:

 

	public PageReference newAttendee() {

		apexpages.pagereference ref = new apexpages.standardcontroller(new ContactScheduleItem__c()).edit();
		return ref;    	
	}

 

All looks like it should work, right?  Here's the fun part.  It doesn't.  No matter what kind of object's standard edit page I try to return in this method, It simply redirects me to an edit page for the object i'm currently viewing, which is an OrgEvent__c.

 

It's almost like since i have a standard controller in scope, i'm not allowed to create a new one in this method.  Does anybody know why I can't make this work?

Here's one that I think should be easy?

 

I have an <apex:pageBlock> and I am using an <apex:facet name="header"> to make my own custom stuff in the header.

 

I just want a button in there to create a new object.  Is there an easy way to do this?  Or do I seriously need to get the object prefix for this?

 

That would be weak.

I am wondering if there is a way that I can use visualforce to create an edit page that uses the same layout from the detail page.  Inline editing is not an option for me.

 

My issue is that I have a custom edit page but when people add fields to the detail layout, I want those fields on the edit page too.

 

Something like <apex:detail mode="edit"> is sorta what I'm looking for.

 

Does anyone have any clues?

Hi,

 

My visualforce page is as follows. I would like to have the help text displayed next to my input fields.

I can't give showheader as true. So is there any other way to get the helptext bubble displayed?

 

 

 

<apex:outputpanel >

<table width="100%">
    <tr>
    <td>
        <apex:inputfield value="{!af.tdpaf.Area_of_Focus__c}" /> 
    </td>
    <td>  <apex:inputfield value="{!af.tdpaf.What_data_are_you_collecting__c}"/></td>
    <td>  <apex:inputfield value="{!af.tdpaf.Baseline__c}"/></td>
  </table>

</apex:outputpanel >

 

 

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.  

I'm developing a software package.  It's good to go and passes all tests when I package it as managed beta or released

 

Here's the error I'm seeing when I try to install this beta package into a sandbox in a different org  (or the released package into a non-sandbox in a different org)

 

enhancedcomponenttestsuite.testTestObject()

 

Apex Classes(XXXXX) (where XXXXX is the ID of the apex class: enhancedComponentTestSuite).

 

System.AssertException: Assertion Failed
(FormationLite)
External entry point

 

 

This isn't very informative is it?  In the test method testTestObject(), there are 40 System.assert calls.

 

Here's the crazy part though:  I commented out every single one, repackaged, and I still see this error when trying to install.  Is this error message lying to me?

 

I have no idea where to turn.  Can somebody please help me?  All I want is a meaningful error message.