Skip to main content

I’m testing Skuid in an org with namespace “skuidtest1” and I’m following the tutorial to create a simple page to override the new action of a custom object and I get the error “Illegal arguments” when attempting to create a new custom object (skuidtest1__Estado__c).


  • The custom object has the new action overriden with the VF page: EstadoNew

  • The vf page EstadoNew has the following markup:

<apex:page standardController=“Estado__c” extensions=“skuid.Redirects” action=“{!redirect}?page=EstadoNew”/>


  • And the Skuid page EstadoNew has the following xml:














Nuevo estado




{{Name}}

























What am I missing?

When you look at your URL, do you see two question marks?  If so change the “?” in your VF code to be a “&”


Rob the URL result of clicking the New button is:


https://skuidtest1.na17.visual.force.com/apex/EstadoNew?retURL=%2Fa09%2Fo&amp;save_new=1&amp;sfdc.override=1

I’ve tried with VF code:

<apex:page standardController=“Estado__c” extensions=“skuid.Redirects” action=“{!redirect}?page=EstadoNew”/>


And with:

<apex:page standardController=“Estado__c” extensions=“skuid.Redirects” action=“{!redirect}&page=EstadoNew”/>


Both with the same error result.


It seems that the problem is with the namespace, since I’ve tried a very weird mix:


<apex:page standardController=“Contact” extensions=“skuid.Redirects” action=“{!redirect}?page=EstadoNew”/>


And the New button works correctly although obviously won’t work when saving changes since the page’s model (skuidtest1__Estado__c) doesn’t relate to the standadardController (Contact).


I have tried writing the full custom object including the namespace in the standardController attribute:


<apex:page standardController=“skuidtest1__Estado__c” extensions=“skuid.Redirects” action=“{!redirect}?page=EstadoNew”/>


But when saving the page Salesforce automatically removes the namespace.


This is what did work, I changed the VF page to:


<apex:page controller=“skuid.Redirects” action=“{!redirect}&page=EstadoEdit”/>


I found this solution in a earlier post:


https://community.skuid.com/t/visualforce-page-not-listed-when-overriding-tab?topic-re…


I do have a namespace in the current org but no managed package. I guess this is the way to go for namespaced orgs.


Thanks!


Altough another issue with this is when creating pages to override Tabs. Since the attribute recordSetVar needs the standardController attribute, then we are back where we started:


<apex:page standardcontroller=“Estado__c” extensions=“skuid.Redirects” recordSetVar=“e” action=“{!redirect}&page=EstadoTab”/>


And this doesn’t work. So, how should I do to use recordSetVar and controller=“skuid.Redirects” ?


You actually don’t need recordSetVar in order to override Tab pages. Just do:


<apex:page controller=“skuid.Redirects” action=“{!redirect}&page=EstadoTab”/>


or


<apex:page readonly=“true” doctype=“html-5.0”>

<skuid:page page=“EstadoTab”/>

</apex:page>


I was following this tutorial where it says I need recordSetVar:

http://help.skuidify.com/m/getting-started/l/102647-override-a-standard-salesforce-tab-page-layout

But I’m really glad you keep having these “Ace” cards under the sleeve. Thanks for saving the day again!


Yes, unfortunately the Visualforce overrides are more complicated on Managed Package objects. Most of our users don’t run into this, and so I think we’ve tried to keep it simple, at the expense of covering all of the edge case scenarios.


So in order to deploy my work to the Packaging org (namespaced as well) I should stick to this alternative right? And just replace all skuidtest1 namespace occurrences in staticResources for the packaging org namespace correct?


Just a further insight on this because I realized that apparently neither this code:


<apex:page standardcontroller="Estado__c" extensions="skuid.Redirects" action="{!redirect}&amp;page=EstadoNew"/>

nor this code:


<apex:page controller="skuid.Redirects" action="{!redirect}&amp;page=EstadoNew"/>

worked as expected.


The first one has the little disadvantage that throws an unexpected error because of illegal arguments when running the page (I think is because standardController attribute doesn’t have the namespace and trying to add it manually won’t work beacuse SF will remove it automatically so standardcontroller=“namepsace__Estado__c” will turn into standardcontroller=“Estado__c” when saving the changes).


The second one does work but has the disadvantage that it doesn’t get listed in the Custom Object action override page i.e. Setup/Create/MyCustomObject/Buttons, Links, and Actions (I think this is because the code doesn’t refer to the custom object anywhere).


So what ended up working was this third option as Zach suggested:


<apex:page <b>standardController="Estado__c"</b> readonly="true" doctype="html-5.0">
<skuid:page page="EstadoEdit"/>
</apex:page>

But I had to add the standardController attribute. This way it works as expected while running the page and the VF page does get listed in the override actions page as well.


To finish, and to avoid getting confused as me with different code alternatives, you can use this same code for View, Edit, New and Tab actions, with the note that Tab will need that you add the attribute recordSetVar:


<apex:page standardController="Estado__c" <b>recordSetVar="e"</b> readonly="true" doctype="html-5.0">    <skuid:page page="EstadoTab"/>
</apex:page>

I hope this helps other developer bros.


PS. If you find this not accurate please let me know.


Reply