You need to sign in to do that
Don't have an account?
sdeveloper
Visual Force Page and General Fields
Hello,
For the general Account Page, rather than writing the apex code out to recreate one section, I inserted a visualforce page in the layout. This way I can have an entire section that changes based on pick-list values. However, I want to remove those fields from the general layout (since they're on the Visualforce insert) but when I take them off, they dissapear from everywhere completely. Is there a way to simply hide the fields or stop this from happening? Or do I have to rewrite the code for the entire Account page?
Is the field on any other layout?
Just on the General Account Page display and the Account Edit Page
So are they disappearing on the VF component, or is the issue at hand that they're a) no longer on the edit page and b) the VF component doesn't appear on the edit screen?
they dissapear on the edit and the visual force page
Not sure why they would disappear on the VF page itself, sounds more like an FLS or profile thing. However, more germaine - no, you can't have a VF component on the edit page, despite what might be on your layout. You'd need a full VF overrride on the edit page.
Yes my Edit page I have already completely re-written..the problem exists on the regular Account Detail page
Can you post some of the relevant code? You should be able to keep the VF page embedded on the standard layout, and you can have that edit the current record as well. For example, I have this:
Removed Publish Year from the layout, and can update Publish Year on the View page.
This is what my Visualforce insert is written as
What's the event flow like? Because based on that component, unless Employer Health Plan has a default value - you wouldn't see anything on a fresh record. You'd have to go to the View -> Edit -> Back to View. Quickedit, for instance, wouldn't effect the component until the view was completely refreshed.
Well this is just an insert in the general display of the full account page. So if nothing is selected, yes it is blank. The rest of the record however is sitll there because it all exists outside of this section
So to be sure VF can or can't see the fields, I'd add something like:
At the top. I think null is correct there, not empty string. This will give you some feedback what VF thinks the current record state looks like.
If that renders, you might add something to refresh the page automagically to detect data changes.
ok thanks!
Do you know of any way that I can make it so I can take the original fields off of the detail page without it affecting the VisualForce insert? Because technically, i have duplicates of the feilds as it is right now...one set in the visual force section..the other set just sitting at the bottom of the full detail page
*facepalm* - of course. Now it all clicks together. You've got a chicken and egg problem, right? You want to remove the fields from the layout and have them on the VF form, but you need the user to be able to enter that data for your VF component to operate.
So I think now you are back to the edit conundrum. You could:
1) Put input fields into the VF component hand have the user edit on the view page. That would require updating the null block we have above with a form similar to the Book example I tested out.
2) Override the edit page completely, and include the inputFields for the Health Plan on the overridden page. This obviously has the normal issues of not being able to rely on the Page Layout Editor for field control, etc.
I suppose a third would be to have a page just for editing the Health Plan, and add a button to that page on the layout. A bit of both approaches there.
As I currently have it, the entire Edit page is redone as a visual force page. But when I try to remove the fields from the Account Page Layout, it wont show up in my Edit Visual Force page. It's not like they get deleted out of the code, they just simply won't show up at all. Then it also, won't show up in the VisualForce insert on the main display page.
It's as if when I remove them from the page layout, it overrides all of my code.