function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bart__cBart__c 

Trailhead: Unclear instructions re: "Getting Started with APEX" Unit 1: Call Static Method

I created the sendEmail class as was able to send/receive the email as the instructions indicated. However, under the section "Call Static Method" I ran into an error. 

This instructions read: 
          " In the Developer Console, find the open tab for the EmailManager class and modify the first line of the sendMail() method definition to the following (the only change is the added static keyword.)
 
                   public static void sendMail(String address, String subject, String body) {

                   Save the class by pressing Ctrl+S.  "

When I try to save, I get: 
FIELD_INTEGRITY_ERROR: 
Failed to create createContainerMember for containerId=undefined: null is not a valid containerId.

Here are the first few lines of the class (with the addition of the word 'static' per instructions)

public class EmailManager {

    // Public method
    public static void sendMail(String address, String subject, String body) {
        // Create an email message object.....

Further, the page is now in a perminant 'saving' mode under the file menu.   Thanks for any help.
Best Answer chosen by Bart__c
VinojVinoj
Hi Bart,

It sounds like you ran into a know issue with the developer console.  There is a couple of things you can do:

1. Edit the class from Setup | Develop | Apex Classes

2. Create a new Workspace in the dev console - https://help.salesforce.com/apex/HTViewSolution?urlname=Developer-console-cannot-save-classes-triggers-pages&language=en_US

I hope that helps!

All Answers

VinojVinoj
Hi Bart,

It sounds like you ran into a know issue with the developer console.  There is a couple of things you can do:

1. Edit the class from Setup | Develop | Apex Classes

2. Create a new Workspace in the dev console - https://help.salesforce.com/apex/HTViewSolution?urlname=Developer-console-cannot-save-classes-triggers-pages&language=en_US

I hope that helps!
This was selected as the best answer
Bart__cBart__c
Number 1 worked like a charm.  Thanks for the spedy reply, Vinoj!

Bart @ Forcesmith.com
Orquidea Perez 5Orquidea Perez 5
I created the sendEmail class, but did not recieve the email? Any suggestions?

Thank you,

Orchid