Apex code (and triggers) run in system security context unless 'with sharing' is specified and that works great and allows us to control things. However Chatter completely ignores this paradigm and has a security ruleset of its own which we cannot tweak or configure. Namely even though the code runs in system context you cannot insert a FeedPost into private groups unless running user is a member and there is no way to allow this?! Why the duality? Why is the existing security scheme bad for chatter?

Namely this prevents us from posting custom notifications into special team's private groups when a certain condition happens on a record (and caused by people who should not have read access to other stuff in the private group), but the usability being blocked does not stop there. Given that Apex does not allow user impersonation there is absolutely NO way for an apex code/trigger to generate and insert a message into a group unless the record change is caused by the user already in the group (which kind of defeats the whole purpose of bringing it to groups' attention).

How do I replicate these two related lists in a custom visual force page?

We had to replace a default view for the object with a custom page so now we need to have this functionality (so users can attach docs from workspaces, generate deliveries and see whats related to this object). However, I can't seem to find any solution or workaround for this

1. There does not seem to be a special apex : * tag for these two lists, and it appears there are no documented tags in any namespace to do it either (like there is for idea and will be for chatter)

2. The regular apex:relatedList tag doesnt cut it, ther is no child relationship defined in the schema that can feed the data

3. I tried doing a custom page block but then I could not find where the ContentVersion/ContentDocument and objects meet?

4. The API is not providing the information either

Is there any support for content related matters in apex/VF? It seems that the many-2-many object linking objects and content documents/versions is completely hidden from us and I don't understand why, there certainly is a business case for knowing which documents are related to a case or an account (or a custom object for that matter)

We have a weird page that is acting up on us. It works properly for admins but for a specific profile its just acting up. All page and extension class security is allowed for this profile, also object and FLS security are set properly. The weird part is that one day it works, another it does not without anything being changed and we are clueless as to why it happens since the apex logs are all success, the apex code all runs properly but before the page is rendered to us something happens in VF ewngine and we get a securty block.

I understand that its not a good thing to give an offending user too much information pertaining to security (tells them what to hack if they are malicious) but an admin needs to be able to troubleshoot these situations and see where and why security block was activated. Is there such a facility on SF? We really need to find out why this page trips apparently randomly, its annoying the operators and by extension its annoying us through support requests.

I have a small page with a dynamic ajax outputPanel that gets rerendered on certain user action and it all works good until the newly loaded pageBlock contains rich edit field (rendered with apex : inputField). Then, I get this javascript error and the entire viewport gets blanked. The initial page load does not contain rich edit field (in case it makes a difference, like it did with calendar popups)

Error:

Object doesn't support this property or method

3_3_0.GAorg.ajax4jsf.javascript.AjaxScript, line 173 character 590

By the looks of call stack it appears as if the Ajax caller failed to parse the response from SF and tried to raise an error and then ran into a missing property/method. The error location is pointing to a piece of code containing "finally{window.document.open=oldDocOpen;}" if that makes any difference as well.

I am making an override of the default factory view for a Contract and everything works fine except that I can't seem to be able to show "Contract History" related list (with field tracking changes). I tried the following:

<apex:relatedList list="Histories" />

as I see this child relationship in API definition, however I get the "'Histories' is not a valid child relationship name for entity Contract" error (if I try some other related list it works ok). What is the VF construct to show this related list? I would hate to have to code this as a custom VF block with a table.

I forgot to mention that using relatedList="true" in apex:detail is not an option, we overrode the default page so we can inject custom stuff between main detail block and the related lists.

They want to keep Vendors separate from paying accounts, so they created a Vendor__c object. Now they want to leverage the contracts capabilities of SF to handle their contracts with the vendors and thats where the problem shows up, apparently SF Contracts mandatorily require Account to be set and account cannot even be removed from the page layout ("always on layout").

We though about solving this with a predefined account to keep all vendor contracts but this forces the user to manually assign it each and every time (not to mention human error). We then wanted to assign this predefined account through before insert trigger (as we'll know that the new contract came from a vendor's detail page) but we can't even get to the trigger part sicne page layout validation kicks in for an "always on layout" account.

Is there a workaround for this? Did I mention, they really dont want to have to keep their vendors as accounts.

I have a vendor object which I tied to Contact objects in order to create contacts for a Vendor, I also created a special contact record type and special vendor contact page layout associated with this record type. I then created a button (shown in vendor's contact related list) called "New Contact Vendor" as a URL:

The point being that this URL should skip the record type selection, assign vendor contact record type, hook it up with vendor object (this works) and then goes to vendor contact page layout to edit new contact. However, this does not happen, I am still shown the record type selection page.

If I put save=1 into parameters (as I've seen in other threads) then it skips the selection page but goes to the default record type's page layout, not the desired page layout, as if it completely ignored record type assignment. Even when I fill the contact and save it shows its record type to be the default one, not the vendor contact one (01270000000Dx6EAAS). I must also state that all record types are accessible to all profiles, so security is not an issue.

The api server name now does not have c. in the dns name (na5... instead of c.na5...) and session ID looks slightly different. HOwever the c# code works so the problem is not in my external code.

So, what is going on? Is Apex/VF broken and emits invalid ajax URL's and session ID's with {!$Api.xxx}? How do I resolve this as I must launch the URL from apex code (its a finale of a series of operations in a wizard)

There are two fields in the Contact sobject which control the SF logic for email bounces (EmailBouncedDate, EmailBouncedReason). My client essentially uses SF web services API from inhouse invoice emailing system to mark those email addresses that bounced back for whatever reason thus bringing this to the attention of CSR's.

The problem is that I cannot reset these fields back to null from apex if its personal account. I have a form which CSR's use to clean up customer account information and as part of account update I also set these fields on asssociated contact, but it throws an error, making me unable to manually remove the bounce flag.

For some reason SF disallows DML operation on contact entity if its tied to a personal account (probably to protect the bizare redundancy between person/contact objects) but this leaves me wondering how I can change those contact fields which are not redundant, like the two above?

I have a problem which I think is simple but for some reason is eluding me. Here's the setup: I have two pageBlocks on the same VF page, but they are independent from each other, meaning user can fill either one or another and save one or another, not both. However both blocks have their own mandatory fields and each block has its own save button which fires up an extension method.

The problem: button in one block always fires the validation for the entire page, regardless of where I put the actionRegion, thus preventing me from submiting jsut a portion I need (which is valid). I tried embedding the whole pageblocks in action regions, it didnt work, i tried just the sections, still no game. It seems like actionRegion has zero influence on the commandButton. Do keep in mind that I have to submit the page block data on button so immediate=true wont cut it.

I noticed that you plan to obsolete s-controls come end of this year. I would like to recommend that you do not obsolete s-controls until you bring apex/VF into the same functional bracket and allow us some time to convert our existing s-controls into VF/Apex.

As things stand now, Apex classes do not cover the full API avaliable to s-controls (for example, describeLayout, dependant picklists discovery, picklists for record types, and other web services API calls) and if you obsolete them you will prevent us from maintaining existing codebase and replacing them with newVF ones without offering functional alternative solution, which I assure you is very serious. At the minimum EVERYTHING that is currently available to s-controls has to be present in apex, you could freeze further development of s-control API but you cannot expect us to obsolete our business processes. If we need API calls then we need API calls, and if Apex does not provide them we are forced to stick to s-controls.

OK, I have to create a special "control" that will be part of the page layout for one of the case record type's layout. I see that I can place an vf page as a 'field' in the page layout and I wanted to use this functionality.

I created the vf page and simply put it has an apex:inputfield plus some of our own content in it. The extension class does get loaded and tied to case's controller and the field binds. The problemsI have are:

1. I want to make it look like just another section item in the layout, since it now renders as an independent IFRAME. If I create a full vf layout from <apex: pageBlock> as I would for a full blown page then I get a block in a block which is utterly ugly. What am I missing?

2. The vf page only shows in the VIEW mode, and with the field in edit mode, whilst when the whole page is in edit mode the vf page is not rendered at all? Again, how do I adjust that my control follow the layout's mode (be a view when in view mode and show as editable when in edit mode)?

3. If #1 is impossible, can I at least embed a VF page as a pageBlock on its own. I tried dragging the page between two page blocks in page layout editor but it wont stick as a block, only as a section item.

Is that possible? I want to get the L&F of a related list page block, e.g. it has a header but no footer.

I tried using the footer facet to suppress content, but it only suppresses the inside content of the footer, not the footer itself, which produces a very ugly two-line output (I only want to show the lower bended line which closes the page block). Unfortunately there seems to be no attribute on page block to be able to suppress it... Any ideas?

Me again with my GP_Bill_Item. I now have a VF page and an extension class and new/edit has been replaced for the SOBject and it all works great.

Now, there is a related list of bill items on the case page layout (for all the bill items for that case) and there is a "factory" New button which when clicked calls my page by default (since New has been overriden with my page). I see that case's ID is embedded in the URL of the page call (bold italic):

but as far as I can see it does not set the GP_Bill_Item.Case__c field automatically. Is there a way to reach this value from somewhere? I would rather not guess at the querystring name as it does not seem very "friendly" (italic) or for that matter stable. I need all this so I can lockdown the account/case field if invoked from a specific case.

I have an extension on a standard controller for my object GP_Bill_Item__c. Creating new entry works ok, but when I use this VF page for editing I get the above error when accessing Owner field from extension code. I know there is an optimization in field loading for edit as expressed in other topics, but no matter what I put in hidden output on VF page the owner does not seem to get loaded:

<apex:outputText value="{!billItem.Owner}" rendered="false"/>

I tried different variations for this field but nothing seems to get the owner loaded. What am I doing wrong?

The code that fires an error:

public extension_GPBillItem(ApexPages.StandardController stdController)

Its been driving me nuts, as all of your other samples state it works, but for me it does not. Below are the pieces of code.

The actionSupport gets called on account (status is updated) but the property setters never get called from ajax (i tried in FF, IE and chrome), I only get GETTER and GETTER2 entries in the log, there is no setter call for either the contract or the account. The action Suport is properly placed inside the selectlist, so I do not believe this is a wiring problem.

Another problem I have is that select list does not 'rewind' to the current value of the getter. For example if Account__c is preassigned the select list is always positioned on the first entry in the list.

Hi, I am porting a wizard from crappy looking s-controls to a set of apex pages and I have some problems. I can't seem to find a way to call describeLayout() for an SObject (Case in this case). I actually need access to methods:

recordTypeMappings(field).picklistsForRecordType()

I need this so I can limit the two dependent picklists based on the current record type. The <apex:inputField> seems to completely ignore the record type and picklist dependency and just shows all picklist values and apex framework does not seem to have describeLayout() support (?!?!?)

The only thing I can get is a List<Schema.PicklistValue> from Case.mylist.getDescribe().getPicklistValues() but this is not limited in any way. And hardcoding is not an option because picklists should be expandable without having to resort to coding again.

I also cannot find a validFor property in Schema.PicklistValue that keeps a bitmap for dependencies between values of two dependent picklists.

I have an extension on a standard controller for my object GP_Bill_Item__c. Creating new entry works ok, but when I use this VF page for editing I get the above error when accessing Owner field from extension code. I know there is an optimization in field loading for edit as expressed in other topics, but no matter what I put in hidden output on VF page the owner does not seem to get loaded:

<apex:outputText value="{!billItem.Owner}" rendered="false"/>

I tried different variations for this field but nothing seems to get the owner loaded. What am I doing wrong?

The code that fires an error:

public extension_GPBillItem(ApexPages.StandardController stdController)

How do I replicate these two related lists in a custom visual force page?

We had to replace a default view for the object with a custom page so now we need to have this functionality (so users can attach docs from workspaces, generate deliveries and see whats related to this object). However, I can't seem to find any solution or workaround for this

1. There does not seem to be a special apex : * tag for these two lists, and it appears there are no documented tags in any namespace to do it either (like there is for idea and will be for chatter)

2. The regular apex:relatedList tag doesnt cut it, ther is no child relationship defined in the schema that can feed the data

3. I tried doing a custom page block but then I could not find where the ContentVersion/ContentDocument and objects meet?

4. The API is not providing the information either

Is there any support for content related matters in apex/VF? It seems that the many-2-many object linking objects and content documents/versions is completely hidden from us and I don't understand why, there certainly is a business case for knowing which documents are related to a case or an account (or a custom object for that matter)

I have a small page with a dynamic ajax outputPanel that gets rerendered on certain user action and it all works good until the newly loaded pageBlock contains rich edit field (rendered with apex : inputField). Then, I get this javascript error and the entire viewport gets blanked. The initial page load does not contain rich edit field (in case it makes a difference, like it did with calendar popups)

Error:

Object doesn't support this property or method

3_3_0.GAorg.ajax4jsf.javascript.AjaxScript, line 173 character 590

By the looks of call stack it appears as if the Ajax caller failed to parse the response from SF and tried to raise an error and then ran into a missing property/method. The error location is pointing to a piece of code containing "finally{window.document.open=oldDocOpen;}" if that makes any difference as well.

I have a problem which I think is simple but for some reason is eluding me. Here's the setup: I have two pageBlocks on the same VF page, but they are independent from each other, meaning user can fill either one or another and save one or another, not both. However both blocks have their own mandatory fields and each block has its own save button which fires up an extension method.

The problem: button in one block always fires the validation for the entire page, regardless of where I put the actionRegion, thus preventing me from submiting jsut a portion I need (which is valid). I tried embedding the whole pageblocks in action regions, it didnt work, i tried just the sections, still no game. It seems like actionRegion has zero influence on the commandButton. Do keep in mind that I have to submit the page block data on button so immediate=true wont cut it.

I noticed that you plan to obsolete s-controls come end of this year. I would like to recommend that you do not obsolete s-controls until you bring apex/VF into the same functional bracket and allow us some time to convert our existing s-controls into VF/Apex.

As things stand now, Apex classes do not cover the full API avaliable to s-controls (for example, describeLayout, dependant picklists discovery, picklists for record types, and other web services API calls) and if you obsolete them you will prevent us from maintaining existing codebase and replacing them with newVF ones without offering functional alternative solution, which I assure you is very serious. At the minimum EVERYTHING that is currently available to s-controls has to be present in apex, you could freeze further development of s-control API but you cannot expect us to obsolete our business processes. If we need API calls then we need API calls, and if Apex does not provide them we are forced to stick to s-controls.

Is that possible? I want to get the L&F of a related list page block, e.g. it has a header but no footer.

I tried using the footer facet to suppress content, but it only suppresses the inside content of the footer, not the footer itself, which produces a very ugly two-line output (I only want to show the lower bended line which closes the page block). Unfortunately there seems to be no attribute on page block to be able to suppress it... Any ideas?

I have an extension on a standard controller for my object GP_Bill_Item__c. Creating new entry works ok, but when I use this VF page for editing I get the above error when accessing Owner field from extension code. I know there is an optimization in field loading for edit as expressed in other topics, but no matter what I put in hidden output on VF page the owner does not seem to get loaded:

<apex:outputText value="{!billItem.Owner}" rendered="false"/>

I tried different variations for this field but nothing seems to get the owner loaded. What am I doing wrong?

The code that fires an error:

public extension_GPBillItem(ApexPages.StandardController stdController)

Hi, I am porting a wizard from crappy looking s-controls to a set of apex pages and I have some problems. I can't seem to find a way to call describeLayout() for an SObject (Case in this case). I actually need access to methods:

recordTypeMappings(field).picklistsForRecordType()

I need this so I can limit the two dependent picklists based on the current record type. The <apex:inputField> seems to completely ignore the record type and picklist dependency and just shows all picklist values and apex framework does not seem to have describeLayout() support (?!?!?)

The only thing I can get is a List<Schema.PicklistValue> from Case.mylist.getDescribe().getPicklistValues() but this is not limited in any way. And hardcoding is not an option because picklists should be expandable without having to resort to coding again.

I also cannot find a validFor property in Schema.PicklistValue that keeps a bitmap for dependencies between values of two dependent picklists.