function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TeachMeTeachMe 

Fetching custom object data into Visual force and embedding VF page in standard tab/object

Hi,

 

I want to use custom object field values in VF page ( I can do this by specifying the controller as my custom object and page loads in the custom tab).

Now the page created above I need to embed this in some other Tab say Account. I don't get an error when I use the above page on wellform page. But it shows an error:

Content cannot be displayed: Id value 001d000000Va7JT is not valid for the "mycustomobject"

I understand the error. But I really need to use this VF page in the standard tab.

 

Any pointers help is most appreciated.

 

Please ..

 

Best Answer chosen by Admin (Salesforce Developers) 
JitendraJitendra
Because you might be using Standard Controller or COntroller extension. Try to use Custom COntroller and get Id of custom object from Account tab or whatever logic you need.

All Answers

JitendraJitendra
Because you might be using Standard Controller or COntroller extension. Try to use Custom COntroller and get Id of custom object from Account tab or whatever logic you need.
This was selected as the best answer
TeachMeTeachMe
Thanks Jitender. I still can't get it working it complains about the String.Name. I had a VF page as (is master-child relation with Account) and is embedded on the custom object. ... Tilte for Job := {!Title__c} - works fine ( I add a line to fetch this -> Account Name ={!Account.Name} - I get an error ) [Error] Error: Unknown property 'mycustomobject __cStandardController.Account' As per your suggestion: I change it to : (Title__c is the text title field) Tilte for Job := {!Title__c} [Error] Error: The name can only contain underscores and alphanumeric characters. It must begin with a letter and be unique, and must not include spaces, end with an underscore, or contain two consecutive underscores. Please guide me, thanks again. Thanks, RPrabha
JitendraJitendra
Can you please post the code ?
TeachMeTeachMe

Ignore my prev reply I understand what went wrong and now I have it working.

Thanks atons.

 

Regards,

RPrabha

Vishal (Sops)Vishal (Sops)

I have similar requirement, I have to show related custom object fields on VF page and show that page at account level in a section. How do we do that? Any help will be much appreciated.

 

Best Regards,

Vishal Sharma

TeachMeTeachMe

Hi Vishal,

 

I followed what Jitender mentioned in the post above.

 

 

Create a new hello VF page( say testAccount) specify standardcontroller as Account and and it will show up under VF pages menu under Account -> Record( create one if no record is there) Edit page layout  options. Add / drag it on the Account page under any section you want( even new).

 

Save the settings.

 

Now open your VF page for edit ; change standardcontroller to controller="yourcustomcontroller".

 

Now you can access both the account as well as custom object.

 

Jitender: This is how i was able to add same page on different tabs( by first inserting standard controller and then editing it to replace customcontroller).Please correct me if there is any neater way of using same page in all tabs and is also deployable with ease.

 

HTH,

RP