0

Why do I get this error: value for apex:inputField is not a dynamic binding! ?

My return page is supposed to display details from both Order_Form__c and Order__c objects automatically upon searching a certain order form record from the lookup field on the Return__c object. But every time I hit the preview button, there comes the said error.

Here's my controller:

ReturnManagementCX

public with sharing class ReturnManagementCX {

    private ApexPages.StandardController con;
    public Return__c returnRecord {get;set;}
    public Order_Form__c ordformqry {get;set;}
    public List<resultWrapper> ordwrapperlist {get;set;}
    public List<Return__c> return1 {get;set;}
    public Return__c newReturn {get;set;}
    public Order_Form__c orderformclone = new Order_Form__c();
    public Boolean Page1 {get;set;}
    public Boolean ShowTable {get;set;}
    public Boolean ShowOrderForm {get;set;}


    public ReturnManagementCX(ApexPages.StandardController controller) {
        con = controller;
        Page1 = true;
        ShowTable = false;
        ShowOrderForm = false;
        ordwrapperlist = new List<resultWrapper>();
        ordformqry = new Order_Form__c();
        orderformclone = new Order_Form__c();
        return1 = new List<Return__c>();
    }

    public void init() {

        ShowTable = true;

        List<Order__c> orders = new List<Order__c>();
        List<resultWrapper> tempwrapper = new List<resultWrapper>();

        if(returnRecord.Order_Form__c != null) {

            ordformqry = [SELECT Id, Name, Account__c, Purchased_Date__c, Status__c FROM Order_Form__c WHERE Id =: returnRecord.Order_Form__c];
            orderformclone = ordformqry.Clone(true,true,true,true);
        }

        if(returnRecord.Order_Form__c == null) {
            ordwrapperlist.clear();
        }

        if(returnRecord.Order_Form__c != null) {

            orders = [SELECT Id, Name, Product__c FROM Order__c WHERE Id =: returnRecord.Order_Form__c];


        }

        for(Order__c ordloop : orders) {
            tempwrapper.add(new resultWrapper(ordloop));
        }

        if(tempwrapper != null) {
            ordwrapperlist = tempwrapper;    
        }
    }

    public void proceed() {
        List<Return__c> returnlist = new List<Return__c>();
        Return__c newReturn = new Return__c();

        Set<Id> newIds = new Set<Id>();

        System.debug('ordformqry v orderformclone>>' + ordformqry +'>>'+orderformclone);

        if(orderformclone.Account__c != ordformqry.Account__c || orderformclone.Purchased_Date__c != ordformqry.Purchased_Date__c || orderformclone.Status__c != ordformqry.Status__c) {
            System.debug('before update ordformqry>>'+ordformqry);
            update ordformqry;
            System.debug('after update ordformqry>>'+ordformqry);
        }



        if(returnlist.size() > 0) {
            insert newReturn;

            Set<Id> ids = new Set<Id>();

            for(Return__c idloop : returnlist) {
                ids.add(idloop.id);
            }

            List<Return__c> retqry = [SELECT Id, Name, Order_Form__c, Order__c FROM Return__c WHERE Id IN : ids];
            System.debug('retqry>>'+ retqry);

            return1 = retqry;  
        }


    }

    public class resultWrapper {
        public Order__c orderlist {get;set;}

        public resultWrapper(Order__c ord) {
            orderlist = ord;
        }
    }

}

And here's my vf page:

ReturnManagementPage

<apex:page standardController="Return__c" extensions="ReturnManagementCX">

    <apex:form id="theForm" rendered="{!Page1}">

        <apex:pageBlock id="block1">

            <apex:pageBlockSection >

                <apex:inputField >
                    <apex:actionSupport action="{!init}" event="onchange"/>
                </apex:inputField>

            </apex:pageBlockSection>

            <apex:pageBlockSection id="orderforminfo" rendered="{!ShowOrderForm}">

                <apex:inputField value="{!ordformqry.Account__c}"/>
                <apex:inputField value="{!ordformqry.Purchased_Date__c}"/>
                <apex:inputField value="{!ordformqry.Status__c}"/>

            </apex:pageBlockSection>

        </apex:pageBlock>

        <apex:pageBlock id="block2" rendered="{!ShowTable}">

            <apex:pageBlockSection id="block2" title="Order Items">

                <apex:pageBlockTable value="{!ordwrapperlist}" var="ol">

                    <apex:column headerValue="Product" value="{!ol.orderlist.Product__c}"/>

                </apex:pageBlockTable>

            </apex:pageBlockSection>

        </apex:pageBlock>

    </apex:form>   

</apex:page>

I'll appreciate any help, thanks.

1

Your <apex:inputfield> is missing value attribute, set the value for the inputfield like <apex:inputfield value = "{!instanceOfSObject.Field}">.

Value of for inputfield is A merge field that references the Salesforce field that is associated with this inputField. For example, if you want to display an input field for an account's name field, use value="{!account.name}". You can't associate this inputField with a formula merge field of type currency if your organization is using dated exchange rates.

  • But ordformqry references the Order_Form__c object in my controller, and I intend to get and display the values of the fields from that object. Any way, I tried modifying it to e.g.: {!Order_Form__c.Purchased_Date__}, and it displayed this error: Unknown property 'Return__cStandardController.Order_Form__c' – lol Jul 9 '16 at 14:00
  • I think you misunderstood expression "{!SObject.Field}", check the updated one in answer. – Ishwar Mete Jul 9 '16 at 14:09
  • It should be like value = "{!ordformqry.Purchased_Date__c}" if you want to use Purchased_Date__c field on Order_Form__c – Ishwar Mete Jul 9 '16 at 14:12
  • That's what I actually did, please see the original vf page I've posted. – lol Jul 9 '16 at 14:14
  • <apex:pageBlockSection id="orderforminfo" rendered="{!ShowOrderForm}"> <apex:inputField value="{!ordformqry.Account__c}"/> <apex:inputField value="{!ordformqry.Purchased_Date__c}"/> <apex:inputField value="{!ordformqry.Status__c}"/> </apex:pageBlockSection> Here's portion of the code from the original vf page I've posted. – lol Jul 9 '16 at 14:16

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.