1

I am getting the following error when creating a v-force page in a standard controller extension:

System.VisualforceException: Unknown property 'Award__cStandardController.awardAmount'

The interesting thing is that 1) I don't have a property named awardAmount at all in the v-force page or elsewhere, and 2) this error is popping up for other users but not for myself. (One of the other users has the exact same permissions/sets as I do and he gets the error but I still don't).

I do use a variable called cashAwardAmount and it is initialized like so:

public Decimal cashAwardAmount {get; set;}

I then set the value like so:

this.cashAwardAmount = currentAward.Cash_Award_Amount__c;

Which I then use in a visualforce page like this:

<apex:outputPanel>
    <apex:outputText value="Total Amount of Award ($): " />
    <apex:outputText value="{0, number, ###,###,##0}">
        <apex:param value="{!cashAwardAmount}"  />
    </apex:outputText>
</apex:outputPanel>

There are 3 visualforce pages that use the same {!cashAwardAmount} variables, but only 2 are failing. However, they all use the same Award__c standard controller and PDFFormCreatorController extension.

The only change we've made recently to the object was to push a validation rule that allows sys admin users to continue editing the record in certain stages.

I've read a lot of the other posts dealing with unknown property errors, but it seems like I'm doing the things that they weren't. I'm completely stumped.

Please let me know if you need more context, code snippets, etc.

Thank you!

  • Have you verified that all the 3 VF pages you mentioned have exactly the same name of the variable as declared in your controller, i.e., there are no typos or spelling mistakes? – Jayant Das Jun 25 '18 at 15:45
  • Did you do a search for !awardAmount in your pages? Maybe you missed a spot that has that... – Eric Jun 25 '18 at 16:26
  • I found a thread from the Dev forum with a similar issue - developer.salesforce.com/forums/?id=906F0000000Ao0CIAS. It states using a commandLink over a html anchor tag. Check this out! – Jigar Shah Jun 25 '18 at 17:35
  • I did verify that the variable names were the same and did a search for awardAmount in my IDE, which returned nothing. Oddly, in my sandbox, if I redeployed the controller class and the VF pages, even though they contained 0 changes, then everything worked. Re-compiling all classes didn't work in production, though. I'm going to upload a change set containing the controller class with all dependent VF pages and see if that makes things work again in production. – justinpdove Jun 25 '18 at 17:45
0

Ugh, this is so dumb. Somehow, earlier versions of my v-force pages and controller made it into my IDE but not into the sandbox. Then, when I pushed my controller changes to production, the 2 other VF pages were referencing a variable that was no longer in my controller, thus the unknown property error.

I'm not sure how this happened, but I guess it's a lesson to have a pretty strict workflow as it pertains to proper maintenance/version control of your code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.