You need to sign in to do that
Don't have an account?
wintamute
Bug in Flex Toolkit, fix included
Hi,
the latest flex toolkit contains a bug when doing a DescribeLayout Call and the editLayoutSection contains only a single section. DescribeLayout throws a null-pointer error in this case.
Since the source is available, I did a quick fix so the maintainer of the toolkit can add it to the respository.
cheers,
Andi
the latest flex toolkit contains a bug when doing a DescribeLayout Call and the editLayoutSection contains only a single section. DescribeLayout throws a null-pointer error in this case.
Since the source is available, I did a quick fix so the maintainer of the toolkit can add it to the respository.
Code:
Index: /Users/andi/Documents/workspace33/Salesforce Flex sdk/src/com/salesforce/results/DescribeLayout.as =================================================================== --- /Users/andi/Documents/workspace33/Salesforce Flex sdk/src/com/salesforce/results/DescribeLayout.as (revision 722) +++ /Users/andi/Documents/workspace33/Salesforce Flex sdk/src/com/salesforce/results/DescribeLayout.as (working copy) @@ -27,9 +27,8 @@ */ package com.salesforce.results { + import mx.collections.ArrayCollection; import mx.utils.ObjectProxy; - import mx.collections.ArrayCollection; - import com.salesforce.results.*; /** * Returned in the response to describeLayout(), contains detailed information on the custom or standard object page layout * @@ -51,9 +50,11 @@ // one of detailLayoutSections, editLayoutSections, relatedList if (key == "detailLayoutSections" || key == "editLayoutSections") { this[key] = new ArrayCollection(); - for (var i:int = 0;i<(val as ArrayCollection).length;i++) { - this[key].addItem( new DescribeLayoutSection((val as ArrayCollection)[i]) ); - } + if(val is ArrayCollection) { + for (var i:int = 0;i<(val as ArrayCollection).length;i++) { + this[key].addItem( new DescribeLayoutSection((val as ArrayCollection)[i]) ); + } + } else this[key].addItem( new DescribeLayoutSection((val as ObjectProxy))); } else if (key == "relatedLists") { this[key] = new ArrayCollection(); for (var i2:int = 0;i2<(val as ArrayCollection).length;i2++) {
cheers,
Andi
Cheers,
Andi
Did this fix ever get into the Toolkit? I'm also getting an error for describeLayout when trying to get stage picklist values for a specific opportunity RecordType. Here's the code:
And here's the error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.salesforce.results::DescribeLayout()[/home/jamesw/projects/mavericks/sdk/src/com/salesforce/results/DescribeLayout.as:54]
at com.salesforce.results::DescribeLayoutResult()[/home/jamesw/projects/mavericks/sdk/src/com/salesforce/results/DescribeLayoutResult.as:71]
at SalesForceResponder/result()[/home/jamesw/projects/mavericks/sdk/src/com/salesforce/Connection.as:1259]
...
Thanks,
Dean
Message Edited by DeanF on 11-18-2008 09:16 PM