• mmix
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 15
    Replies

How can I detect one without having to write a wrapper class carrying such indicator?

 

In general, how do you create JSON array using visualforce in regards to the ommission of last comma? For example, I currently use this approach:

 

<apex:page standardController="Case" extensions="extension_Timeline" contentType="text/javascript" showHeader="false" sidebar="false">
{ "data" : [ 
	<apex:repeat value="{!allItems}" var="item">
		<apex:outputText value="," rendered="{!NOT(item.firstItem)}" />
		{
			"Type": "{!item.ItemType}",
			"dateTime": "{!item.DateTime}",
			"userName": "{!item.UserName}",
			"content": "{!JSENCODE(item.Content)}",
			"FullContent": "{!JSENCODE(item.FullContent)}"
		}
	</apex:repeat>
]}

</apex:page>

 however, this approach forces me to "repack" the SOQL List<SObject> into List<MyCustomWrapperWithFirstRowIndicator> which is a pain and wastes resources. Any other approach I might be missing?

  • August 18, 2011
  • Like
  • 0

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).

  • February 16, 2011
  • Like
  • 0

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) 

 

Is there maybe an undocumented VF tag to do it?

 

  • September 30, 2010
  • Like
  • 0

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.

  • August 06, 2010
  • Like
  • 0

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.

  • July 07, 2010
  • Like
  • 0

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. 

Message Edited by mmix on 03-12-2010 09:45 AM
  • March 12, 2010
  • Like
  • 0

A client of mine  encountered a bit of a problem.

 

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.

  • November 20, 2009
  • Like
  • 0

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:

 

 

{!URLFOR($Action.Contact.NewContact, null, [CF00N70000002ZeEu=Vendor__c.Name, RecordType='01270000000Dx6EAAS'])}

 

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.

 

What am I doing wrong? Is this a bug?

 

 

  • November 04, 2009
  • Like
  • 0

Ok, something is going on and I have no idea what.

 

I have this code to collect URL and session ID:

 

<apex:inputHidden id="hidServerUrl" value="{!apiServerUrl}" /> <apex:inputHidden id="hidSessionId" value="{!apiSessionId}" /> <script> document.getElementById('{!$Component.hidServerUrl}').value = '{!$Api.Enterprise_Server_URL_160}'; document.getElementById('{!$Component.hidSessionId}').value = '{!$Api.Session_ID}'; </script>

 

Then in extension code I generate external URL:

 

public ApexPages.PageReference createDocument() { insert newDoc; ApexPages.PageReference forkUrl = new ApexPages.PageReference('https://my.server.somewhere/Fork.aspx'); forkUrl.getParameters().put('did', newDoc.id); forkUrl.getParameters().put('api', apiServerUrl); forkUrl.getParameters().put('session', apiSessionId); return forkUrl; }

 

and this generates a proper URL:

 

https://my.server.somewhere/Fork.aspx?did=a0X70000000GIvl&api=https%3A%2F%2Fc.na5.visual.force.com%2Fservices%2FSoap%2Fc%2F16.0%2F00D700000008lOu&session=00D700000008lOu%21AQoAQMRwIIDxH3WUdRafQ06pLQFSrfNHfMS7ON53nte0XUfnJ4apPmNphgETMlsMgOh7lQX.kbhvyVd5qdxbbrE9z6sFqy.I

However when I hook up to session using this c# code:

 

using (SforceService api = new SforceService { Url = ApiUrl, SessionHeaderValue = new SessionHeader { sessionId = SfSession } }) { QueryResult qr = api.query(..... }

 

I get the invalid session ID on query:

 

INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session

 

 

Now, here's a twist, if I launch the same page from a salesforce URL button (this button is not in apex, its a regular salesforce button defined on the custom object screen) defined as:

 

https://my.server.somewhere/Fork.aspx?did={!DMSDocument__c.Id}&api={!$Api.Enterprise_Server_URL_160}&session={!$Api.Session_ID}

 

 

 

I get this URL which works (it hooks up to session and the query works):

https://my.server.somewhere/Fork.aspx?did=a0X70000000GJ0M&api=https%3A%2F%2Fna5.salesforce.com%2Fservices%2FSoap%2Fc%2F16.0%2F00D700000008lOu&session=00D700000008lOu%21AQoAQMRwIIDxH3WUdRafQ06pLQFSrfNHfMS7ON53nte0XUfnJ4apPmNphgETMlsMgOh7lQX.kbhvyVd5qdxbbrE9z6sFqy.I

 

 

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)

 

 

Message Edited by mmix on 09-17-2009 10:57 AM
  • September 17, 2009
  • Like
  • 0

I have a problem.

 

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?

  • April 27, 2009
  • Like
  • 0

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. 

 

 

 

Message Edited by mmix on 04-02-2009 02:39 AM
  • April 02, 2009
  • Like
  • 0

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. 

  • February 27, 2009
  • Like
  • 0

I tried doing the following:

 

<apex:commandButton action="{!URLFOR($Action.Case.Tab, null)}" value="Cases Tab" />

 

to send the user to cases tab (which is overriden). HOwever, this gives me an error message (below).

How does one 'procure' the URL for cases tab in a dynamic fashion (since is no longer the factory page)?

 

 

Invalid parameter for function URLFOR

 

 

  • February 25, 2009
  • Like
  • 0

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 problems I 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.

 

 

Message Edited by mmix on 02-11-2009 11:22 AM
  • February 11, 2009
  • Like
  • 0

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?

 

 

 

 

 

 

  • February 09, 2009
  • Like
  • 0

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):

 

 

apex/Page_BillItem?CF00N70000001gTH4=1018617&CF00N70000001gTH4_lkid=500S0000000nvZx&scontrolCaching=1&retURL=/500S0000000nvZx

 

 

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.

Message Edited by mmix on 02-02-2009 06:04 AM
  • February 02, 2009
  • Like
  • 0

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)

{ this.billItem = (GB_Bill_Item__c)stdController.getRecord();

   // initial setup

   if (billItem.Owner == null) { billItem.OwnerId = UserInfo.getUserId(); } 

  • February 02, 2009
  • Like
  • 1

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.

 

Can anyone help? :

 

 

<apex:pageBlockSectionItem > <apex:outputLabel value="Account" for="cmbAccount"/> <apex:selectList value="{!currentAccount}" size="1" multiselect="false" required="true" id="cmbAccount"> <apex:selectOptions value="{!AccountOptions}" /> <apex:actionSupport event="onchange" status="ajaxStatus" rerender="owner"/> </apex:selectList> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="Rate" for="rateCombo"/> <apex:selectList value="{!billItem.Rate__c}" size="1" required="true" id="rateCombo"> <apex:selectOption itemValue="STD" itemLabel="STD"/> <apex:selectOption itemValue="N/C" itemLabel="N/C"/> <apex:selectOption itemValue="N/B" itemLabel="N/B"/> </apex:selectList> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="Contract" for="cmbContract" /> <apex:selectList value="{!currentContract}" size="1" required="true" id="cmbContract"> <apex:selectOptions value="{!ContractOptions}" /> </apex:selectList> </apex:pageBlockSectionItem>

 

 

 

 

 

public String getCurrentAccount() { system.debug('GETTER'); return billItem.Account__c; } public void setCurrentAccount(String s) { system.debug('SETTER'); billItem.Account__c = s; } public String getCurrentContract() { system.debug('GETTER2'); return billItem.GP_Contract__c; } public void setCurrentContract(String s) { system.debug('SETTER2'); billItem.GP_Contract__c = s; } private List<SelectOption> myContractOptions; private List<GPContract__c> myContracts; public List<SelectOption> getContractOptions() { myContractOptions = new List<SelectOption>(); myContractOptions.Add(new SelectOption('', '-- None --')); myContracts = [Select id, name, Contract_Code__c from GPContract__c where account__c = :billItem.Account__c order by name]; for (GPContract__c c: myContracts) { myContractOptions.Add(new SelectOption(c.id, c.name)); } return myContractOptions; } private List<SelectOption> myAccountOptions; private List<Account> myAccounts; public List<SelectOption> getAccountOptions() { if (myAccountOptions == null) { myAccountOptions = new List<SelectOption>(); myAccounts = [Select id, name, GP_CUSTNMBR__c from account where GP_CUSTNMBR__c <> '' order by name]; for (Account a: myAccounts) { myAccountOptions.Add(new SelectOption(a.id, a.name)); } if (myAccountOptions.size() == 0) throw new MyException('No accounts associated with user'); if (billItem.Account__c == null) { billItem.Account__c = myAccounts[1].id; ResetCases(); ResetProjects(); } } return myAccountOptions; }

 

Message Edited by mmix on 01-26-2009 04:12 AM
  • January 26, 2009
  • Like
  • 0
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.

How can I obtain these informations? This is a big problem.

Message Edited by mmix on 12-09-2008 03:01 AM
  • December 09, 2008
  • Like
  • 0

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)

{ this.billItem = (GB_Bill_Item__c)stdController.getRecord();

   // initial setup

   if (billItem.Owner == null) { billItem.OwnerId = UserInfo.getUserId(); } 

  • February 02, 2009
  • Like
  • 1

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) 

 

Is there maybe an undocumented VF tag to do it?

 

  • September 30, 2010
  • Like
  • 0

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.

  • July 07, 2010
  • Like
  • 0

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. 

 

 

 

Message Edited by mmix on 04-02-2009 02:39 AM
  • April 02, 2009
  • Like
  • 0

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. 

  • February 27, 2009
  • Like
  • 0

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?

 

 

 

 

 

 

  • February 09, 2009
  • Like
  • 0

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)

{ this.billItem = (GB_Bill_Item__c)stdController.getRecord();

   // initial setup

   if (billItem.Owner == null) { billItem.OwnerId = UserInfo.getUserId(); } 

  • February 02, 2009
  • Like
  • 1
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.

How can I obtain these informations? This is a big problem.

Message Edited by mmix on 12-09-2008 03:01 AM
  • December 09, 2008
  • Like
  • 0