Skip to main content
replaced http://salesforce.stackexchange.com/ with https://salesforce.stackexchange.com/
Source Link

Figured it out with help from this post: Compile Error: Variable does not exist: o.CloseDateCompile Error: Variable does not exist: o.CloseDate

I had a newline/line break between the line between FROM and {:

FROM OpportunityLineItem WHERE OpportunityId IN :oppyIds])

    {
        revPipeline.add(new Revenue_Pipeline__c(

The correct code is:

    FROM OpportunityLineItem WHERE OpportunityId IN :oppyIds])
    {
        revPipeline.add(new Revenue_Pipeline__c(

So if only the first line is considered in the loop and there is a blank space then the rest is out of the loop and thus error. Removing the space allows the code to be compiled.

Figured it out with help from this post: Compile Error: Variable does not exist: o.CloseDate

I had a newline/line break between the line between FROM and {:

FROM OpportunityLineItem WHERE OpportunityId IN :oppyIds])

    {
        revPipeline.add(new Revenue_Pipeline__c(

The correct code is:

    FROM OpportunityLineItem WHERE OpportunityId IN :oppyIds])
    {
        revPipeline.add(new Revenue_Pipeline__c(

So if only the first line is considered in the loop and there is a blank space then the rest is out of the loop and thus error. Removing the space allows the code to be compiled.

Figured it out with help from this post: Compile Error: Variable does not exist: o.CloseDate

I had a newline/line break between the line between FROM and {:

FROM OpportunityLineItem WHERE OpportunityId IN :oppyIds])

    {
        revPipeline.add(new Revenue_Pipeline__c(

The correct code is:

    FROM OpportunityLineItem WHERE OpportunityId IN :oppyIds])
    {
        revPipeline.add(new Revenue_Pipeline__c(

So if only the first line is considered in the loop and there is a blank space then the rest is out of the loop and thus error. Removing the space allows the code to be compiled.

'space' isn't precise enough a term in this situation
Source Link
Derek F
  • 64.1k
  • 15
  • 55
  • 104

Figured it out with help from this post: Compile Error: Variable does not exist: o.CloseDate

I had a spacenewline/line break between the line between FROM and {:

FROM OpportunityLineItem WHERE OpportunityId IN :oppyIds])

    {
        revPipeline.add(new Revenue_Pipeline__c(

The correct code is:

    FROM OpportunityLineItem WHERE OpportunityId IN :oppyIds])
    {
        revPipeline.add(new Revenue_Pipeline__c(

So if only the first line is considered in the loop and there is a blank space then the rest is out of the loop and thus error. Removing the space allows the code to be compiled.

Figured it out with help from this post: Compile Error: Variable does not exist: o.CloseDate

I had a space between the line between FROM and {:

FROM OpportunityLineItem WHERE OpportunityId IN :oppyIds])

    {
        revPipeline.add(new Revenue_Pipeline__c(

The correct code is:

    FROM OpportunityLineItem WHERE OpportunityId IN :oppyIds])
    {
        revPipeline.add(new Revenue_Pipeline__c(

So if only the first line is considered in the loop and there is a blank space then the rest is out of the loop and thus error. Removing the space allows the code to be compiled.

Figured it out with help from this post: Compile Error: Variable does not exist: o.CloseDate

I had a newline/line break between the line between FROM and {:

FROM OpportunityLineItem WHERE OpportunityId IN :oppyIds])

    {
        revPipeline.add(new Revenue_Pipeline__c(

The correct code is:

    FROM OpportunityLineItem WHERE OpportunityId IN :oppyIds])
    {
        revPipeline.add(new Revenue_Pipeline__c(

So if only the first line is considered in the loop and there is a blank space then the rest is out of the loop and thus error. Removing the space allows the code to be compiled.

Source Link
Dan Wooding
  • 3.7k
  • 7
  • 46
  • 90

Figured it out with help from this post: Compile Error: Variable does not exist: o.CloseDate

I had a space between the line between FROM and {:

FROM OpportunityLineItem WHERE OpportunityId IN :oppyIds])

    {
        revPipeline.add(new Revenue_Pipeline__c(

The correct code is:

    FROM OpportunityLineItem WHERE OpportunityId IN :oppyIds])
    {
        revPipeline.add(new Revenue_Pipeline__c(

So if only the first line is considered in the loop and there is a blank space then the rest is out of the loop and thus error. Removing the space allows the code to be compiled.