Page Override: Edit Not Working

  • 1
  • Problem
  • Updated 5 years ago
  • Solved
  • (Edited)

We are overriding our "Task" Edit and View objects to go to a VisualForce page:

MDI.page

<apex:page standardController="Task" docType="html-5.0" readOnly="true"    extensions="MDIController">
    <skuid:page objectType="Task" actionType="View,Edit"  />
</apex:page>

(Have been playing around with "View/Edit" vs distinguishing "View" and "Edit" separately and the results seem to be the same)




The page assignments are set up like so:



Both view and edit work as expected when the Task is suppose to load the Skuid Page (type .

However Tasks that are suppose to override to the standard layouts don't work so well...

You can view the object fine, but when trying to edit the page it just redirects and ends back up on the view page.

Detailed Results:  

If I try to go to a non skuid override task:
[ORG_DOMAIN]/[TASK_ID]

It will first redirect to the page override (as expected):
[ORG_DOMAIN]/apex/MDI?id=[TASK_ID]&sfdc.override=1

Then redirect to the view task page (as expected):
[ORG_DOMAIN]/[TASK_ID]?nooverride=1&sfdc.override=1

When I click the edit button it redirects as follow:
[ORG_DOMAIN]/apex/MDI?retURL=%2F[TASK_ID]%3Fnooverride%3D1%26sfdc.override%3D1&amp;scontrolCaching=1&amp;sfdc.override=1&amp;id=[TASK_ID]

Which then redirects it to:
[ORG_DOMAIN]/[TASK_ID]?nooverride=1&amp;retURL=%2F[TASK_ID]%3Fnooverride%3D1%26sfdc.override%3D1&amp;scontrolCaching=1&amp;sfdc.override=1

The url were looking for should be something like this, but it doesn't seem to ever redirect to the edit page:

[ORG_DOMAIN]/[TASK_ID]/e?retURL=%2F[TASK_ID]
Photo of Charlie Jonas

Charlie Jonas

  • 670 Points 500 badge 2x thumb

Posted 5 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
To get this to work, you will need to have 2 separate Visualforce Pages, like this:

MDIView.page

<apex:page standardController="Task" docType="html-5.0" readOnly="true"    extensions="MDIController">
    <skuid:page objectType="Task" actionType="View"  />
</apex:page>



MDIEdit.page

<apex:page standardController="Task" docType="html-5.0" readOnly="true"    extensions="MDIController">
    <skuid:page objectType="Task" actionType="Edit"  />
</apex:page>
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Some further explanation here that might be helpful: the Object Type and Action Type attributes that you specify here are just passed directly into a SOQL query on the Page Assignment object when the page loads. So when you say objectType="Task" and actionType="View", Skuid does a SOQL query that, in super stripped-down version, is like this:

select ... from skuid__Page_Assignment__c where ObjectType = :objectType and ActionType = :actionType

So, if you set actionType to "View,Edit", Skuid looks for Page Assignment records where ActionType is literally equal to "View,Edit", which as you can see from the Page Assignments tab, is not a possible value to choose for the "Action Type" field.

That's why you have to have separate Visualforce Pages that request Page Assignments associated with Task Edit and Task View.


Photo of Charlie Jonas

Charlie Jonas

  • 670 Points 500 badge 2x thumb
Makes sense, what's the rationale behind "View/Edit"? 
Photo of Charlie Jonas

Charlie Jonas

  • 670 Points 500 badge 2x thumb
Also, since you guys changed up the layout I'm not sure how to mark this one as resolved?  (the ability to make code blocks seems to be gone as well)
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
The rationale behind View/Edit was that it was intended to be used for exactly what you're doing here, but it ended up causing us way more problems than it solved, so we've deprecated it. New installs of Skuid don't have "View/Edit" or "Tab/List" as options.

Yeah the new UI change has gotten me, too --- what I do to add code blocks now is to write my code, then select it and click "pre", this wraps it in a pre tag and it seems to work well.
Photo of Charlie Jonas

Charlie Jonas

  • 670 Points 500 badge 2x thumb
Awesome, thats kinda what I figured.  

On the plus side, I can view all the past questions I've created now, which is very helpful.

Thanks again for the great support.