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
knicholsknichols 

apex error using eclipse

I'm working on my first apex task but I'm getting this error using eclipse, any ideas?

INVALID_FIELD -
IdentifierName, IdentifierType, LineNumber, OptionsFinalVariable, OptionsPrivateIdentifier
                                            ^
ERROR at Row:1:Column:224
No such column 'OptionsFinalVariable' on entity 'ApexPackageIdentifier'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
  com.appexchange.plugin.editors.apexEditor.ApexContentOutlinePage$ContentProvider.parse (ApexContentOutlinePage.java 126)
  com.appexchange.plugin.editors.apexEditor.ApexContentOutlinePage$ContentProvider.inputChanged (ApexContentOutlinePage.java 155)
  org.eclipse.jface.viewers.ContentViewer.setInput (ContentViewer.java 246)
  org.eclipse.jface.viewers.StructuredViewer.setInput (StructuredViewer.java 1542)
  com.appexchange.plugin.editors.apexEditor.ApexContentOutlinePage.update (ApexContentOutlinePage.java 310)
  com.appexchange.plugin.editors.apexEditor.ApexEditor.doSave (ApexEditor.java 325)
  org.eclipse.ui.internal.SaveableHelper$1.run (SaveableHelper.java 130)
  org.eclipse.ui.internal.SaveableHelper$4.run (SaveableHelper.java 257)
  org.eclipse.jface.operation.ModalContext.runInCurrentThread (ModalContext.java 369)
  org.eclipse.jface.operation.ModalContext.run (ModalContext.java 313)
  org.eclipse.jface.window.ApplicationWindow$1.run (ApplicationWindow.java 763)
  org.eclipse.swt.custom.BusyIndicator.showWhile (BusyIndicator.java 67)
  org.eclipse.jface.window.ApplicationWindow.run (ApplicationWindow.java 760)
  org.eclipse.ui.internal.WorkbenchWindow.run (WorkbenchWindow.java 2283)
  org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation (SaveableHelper.java 263)
  org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation (SaveableHelper.java 243)
  org.eclipse.ui.internal.SaveableHelper.savePart (SaveableHelper.java 135)
  org.eclipse.ui.internal.EditorManager.savePart (EditorManager.java 1414)
  org.eclipse.ui.internal.WorkbenchPage.savePart (WorkbenchPage.java 2995)
  org.eclipse.ui.internal.WorkbenchPage.saveEditor (WorkbenchPage.java 3008)
  org.eclipse.ui.internal.SaveAction.run (SaveAction.java 67)
  org.eclipse.jface.action.Action.runWithEvent (Action.java 499)
  org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java 539)
  org.eclipse.jface.action.ActionContributionItem.access$2 (ActionContributionItem.java 488)
  org.eclipse.jface.action.ActionContributionItem$6.handleEvent (ActionContributionItem.java 441)
  org.eclipse.swt.widgets.EventTable.sendEvent (EventTable.java 66)
  org.eclipse.swt.widgets.Widget.sendEvent (Widget.java 928)
  org.eclipse.swt.widgets.Display.runDeferredEvents (Display.java 3348)
  org.eclipse.swt.widgets.Display.readAndDispatch (Display.java 2968)
  org.eclipse.ui.internal.Workbench.runEventLoop (Workbench.java 1930)
  org.eclipse.ui.internal.Workbench.runUI (Workbench.java 1894)
  org.eclipse.ui.internal.Workbench.createAndRunWorkbench (Workbench.java 422)
  org.eclipse.ui.PlatformUI.createAndRunWorkbench (PlatformUI.java 149)
  org.eclipse.ui.internal.ide.IDEApplication.run (IDEApplication.java 95)
  org.eclipse.core.internal.runtime.PlatformActivator$1.run (PlatformActivator.java 78)
  org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication (EclipseAppLauncher.java 92)
  org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start (EclipseAppLauncher.java 68)
  org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java 400)
  org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java 177)
  sun.reflect.NativeMethodAccessorImpl.invoke0 (null -2)
  sun.reflect.NativeMethodAccessorImpl.invoke (null -1)
  sun.reflect.DelegatingMethodAccessorImpl.invoke (null -1)
  java.lang.reflect.Method.invoke (null -1)
  org.eclipse.core.launcher.Main.invokeFramework (Main.java 336)
  org.eclipse.core.launcher.Main.basicRun (Main.java 280)
  org.eclipse.core.launcher.Main.run (Main.java 977)
  org.eclipse.core.launcher.Main.main (Main.java 952)

TehNrdTehNrd
Would it be possible for you to post a little of the code?


Message Edited by TehNrd on 01-04-2008 03:22 PM
Ron HessRon Hess
be sure to append the '__c' after the custom field name.
knicholsknichols

Here is the trigger I'm creating.

trigger updatePricing on Product2 (after update) {

for(Product2 p : Trigger.new)

{

// If the product has been de-activated...

if ( p.isActive == FALSE )

{

p.Alternate_1__c='Inactive';

}

}

}

knicholsknichols
I posted a little of the code but I not sure if that's the problem or not.  I can create a new trigger and get the same error.
knicholsknichols

Here is the error I receive in the interface when I change a product to inactive.  What user does the trigger run as?  I'm an admin.

Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger updatePricing caused an unexpected exception, contact your administrator: updatePricing: execution of AfterUpdate caused by: System.Exception: Record is read-only: Trigger.updatePricing: line 7, column 5

PuzzledPuzzled
Funny, I just got that same error too and don't understand why.
 
But I changed the trigger event from "after update" to "before update" and it worked.


Message Edited by Puzzled on 01-08-2008 04:00 PM
knicholsknichols
Same here, before update works.  I'm not sure if we are 'missing' something or there is a problem because it seems like it should work either way.