0

I've the following code for a task object which redirects after clicking one of the record types which I am trying to add onto my custom console components

<apex:page standardController="task">
    <apex:sectionHeader title="Task Edit" subtitle="{!task.Subject}"/>
    <apex:form >
        <apex:pageBlock title="Task Edit" mode="edit">

            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Save & New" action="{!save}" />
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>


            <apex:pageBlockSection title="Fields" columns="2">
                <apex:inputField value="{!task.eSVS_no__c}" required="false"/>
                <apex:inputField value="{!task.Class_subclass_mix_list__c}" required="false"/>
                <apex:inputField value="{!task.QC_no__c}" required="false"/>
                <apex:inputField value="{!task.Vendor__c}" required="false"/>
                <apex:inputField value="{!task.Instock_S_o__c}" required="false"/>
                <apex:inputField value="{!task.What_Vendor_Won__c}" required="false"/>
                <apex:inputField value="{!task.Department_Categories__c}" required="false"/>
                <apex:inputField value="{!task.Disposition__c}" required="false"/>
                <apex:inputField value="{!task.Description__c}" required="false"/>
                <apex:inputField value="{!task.Subject}" required="false"/>
                <apex:inputField value="{!task.Summary__c}" required="false"/>
                <apex:inputField value="{!task.ActivityDate}" required="false"/>
                <apex:inputField value="{!task.Priority}" required="true"/>
                <apex:inputField value="{!task.Status}" required="true"/>
                <apex:inputField value="{!task.OwnerId}" required="true"/>
                <apex:inputField value="{!task.WhatId}" required="false"/>
                <apex:inputField value="{!task.Name__c}" required="false"/>
            </apex:pageBlockSection>

        </apex:pageBlock>
    </apex:form>
</apex:page>

If I click the preview button, it takes me to the edit page. But when i Add this to my custom console component it says :"Id value a02g000000E64Dg is not valid for the Task standard controller "

I am attaching the screenshot here.

What could possibly go wrong here?

Thank you Venkatenter image description here

3

It seems you're passing the record ID of some other object to the page, not a task. The prefix for a task ID is 00T, you have a02 which leads me to believe you're passing the ID of a custom object since that prefix isn't in Daniel's comprehensive list.

Check the code for where you're including this component and double check what record ID you're passing to it.

  • as right mentioned by @Matt, you need to verify the ID you are passing to custom console component. The page's standardcontroller is receiving an ID of record which is not a TASK, hence it's throwing error – Anshul Dec 23 '16 at 2:43
  • Its related to the store object. Its picking up the data from the lookup field which is automatically filled when you click the "new task" button. I am new to this visualforce. what am i supposed to change it here? – abhi Dec 23 '16 at 16:00

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.