• BRupholdt
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 12
    Replies
After searching the forums and reading many of the resources posted, I still don't understand.
 
I've made a very simple VF page with controller that needs unit testing so I can publish it to my production org.  I've started extreme basic so that I can understand the entire process.  Try as I might, I don't understand how to make the unit tests for these.  I learn best by seeing it done but the examples I find are far more complex than I can wrap my head around just yet.  Would someone be willing to write unit tests for these two items so that I have a working example to go forward with?  I would greatly appreciate it.
 
Code:
public String getLongDate() {
  Datetime cDT = System.now();
  return cDT.format('EEEE, MMMM d, yyyy');
}

public Goals__c[] getGoals() {
  return [
    Select Completion_Date__c, CreatedById, CreatedBy.Alias, CreatedBy.Id, CreatedDate, 
      Goal__c, Id, IsDeleted, Name, OwnerId, Status__c, Target_Date__c, Timeliness__c 
    from Goals__c
    where Completion_Date__c = null
    order by Target_Date__c desc
  ];
}

I piece this test together from what I've found but it seems not to do anything toward my unit testing requirements.  At least it doesn't error like everything else I've tried to do :/
 
Code:
static testMethod void myTest() {
  Goals__c g = new Goals__c(Goal__c='test');
  insert g;
  g = [Select Goal__c from Goals__c where Id = :g.Id];
  System.assertEquals( 'test', g.Goal__c );
}

 

 
 
I've followed a tutorial to use apex:outputPanel with apex:detail to refresh the detail based on user click.  I'm trying to do the same with a pageBlockTable now without success.  When I include both pieces on the page, the detail refreshes but the other data is not drawn.  Obviously I'm ding it wrong.
 
I am new to VisualForce and honestly don't know enough to ask the right questions.  Any help you can give would be great.
 
Here's my page code:
 
Code:
<apex:commandLink rerender="detail">{!user.Alias}</apex:commandLink>

<apex:outputPanel id="detail">
  //works
  <apex:detail subject="{!$CurrentPage.parameters.uid}" relatedList="false" title="false"/>
  //doesn't work for refresh - does work when output alone
  <apex:pageBlock>
    <apex:pageBlockTable value="{!Goals}" var="goal">
      <apex:column >
        <apex:facet name="header">Reference</apex:facet>
          {!goal.Name}
        </apex:column>
      <apex:column >
        <apex:facet name="header">Goal</apex:facet>
        <apex:outputLink value="/{!goal.id}" >{!goal.Goal__c}</apex:outputLink>
      </apex:column>
      <apex:column >
        <apex:facet name="header">Target Date</apex:facet>
        <apex:outputField value="{!goal.Target_Date__c}"/>
      </apex:column>
      </apex:pageBlockTable>
  </apex:pageBlock>
</apex:outputPanel>

 
Because of the way we use Leads, Sales has asked that they be notified when someone else takes ownership of a record.  I thought I could do this using workflow but I don't see a way to test for it.  I need to know that the lead ownership has changed and who it used to be so I can notify the previous user.  Any ideas? 
I created a custom button to automatically edit a field and save the changes using the retURL and passing the form parameters.  It works great.  I then created a custom edit button on the object to specify which record type to use.  It works great but now the first button doesn't work.
 
I think the field values from the first S-control aren't being passed through the S-control of the custom Edit.  Is there a way to read the retURL passed to the Edit page?  If so, that would solve my problem as I could simply append it to the url to exit the page.  When I tried to do so, I only get a null value so I know either I'm not doing it right or it's not possible.

I have a user who just installed the Office Connector from inside SF (in the Desktop Integration section of Personal Setup), and it appears to have installed a version 4.0 of the toolkit.

 

He's getting the "Can't find project or library" error that others have reported getting as a result of a mismatch between Version 2.0 of the toolkit and Version 6.16 of the Excel Connector.

 

Has there been an updated version of the Excel Connector that will work with Version 4.0 of the toolkit? If not, how do I downgrade him back to Version 3.0, since the only version that will download from SF setup is version 4.0?  

 

This is not the most technical of users, and I'm supporting him from 200 miles away, so I can't just go to his computer and do it for him. So asking him to go to the Developer Toolkit type sites and figure out what to do is asking for disaster. Please help!

After searching the forums and reading many of the resources posted, I still don't understand.
 
I've made a very simple VF page with controller that needs unit testing so I can publish it to my production org.  I've started extreme basic so that I can understand the entire process.  Try as I might, I don't understand how to make the unit tests for these.  I learn best by seeing it done but the examples I find are far more complex than I can wrap my head around just yet.  Would someone be willing to write unit tests for these two items so that I have a working example to go forward with?  I would greatly appreciate it.
 
Code:
public String getLongDate() {
  Datetime cDT = System.now();
  return cDT.format('EEEE, MMMM d, yyyy');
}

public Goals__c[] getGoals() {
  return [
    Select Completion_Date__c, CreatedById, CreatedBy.Alias, CreatedBy.Id, CreatedDate, 
      Goal__c, Id, IsDeleted, Name, OwnerId, Status__c, Target_Date__c, Timeliness__c 
    from Goals__c
    where Completion_Date__c = null
    order by Target_Date__c desc
  ];
}

I piece this test together from what I've found but it seems not to do anything toward my unit testing requirements.  At least it doesn't error like everything else I've tried to do :/
 
Code:
static testMethod void myTest() {
  Goals__c g = new Goals__c(Goal__c='test');
  insert g;
  g = [Select Goal__c from Goals__c where Id = :g.Id];
  System.assertEquals( 'test', g.Goal__c );
}

 

 
 
I've followed a tutorial to use apex:outputPanel with apex:detail to refresh the detail based on user click.  I'm trying to do the same with a pageBlockTable now without success.  When I include both pieces on the page, the detail refreshes but the other data is not drawn.  Obviously I'm ding it wrong.
 
I am new to VisualForce and honestly don't know enough to ask the right questions.  Any help you can give would be great.
 
Here's my page code:
 
Code:
<apex:commandLink rerender="detail">{!user.Alias}</apex:commandLink>

<apex:outputPanel id="detail">
  //works
  <apex:detail subject="{!$CurrentPage.parameters.uid}" relatedList="false" title="false"/>
  //doesn't work for refresh - does work when output alone
  <apex:pageBlock>
    <apex:pageBlockTable value="{!Goals}" var="goal">
      <apex:column >
        <apex:facet name="header">Reference</apex:facet>
          {!goal.Name}
        </apex:column>
      <apex:column >
        <apex:facet name="header">Goal</apex:facet>
        <apex:outputLink value="/{!goal.id}" >{!goal.Goal__c}</apex:outputLink>
      </apex:column>
      <apex:column >
        <apex:facet name="header">Target Date</apex:facet>
        <apex:outputField value="{!goal.Target_Date__c}"/>
      </apex:column>
      </apex:pageBlockTable>
  </apex:pageBlock>
</apex:outputPanel>

 
Because of the way we use Leads, Sales has asked that they be notified when someone else takes ownership of a record.  I thought I could do this using workflow but I don't see a way to test for it.  I need to know that the lead ownership has changed and who it used to be so I can notify the previous user.  Any ideas? 
Hi Folks,

I am struggling to disable the "On Stage Change" email that goes out to people!  I can't find it in Workflow Rules or any email settings and yet people are getting emails everytime an oportunity has a change in its Stage!  I am getting a lot of complaints and yet can not get them to stop! :(  Pls Help!
Hello Everyone -
 
I've created a Custom Field on an object that displays what user reconciled an expense. How can I lock that field so when the expense is created that it stays as the original user that created it?
 
As it is now the name keeps changing based on what user opens that expense.
 
Thanks!
I want to create a button that creates an opportunity with defined fields. This is what I got so far:
 
window.parent.location.href="{!URLFOR($Action.Opportunity.New
,Opportunity.Id, [opp4= Account.Name, opp3="ProductName -  "&Account.Name, opp7= "555", opp9= TEXT(MONTH(Today()+7))&"/"&TEXT(DAY(Today()+7))&"/"&TEXT(YEAR(Today()+7)) , opp11="Qualified Lead",p3="012500000009CJ7"])};"
 
This works. it takes me to the opportunity creation page though with all the fields that are defined filled up, but I have to still click on the create buttons.
 
Is there a way that I can do this and make it automatically create the opportunity and send me to the opportunity page rather than showing me the create form all over again.
Hello.  I want to update a single value in a record with an scontrol in Professional Edition.  I know of no way to do this.  Are there any options?  Will anything in URLFOR allow me to do this?  With the URL, I know I can produce the Edit view and populate the appropriate field, but I'd like to skip that and save the record.
thanks
chris
  • June 27, 2007
  • Like
  • 0
I need to assign different layout to parent and child account and I am not supposed to use "record types" . Can anyone help 
I created a custom button to automatically edit a field and save the changes using the retURL and passing the form parameters.  It works great.  I then created a custom edit button on the object to specify which record type to use.  It works great but now the first button doesn't work.
 
I think the field values from the first S-control aren't being passed through the S-control of the custom Edit.  Is there a way to read the retURL passed to the Edit page?  If so, that would solve my problem as I could simply append it to the url to exit the page.  When I tried to do so, I only get a null value so I know either I'm not doing it right or it's not possible.