• Mike Otter
  • NEWBIE
  • 30 Points
  • Member since 2014

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 12
    Replies

I just signed up for a developer.salesforce.com account today. Interested in tinkering around with the Eclipse based IDE. Following these instructions here (https://developer.salesforce.com/page/Force.com_IDE_Installation), I'm getting an error trying to create a new project following these instructions (https://developer.salesforce.com/page/Apex_Day_Lab_Exercises). User-added imageI

This occurs when selecting "Production/Developer Edition", and a similar error when selecting Sandbox.  Is there something I have to "setup" on my developer account first? I'm not seeing anything related.

Fresh install of Java 7 JRE and Eclipse.

I'm currently developing an app, writing pages in Apex and VF.  When I get it working, it's going to look like a SalesForce app because I have not added or tweaked any styles.  Until I'm better with Apex, I've tabled any thought of customizing the look of these pages.  Once I have it working, how do I make the transition to a website that the world can see/use?

I've read somewhere that the stylesheet for SF is somewhere that I can copy/edit.  Do I take that, change what I want, and, presto, I'm done?  Or do I have to attach stylesheets to every Apex/VF page I have, point it to my own template, and publish it?

I am hoping that, when I get this app going, I'll have named fields on each page.  Each field will have a default style (from my stylesheet), I will add images/text to the background/template, and that's all I have to change.

Ideas?  Thoughts?  Directions on what to study?

Thanks.

Mike
New and mostly ignorant of Apex, I come to you for help.  :)

I have a custom object that I want to search using two input fields from a VF page.  Inputting the fields is straightforward but, since this is complicated (to me), I'm a bit lost as to a working solution.  I think I need to do the following:
  • accept the input as strings in a custom controller or an extension (am going to try an extension today)
  • build the query
  • execute the query (my code always says the input variable is null)
  • populate a list datatype
  • display the list on the same page's bottom half (previously hidden) or a second page entirely (the former would be cool but don't care at this point)
I have done tutorials from VisualForce in Practice, Force.com, a couple of workbooks, and numerous code examples in a reference section.  Over the past two days, I've tried different combinations for each of the above bullets but keep getting blocked.  The query runs with a null value, the query returns more rows than expected and the VF page can't display them, the return type is not the same as expected--all I get is frustration.

What adds to my frustration is knowing that this is the most basic of exercises.  A step beyond "Hello world" is running a query to show just your Cases, not all of them.  Apex's versatility means there's no one solution to any problem but, yegads, what I want cannot be that complicated--I just can't figure it out.

Thanks for letting me vent and, as always, thanks in advance.

Mike
Background:
Although I have coded, it's been in the mainframe world and, thus, I have no experience in Apex.  I went through the tutorial (Visualforce Workbook) and now am in the associated thicker book (Visualforce in Practice).  In Chapter 5 (Building Wizards), the exercise is to code three pages which call each other.  In a nutshell, you enter data about the parent and, when you click Continue, it saves the record and takes you to page 2 where you enter information about the child.  (Page 3 is about grandchildren--same idea--but I'm not there yet).  The three tables are related with a Master-Detail field.

Problem:
Page 1 information is saved and takes me to page 2.  When I click on Save, it's supposed to get the ID of the parent (it does--it's in the log) and then somehow save the child's record.  I don't think it's getting to that line (failure is indicated on the line after the get and before the insert) but have no clue why.  The errant line is in bold (about ten lines from the bottom).

I'd like to solve this myself but, since I don't know enough to know where to look, I figured I'd try here while I look elsewhere.  I've checked the online version of the book (http://www.developerforce.com/guides/Visualforce_in_Practice.pdf) but it has the same code as the book.  I've searched this forum and Google but no one has posted these exercises and I can't see how to relate posted solutions to this one.

Thanks in advance.

Mke
 

The code:
public class ProjectCreateExtension
{
private ApexPages.StandardController sc;
    public Sprint__c sprint {get; set;}
    public List<Sprint__c> sprints {get; set;}
    public String selectedSprint {get; set;}
   
    public ProjectCreateExtension(ApexPages.StandardController standardController)
    {
        // store a reference to the standard controller
        sc = standardController;
        sprint = new Sprint__c();
        // create a new list to store the sprints added by the user
     sprints = new List<Sprint__c>();
    }
   
    public PageReference ToPage1()
    {
        return Page.ProjectCreate1;
    }

    public PageReference ToPage2()
    {
        if (ApexPages.CurrentPage().GetURL().StartsWithIgnoreCase('/apex/projectcreate1'))
        {
            sc.Save();
            Project__c project = (Project__c)sc.GetRecord();
            sprint.Project__c = project.Id;
            insert sprint;
        }
            return Page.ProjectCreate2;       
    }

    public PageReference ToPage3()
    {
        return Page.ProjectCreate3;
    }
   
    public PageReference SaveSprint()
    {
        Project__c project = (Project__c)sc.GetRecord();
        sprint.Project__c = project.Id;
        insert sprint;
       
        sprints.Add(sprint);
        sprint = new Sprint__c();
       
        return null;
    }
       
}
I wrote a trigger to copy field date from one fiel to another. Keeping getting this error. Any suggestions?
Compile Error: expecting an equals sign, found ":" at Line 3 column 12 (highlighted)

 Trigger updateFields on Case (before update){

  for (Case : trigger.new){

    Serial_Number__c = SVMXC__Component__c;

  }

}
I'm trying to display a graphic that is conditional based on whether a certain number of events have occured during the past calendar year. The logic is as follows - if someone has attended more than 2 occasions in the past 12 months, display a smiley face. If not, display a frowny face. I can get this to work without the date parameters but I can't figure out how to limit the formula to assessing just the past 12 months from the current day. Any suggestions would be very much appreciated!

Here is what I've got so far:

IF(Total_Occasions_Attended__c >2, TODAY() - Date_of_Last_Participation__c),
IMAGE("/servlet/servlet.FileDownload?file=015f00000005Qgv", "Happy", 16, 16),
IF(Total_Occasions_Attended__c <3,TODAY() - Date_of_Last_Participation__c ),
IMAGE ("/servlet/servlet.FileDownload?file=015f00000005QhP", "Sad", 16, 16),NULL))

I keep getting this error:

Error: Syntax error. Extra ','

I'm currently developing an app, writing pages in Apex and VF.  When I get it working, it's going to look like a SalesForce app because I have not added or tweaked any styles.  Until I'm better with Apex, I've tabled any thought of customizing the look of these pages.  Once I have it working, how do I make the transition to a website that the world can see/use?

I've read somewhere that the stylesheet for SF is somewhere that I can copy/edit.  Do I take that, change what I want, and, presto, I'm done?  Or do I have to attach stylesheets to every Apex/VF page I have, point it to my own template, and publish it?

I am hoping that, when I get this app going, I'll have named fields on each page.  Each field will have a default style (from my stylesheet), I will add images/text to the background/template, and that's all I have to change.

Ideas?  Thoughts?  Directions on what to study?

Thanks.

Mike

I just signed up for a developer.salesforce.com account today. Interested in tinkering around with the Eclipse based IDE. Following these instructions here (https://developer.salesforce.com/page/Force.com_IDE_Installation), I'm getting an error trying to create a new project following these instructions (https://developer.salesforce.com/page/Apex_Day_Lab_Exercises). User-added imageI

This occurs when selecting "Production/Developer Edition", and a similar error when selecting Sandbox.  Is there something I have to "setup" on my developer account first? I'm not seeing anything related.

Fresh install of Java 7 JRE and Eclipse.

New and mostly ignorant of Apex, I come to you for help.  :)

I have a custom object that I want to search using two input fields from a VF page.  Inputting the fields is straightforward but, since this is complicated (to me), I'm a bit lost as to a working solution.  I think I need to do the following:
  • accept the input as strings in a custom controller or an extension (am going to try an extension today)
  • build the query
  • execute the query (my code always says the input variable is null)
  • populate a list datatype
  • display the list on the same page's bottom half (previously hidden) or a second page entirely (the former would be cool but don't care at this point)
I have done tutorials from VisualForce in Practice, Force.com, a couple of workbooks, and numerous code examples in a reference section.  Over the past two days, I've tried different combinations for each of the above bullets but keep getting blocked.  The query runs with a null value, the query returns more rows than expected and the VF page can't display them, the return type is not the same as expected--all I get is frustration.

What adds to my frustration is knowing that this is the most basic of exercises.  A step beyond "Hello world" is running a query to show just your Cases, not all of them.  Apex's versatility means there's no one solution to any problem but, yegads, what I want cannot be that complicated--I just can't figure it out.

Thanks for letting me vent and, as always, thanks in advance.

Mike
Background:
Although I have coded, it's been in the mainframe world and, thus, I have no experience in Apex.  I went through the tutorial (Visualforce Workbook) and now am in the associated thicker book (Visualforce in Practice).  In Chapter 5 (Building Wizards), the exercise is to code three pages which call each other.  In a nutshell, you enter data about the parent and, when you click Continue, it saves the record and takes you to page 2 where you enter information about the child.  (Page 3 is about grandchildren--same idea--but I'm not there yet).  The three tables are related with a Master-Detail field.

Problem:
Page 1 information is saved and takes me to page 2.  When I click on Save, it's supposed to get the ID of the parent (it does--it's in the log) and then somehow save the child's record.  I don't think it's getting to that line (failure is indicated on the line after the get and before the insert) but have no clue why.  The errant line is in bold (about ten lines from the bottom).

I'd like to solve this myself but, since I don't know enough to know where to look, I figured I'd try here while I look elsewhere.  I've checked the online version of the book (http://www.developerforce.com/guides/Visualforce_in_Practice.pdf) but it has the same code as the book.  I've searched this forum and Google but no one has posted these exercises and I can't see how to relate posted solutions to this one.

Thanks in advance.

Mke
 

The code:
public class ProjectCreateExtension
{
private ApexPages.StandardController sc;
    public Sprint__c sprint {get; set;}
    public List<Sprint__c> sprints {get; set;}
    public String selectedSprint {get; set;}
   
    public ProjectCreateExtension(ApexPages.StandardController standardController)
    {
        // store a reference to the standard controller
        sc = standardController;
        sprint = new Sprint__c();
        // create a new list to store the sprints added by the user
     sprints = new List<Sprint__c>();
    }
   
    public PageReference ToPage1()
    {
        return Page.ProjectCreate1;
    }

    public PageReference ToPage2()
    {
        if (ApexPages.CurrentPage().GetURL().StartsWithIgnoreCase('/apex/projectcreate1'))
        {
            sc.Save();
            Project__c project = (Project__c)sc.GetRecord();
            sprint.Project__c = project.Id;
            insert sprint;
        }
            return Page.ProjectCreate2;       
    }

    public PageReference ToPage3()
    {
        return Page.ProjectCreate3;
    }
   
    public PageReference SaveSprint()
    {
        Project__c project = (Project__c)sc.GetRecord();
        sprint.Project__c = project.Id;
        insert sprint;
       
        sprints.Add(sprint);
        sprint = new Sprint__c();
       
        return null;
    }
       
}