• Jordan@BracketLabs
  • NEWBIE
  • 150 Points
  • Member since 2011

  • Chatter
    Feed
  • 6
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 45
    Questions
  • 66
    Replies

One of my remote methods in my development org started returning this:

 

Visualforce Remoting Exception: Internal Service Error: java.lang.NullPointerException (1965426548-396 (1758985430)) 

 It doesn't happened with the same app in other orgs, so I'm not sure what to think??

I am recieving an error when I use the ant deployUnpackaged to move new code from my local codebase into a managed-package instance.

 

I am adding two new fields, and only recieve the error when I include the '.object' meta for those objects.

 

I tried manually creating the fields in the org, and than rerunning the deploy without the .object files and with them, and in both cases, if I include the metadata, I recieve the error message:

 

Managed Package Patch Modification Exception: A change was made to the patch release that will change the visible behavior of the application: Component can't be created because it will be automatically included in the package

If i don't include the '.object' files in my source or 'package.xml' I don't get the message, but I'm still recieving 'no reference' found messages.

 

When I included one of the new objects in a managed beta (and in the package source) the reference error went away.

I have a query where I'm trying to return the chatter posts and comments that pertain to a specific set of sObject's that were previously queried:

List<sObject__c> items = [SELECT Id FROM sObject__c ...];

Map<Id,sObject__Feed> projectTaskFeeds = new Map<Id,Project_Task__Feed>([SELECT Id, Type, CreatedById, CreatedBy.FirstName, CreatedBy.LastName, ParentId, Parent.Name, Body, Title, LinkUrl, ContentData, ContentFileName, (SELECT Id, CommentBody, CreatedDate, CreatedBy.FirstName, CreatedBy.LastName FROM FeedComments)
 FROM sObject__Feed WHERE ParentId IN :items LIMIT 50000]);

 But the resulting map only contains the sObject__c feed items, and not the related FeedComments.

Map<Id,sObject__Feed> projectTaskFeeds = new Map<Id,Project_Task__Feed>([SELECT Id, Type, CreatedById, CreatedBy.FirstName, CreatedBy.LastName, ParentId, Parent.Name, Body, Title, LinkUrl, ContentData, ContentFileName, (SELECT Id, CommentBody, CreatedDate, CreatedBy.FirstName, CreatedBy.LastName FROM FeedComments)
 FROM sObject__Feed LIMIT 50000]);

 

 

If I don't use the limiting 'WHERE' Clause however, I get the comments as well (but I got all items that are in the sObject__Feed table, which could easily be more than 50000 results in a large org.

 

Am I doing something wrong?

I'm am developing a visualforce page to take an original set of records (representing field mappings) and allow the user to change them using 'SelectLists'/'SelectOptions' and save them to new records. However, when I debug the page, I find that any 'SelectList' value that is changed using the drop-down on the page is null when I go to 'save()' the new records:

 

Controller:

public List<MeetingFieldMappings1__c> fieldMappings {get; set;}
	
public void setupFieldMapping(){ 
	if(fieldMappingEnabled){	
		// get the current field mappings
		List<MeetingFieldMappings1__c> mappings = new List<MeetingFieldMappings1__c>();
		if(meeting != null){
			mappings = [SELECT Id,Name,LeadField__c,ContactField__c,LeadAllowUpdates__c,ContactAllowUpdates__c,Meeting__c 
							FROM MeetingFieldMappings1__c WHERE Meeting__c = :meeting.id LIMIT 25];
				if(mappings.size() > 0){			
					mappingsExist = true;
					fieldMappings = mappings;
				}
			} 
			// defaults
			mappingsExist = false;
			mappings = [SELECT Id,Name,LeadField__c,ContactField__c,LeadAllowUpdates__c,ContactAllowUpdates__c,Meeting__c 
								FROM MeetingFieldMappings1__c WHERE Meeting__c = null LIMIT 25];
			fieldMappings = mappings;
		}
	}

 

Page:

<apex:form>
	<div id="fieldMappingDialog" style="display: none;">
	<apex:pageBlock >
		<table>
			<tr>
			    <th>Meeting Member Field</th>
			    <th>Lead Field</th>
			    <th>Contact Field</th>
			</tr>
           	<apex:repeat value="{!fieldMappings}" var="mapping">
			<tr>
			    <td><apex:outputField value="{!mapping.Name}" /></td>
			    <td>
		    	<apex:selectList value="{!mapping.LeadField__c}" size="1" disabled="{!NOT(mapping.LeadAllowUpdates__c)}">
			            <apex:selectOptions value="{!leadFieldsPickList}" />
			        </apex:selectList>
			    </td>
			    <td>
			    	<apex:selectList value="{!mapping.ContactField__c}" size="1" disabled="{!NOT(mapping.ContactAllowUpdates__c)}">
			            <apex:selectOptions value="{!contactFieldsPickList}" />
			        </apex:selectList>
			    </td>
			</tr>
           </apex:repeat>
	</table>
	</apex:pageBlock>
	</div>
</apex:form>

 What am I doing wrong?

I need to determine if an approval process exists for my object in an org, dynamically, so I can determine if I should display a 'Submit for Approval' button.

 

I can't find anyway to directly query for the existance of an Approval Process, (the standard recordtype: Approval, I believe, relates specific approvals that are already started for a particular object, I can't test these, as I need to know, ideally before any of them exist)

 

I thought about trying to start an approval for the current record and trapping the error message, but, if it succeeded, than the record would be submitted for approval (by the test):

 

try{
Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
req.setObjectId(this.object.id);
Approval.ProcessResult result = Approval.process(req);	
}
catch(exception e){
 if(e.contains == "Some ERROR")
   //set my flag
}

 

Thoughts? Am I just missing something?

 

 

 

I'm running Ubuntu Linux, and I'd like to install the Chatter Desktop Client.

 

However, 'Adobe Air' dropped support for Linux last year (July 2011?) 

 

As a result I had to install the last supported version of Air, and now when I try to install the client via the login portal, I cannot click on the 'Yes' button to run the installer (it simply doesn't respond)

 

Does anyone have the standalone 'air' installer they could give me so I could install the App via the standard are installer.

 

Thanks

Trying to get some confirmation: When I tried to save a VF Page with the mark-up:

 

<apex:chart></apex:chart>

The API (which is set to v24, Spring '12) says the component doesn't exist.

 

I thought since it was introduced in Winter '12 (v23) and it's almost Summer '12 (v25): I thought it would be GA pretty soon here.

 

Hoping to get some clarification.

 

Thanks 

 

Shouldn't 'test methods' inside of managed packages not run any triggers in other installed managed packages?

 

It's impossible for managed package producers to predict the triggers that will run after a record is insert in their test methods?

 

Example (abbreviated):

 

@isTest
static void testRemoteActions(){
   Campaign testCampaign = new Campaign(name='Test Campaign');
   insert testCampaign;
   Controller controller = new Controller();
   if(controller.isChatterEnabled){controller.updateChatterStatus('Hello world!');}
}

// check chatter enabled
class controller{
    public Boolean isChatterEnabled{get; set;}     
    public void checkChatterEnabled() 
    {
        if(User.SobjectType.getDescribe().feedEnabled)
            this.isChatterEnabled = true; 
        else
            this.isChatterEnabled = false;      
    }
}

 

 

Trigger Exception: 

System.DmlException: Update failed. First exception on row 0 with id: 000000000; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, UserTrigger; execution of AfterUpdate caused by: System.QueryException: List has no rows for assignment...'
Trigger.UserTrigger

Note: I'm not inserting a user and using System.runas(u) { } in my test method because I don't know all the required profiles/user requirement triggers in the destination org.

 

Am I just thinking about it wrong? 

 

 

 

I'm trying to send a file that's attached to a Case out of my APEX Code, I'm trying to 'form' the POST request and pass the attachments body in the post request as follows:

 

HttpRequest req = new HttpRequest();
req.setHeader('Authorization','Basic '+EncodingUtil.base64Encode(Blob.valueOf('----:0000')));
req.setHeader('Content-Type','multipart/form-data; boundary=-----------------------------153501500631101');
req.setHeader('Content-Length',String.valueOf(attachments[0].BodyLength));
req.setMethod('POST');  
req.setEndpoint(endPoint+'/createattachment');
		
String body = '-----------------------------153501500631101\r\n';
body = body + 'Content-Disposition: form-data; name="Filedata"; filename="'+attachments[0].Name+'"\r\n';
body = body + 'Content-Type: '+attachments[0].ContentType+'\r\n\r\n';
body = body + attachments[0].Body + '\r\n';
body = body + '-----------------------------153501500631101--\r\n';
    req.setbody(body);
try{
  Http http = new Http();
  HTTPResponse res = Http.send(req);
}

 Everything looks good in the debugger (which reports the body as being 'Blob', even though it's a string ?) 

 

And the server sends back a 200, but the attachment doesn't appear?

 

I've added this question to stackoverflow.com: http://stackoverflow.com/questions/10215808/post-multipart-form-data-out-of-salesforce-com-apex

I've discovered that when using the following object I get some strange behavior, and I'm wondering if anyone can point out what I'm doing wrong??

 

The following setup returns the campaigns list correctly filtered by the paramters in the associated FilterId for the 'Campaign' object but the orderby clause is invalidated and the campaigns are sorted by the 'last selection on the standard list view vf component' under the default campaigns tab, so ordered by 'Name' or 'Type' or whatever...not 'StartDate ASC' as set.

ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(Database.getQueryLocator([SELECT Id, Name, StartDate, EndDate, Type, Status, Description, Owner.Name,NumberOfLeads, NumberOfContacts, NumberOfOpportunities, NumberOfWonOpportunities,AmountAllOpportunities, Exclude_from_Calendar__c FROM Campaign ORDER BY StartDate ASC]));
ssc.setFilterID(this.filterId);
ssc.setPageSize(2000);
// use standardset controller to limit results by listview
List <Campaign> campaignObjects = ssc.getRecords();	

 The following setup returns the campaigns list correctly sorted using the ORDER BY clause, but they are not FILTERED by the associated listview filterid using 'setFilterId('...')'

List<Campaign> campaigns = [SELECT Id, Name, StartDate, EndDate, Type, Status, Description, Owner.Name,NumberOfLeads, NumberOfContacts, NumberOfOpportunities, NumberOfWonOpportunities,AmountAllOpportunities, Exclude_from_Calendar__c FROM Campaign ORDER BY StartDate ASC];
ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(campaigns);
ssc.setFilterID(this.filterId);
ssc.setPageSize(2000);
// use standardset controller to limit results by listview
List <Campaign> campaignObjects = ssc.getRecords();	

 

What am I missing about ordering these campaigns correctly...

We have an Apex class that uses the 'getQueryLocator' to return a single page of results, 2000 records (single page max).

 

We are trying to implement:

    public ApexPages.StandardSetController getCampaignsSsc() {
        if (this.campaigns == null) {
            this.campaigns = new ApexPages.StandardSetController(
                Database.getQueryLocator([SELECT Id, Name, StartDate, EndDate, Type, Status, Description, Owner.Name, NumberOfLeads, NumberOfContacts, NumberOfOpportunities, NumberOfWonOpportunities, AmountAllOpportunities, Exclude_from_Calendar__c FROM Campaign ORDER BY StartDate DESC])
            );
            if(this.pagesize == null){
                this.pagesize = 2000;
            }
            this.campaigns.setPageSize(this.pagesize);
        return campaigns;
    }

 However, the campaign records always seem to come back sorted by Name is it possible I'm not setting something with the SSC before running the 'getRecords' operation that is causing them to always return this way (reguardless of the arguement in the ORDER BY clause)?

 

p.s. sorting the records on the server before returning them to the page isn't really an option as with 2000 records it would overflow the script statements limits.

We have been expirementing with installing a package that had previously only supported enterprise edition into professional edition.

 

This means modifying our APEX code to fit the creteria supported by professional edition.

 

Permission sets seem to be avaliable in 'PE' but are unsupported. As such we have chosen to 'remove' them from the managed package.

 

However, it seems that once we install this app into professional edition orgs it will NOT UNINSTALL.

 

Clicking the 'Uninstall' button, has no affect on the app. It remains installed, and there is never a confirmation of the package having never been uninstalled.

 

Can anyone confirm this?

 

Salesforce has told us that if we can't get an App to uninstall to just create a new org.

 

Of course this isn't a workable solution to create a new org for each subsequent attempt to iterate on new development for testing!


line -1, column -1: Previous load of class failed: mycontrollername

This seems to have started to happened in Spring '12.

 

We first started to notice it in an installation of a managed package that was being migrated from a Sandbox to Production on 'Enterprise Unlimited' without chatter enabled.

 

Here is what we have done so far (this error seemed to be somewhat related to referencing :

 

1. Our app was designed to support both chatter enabled/disabled orgs. We used recommended procedures (Dynamic DML, Dynamic SOQL, etc.)  to avoid any installation errors surrounding 'chatter required'.

 

2. We removed all test methods that attempted to reference the Chatter related fields (would have resulted in Apex test method failures at installation times) There are now no test method failures.

 

3. Upgraded all classes to API V.24

 

4. Removed double keyworked annotations from classes that were doubly notated: "public webservice __" now they are just: "webservice __" (using 'public' and 'webservice' on the same method would not compile into API V.24)

 

5. Ran 'Recompile All Classes' before and after installing the latest 'Patched' version into the Org.

 

6. Uninstalled and reinstalled the package completely.

 

7. Verified the App runs normally in the sandbox, and all classes have a check next to the 'Is Valid' column.

 

Any thoughts going forward?

 

Additional Posts which seem to be related (most are relatively recent which leads me to believe this issue occurs more recently in Spring '12)

http://boards.developerforce.com/t5/Apex-Code-Development/Strange-errors-when-unit-testing-in-Sandbox-cs3/m-p/391629/highlight/true#M70223

http://success.salesforce.com/questionDetail?qid=a1X30000000KHxHEAW

http://boards.developerforce.com/t5/AppExchange-Directory-Packaging/Packaging-upload-error-Previous-load-of-class-failed/m-p/400775/highlight/true#M3632

http://boards.developerforce.com/t5/Apex-Code-Development/Method-CodeCoverage-exceeds-the-maximum-number-of-allowed-op/m-p/399829/highlight/true#M71899

We have a managed package app that currently requires 'Public and Private Tagging' to be enabled by default for the org that is to be installed into.

 

This requirement is Auto Detected by the package uploader.

 

I have been tasked to get this requirement to go away. 

 

I have replaced all references to '__tag' with 'dynamic DML', except for @RemoteAction annotated methods that return types containing: "__tag"

 

The API reports: 

Save error: Global/WebService identifiers cannot be removed from managed application: Method: LIST<Task__Tag> recordTags

 Is there anyway around this so I can change the return types to: sObject or another datastructure that will allow me to avoid the installation requirement in the package uploader.

 

Thanks.

Since our org has been upgraded to Spring '12 I have had sporatic incidents where I try to edit a classes body (not change the class name or delete it), and the API returns an error:

 

Save error: This apex class is referenced elsewhere in salesforce.com.  Remove the usage and try again. : Visualforce Page - .... visualforce page that uses this class as a controller...

 

 

I'm not trying to delete the class, and removing it from my Visualforce page would require me to remove other pages/classes/etc.

 

This error comes and goes, and happens for all classes that are controllers to VF pages.

 

Some of our classes are part of managed packages, but we're editing them in the org that the package was created out of, so this shouldn't make any difference.

 

I've had some success using the Migration Tool to move changes from another org, but it also sometimes returns this error.

 

 

I am running into a strange error where a set of APEX classes refuses to compile in a sandbox off a production org in Spring '12.

 

The managed package (our app) was installed successfully into the sandbox, but when the sandbox attempted to migrate to production there was a 'failure to load class named ... WebServicesClass.cls' error coming from a class that contained the keyword: WebService for the Ajax Toolkit for SOAP WebService Custom Methods.

 

After attempting to upgrade the API version of the class files we discovered that the classes and their members could not contain the notation of 'Public WebService' or it wouldn't compile. 

 

After using just 'WebService' the upgraded to API version v24, but this didn't solve our issue. Their continue to be load failure errors coming from some of these classes.

 

Strangly enough the sandbox wasn't 'Chatter' enabled (There was no warning that blocked us from installing the package when it was installed, it just wouldn't migrate), but turing Chatter ON caused all APEX Classes to compile normally.

 

The only 'Chatter' related method that referenced a field in Chatter (the installer didn't complain about it) worked like this:

 

public static Boolean doUserStatus(String status) {
       // User user;
		sObject user;
        try {
            //user = [SELECT Id, CurrentStatus from User where Id = :UserInfo.getUserId()];
        	String SOQL = 'SELECT Id, CurrentStatus from User where Id=\''+UserInfo.getUserId() +'\'';
        	//user = [SELECT Id, CurrentStatus from User where Id = :UserInfo.getUserId()];
       		user = database.query(SOQL);
        } catch (System.RequiredFeatureMissingException e) {
            //System.debug(e.getMessage());
            CampaignCalendarShared.errors = 'Chatter is not enabled for your organization.';
            return false;
        }

        if (!Schema.sObjectType.User.fields.CurrentStatus.isUpdateable()){
            // Insufficient privileges
            CampaignCalendarShared.errors = 'Chatter is not enabled for your user.';
            return false;
        }

        user.put('CurrentStatus',status);

        try {
            update user;
        } catch (System.DmlException e) {
            // DML query failed
            for (Integer i = 0; i < e.getNumDml(); i++) {
                if (e.getDmlType(i) == StatusCode.REQUIRED_FEATURE_MISSING) {
                    //System.debug(e.getMessage());
                    CampaignCalendarShared.errors = 'Chatter is not enabled for your organization.';
                }
            }
            return false;
        }

 I've commented out the old version, and updated it to use 'Dynamic SOQL' and 'sObject' references instead of direct references to the field 'CurrentUserStatus' as I thought this might be a component of 'Chatter' that the compiler didn't complain about on installation, but I'm not sure if this is a safe way to allow the class to compile without chatter enabled?

I understand that Salesforce's runtime will automatically append necessary namespace prefixes to Apex code references to custom sobjects and fields in a managed packaged.

 

Furthermore, I understand that it will not pick up references in Javascript, Dynamic SOQL & VF Pages, or hardcoded PageReferences (so these must be manually updated). 

 

I have however discovered something I don't understand:

 

1. We have a VF page that references a custom extension of the StandardController, as such we use the following work-around to get the standard controller to query all the necessary table columns in our custom object at load time:

 

//Works in Packaging Org
<apex:outputPanel rendered="false">
{!Object__c.ObjectField__c} {!Object__c.ObjectField1__c}
</apex:outputPanel>

 ^ The above code works properly in the packaging org, with a managed package created with a namespace prefix.

However, when it's installed into another org it doesn't work unless we manually prepend the namespace prefix as follows:

//Works in destination org, but not packaging org
<apex:outputPanel rendered="false">
{!NS1__Object__c.NS1__ObjectField__c} {!NS1__Object__c.NS1__ObjectField1__c}
</apex:outputPanel>

The above works in the destination org, but not packaging org.

 

 

Shouldn't my packaging org now be capable of respecting references to NS1__Object__c? 

We have a package that supports RecordTypes, but we want to install into a professional edition org.

 

To accomplish this I am attempting to build the code to avoid direct references to the RecordType fields as follows:

 

        Integer countOfRecordTypes = 0;
        // Find if record types are enabled -Ken
        string recordTypeSoql = 'SELECT Id,Name FROM RecordType WHERE sobjecttype = \'Campaign\'';
        for(sObject s : Database.query(recordTypeSoql)) {
        	countOfRecordTypes++;
        }
        
        if(countOfRecordTypes > 0)
        {
            this.isRecordTypeEnabled = true;	
        }
        else
        {
        	this.isRecordTypeEnabled = false;
        }

 I use the count of RecordTypes to determine if the property even exists, and I don't directly SOQL Query for RecordType objects.

 

However, the professional edition install process still fails with an unkown internal error, which I've been told by partner support is a 'RecordType related error.'

 

Any advice?

 

P.S. I've also attempted to use .getRecordTypeInfos() --> which also fails.

 

 

I'm trying to login and edit a Wiki on http://wiki.developerforce.com

 

Unfortunately, when I do login with the same account I use for this board I get a 'SOQL Error': Duplicate email address:

 

A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:

    (SQL query hidden)

from within function "User::addToDatabase". MySQL returned error "1062: Duplicate entry 'Jordan Baucke (Jordan Baucke)' for key 'user_name' (localhost)".

 If anyone can clear this up for me - or for that matter knows whom I can contact I would be very appreciative!

 

PS. Just updated my email in my SFDC Account - and confirmed - but since this is based on the 'KEY' of the account I doubt it'll work :smileysad:

I'm trying to run a subquery on my query for a custom object to get it's public and and private tags.

 

I can't find any documentation about using this relatinoship, but I've activated tagging, and I can query for 'SObjectName__Tag' just fine - I would just prefer not to have to match them up afterward to speed things up on my object creation:

 

So I'm trying to figure out - I know this is syntactically not correct but hoping it will inspire someone to help me fix my mistakes!

 

List<SObject> customObjectListWithTags = [SELECT Id,Name, (SELECT Id,Name FROM CustomObject__Task) FROM CustomObject__c];

 Thanks...

I've discovered that when using the following object I get some strange behavior, and I'm wondering if anyone can point out what I'm doing wrong??

 

The following setup returns the campaigns list correctly filtered by the paramters in the associated FilterId for the 'Campaign' object but the orderby clause is invalidated and the campaigns are sorted by the 'last selection on the standard list view vf component' under the default campaigns tab, so ordered by 'Name' or 'Type' or whatever...not 'StartDate ASC' as set.

ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(Database.getQueryLocator([SELECT Id, Name, StartDate, EndDate, Type, Status, Description, Owner.Name,NumberOfLeads, NumberOfContacts, NumberOfOpportunities, NumberOfWonOpportunities,AmountAllOpportunities, Exclude_from_Calendar__c FROM Campaign ORDER BY StartDate ASC]));
ssc.setFilterID(this.filterId);
ssc.setPageSize(2000);
// use standardset controller to limit results by listview
List <Campaign> campaignObjects = ssc.getRecords();	

 The following setup returns the campaigns list correctly sorted using the ORDER BY clause, but they are not FILTERED by the associated listview filterid using 'setFilterId('...')'

List<Campaign> campaigns = [SELECT Id, Name, StartDate, EndDate, Type, Status, Description, Owner.Name,NumberOfLeads, NumberOfContacts, NumberOfOpportunities, NumberOfWonOpportunities,AmountAllOpportunities, Exclude_from_Calendar__c FROM Campaign ORDER BY StartDate ASC];
ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(campaigns);
ssc.setFilterID(this.filterId);
ssc.setPageSize(2000);
// use standardset controller to limit results by listview
List <Campaign> campaignObjects = ssc.getRecords();	

 

What am I missing about ordering these campaigns correctly...

One of my remote methods in my development org started returning this:

 

Visualforce Remoting Exception: Internal Service Error: java.lang.NullPointerException (1965426548-396 (1758985430)) 

 It doesn't happened with the same app in other orgs, so I'm not sure what to think??

I am recieving an error when I use the ant deployUnpackaged to move new code from my local codebase into a managed-package instance.

 

I am adding two new fields, and only recieve the error when I include the '.object' meta for those objects.

 

I tried manually creating the fields in the org, and than rerunning the deploy without the .object files and with them, and in both cases, if I include the metadata, I recieve the error message:

 

Managed Package Patch Modification Exception: A change was made to the patch release that will change the visible behavior of the application: Component can't be created because it will be automatically included in the package

If i don't include the '.object' files in my source or 'package.xml' I don't get the message, but I'm still recieving 'no reference' found messages.

 

When I included one of the new objects in a managed beta (and in the package source) the reference error went away.

I have a query where I'm trying to return the chatter posts and comments that pertain to a specific set of sObject's that were previously queried:

List<sObject__c> items = [SELECT Id FROM sObject__c ...];

Map<Id,sObject__Feed> projectTaskFeeds = new Map<Id,Project_Task__Feed>([SELECT Id, Type, CreatedById, CreatedBy.FirstName, CreatedBy.LastName, ParentId, Parent.Name, Body, Title, LinkUrl, ContentData, ContentFileName, (SELECT Id, CommentBody, CreatedDate, CreatedBy.FirstName, CreatedBy.LastName FROM FeedComments)
 FROM sObject__Feed WHERE ParentId IN :items LIMIT 50000]);

 But the resulting map only contains the sObject__c feed items, and not the related FeedComments.

Map<Id,sObject__Feed> projectTaskFeeds = new Map<Id,Project_Task__Feed>([SELECT Id, Type, CreatedById, CreatedBy.FirstName, CreatedBy.LastName, ParentId, Parent.Name, Body, Title, LinkUrl, ContentData, ContentFileName, (SELECT Id, CommentBody, CreatedDate, CreatedBy.FirstName, CreatedBy.LastName FROM FeedComments)
 FROM sObject__Feed LIMIT 50000]);

 

 

If I don't use the limiting 'WHERE' Clause however, I get the comments as well (but I got all items that are in the sObject__Feed table, which could easily be more than 50000 results in a large org.

 

Am I doing something wrong?

I'm am developing a visualforce page to take an original set of records (representing field mappings) and allow the user to change them using 'SelectLists'/'SelectOptions' and save them to new records. However, when I debug the page, I find that any 'SelectList' value that is changed using the drop-down on the page is null when I go to 'save()' the new records:

 

Controller:

public List<MeetingFieldMappings1__c> fieldMappings {get; set;}
	
public void setupFieldMapping(){ 
	if(fieldMappingEnabled){	
		// get the current field mappings
		List<MeetingFieldMappings1__c> mappings = new List<MeetingFieldMappings1__c>();
		if(meeting != null){
			mappings = [SELECT Id,Name,LeadField__c,ContactField__c,LeadAllowUpdates__c,ContactAllowUpdates__c,Meeting__c 
							FROM MeetingFieldMappings1__c WHERE Meeting__c = :meeting.id LIMIT 25];
				if(mappings.size() > 0){			
					mappingsExist = true;
					fieldMappings = mappings;
				}
			} 
			// defaults
			mappingsExist = false;
			mappings = [SELECT Id,Name,LeadField__c,ContactField__c,LeadAllowUpdates__c,ContactAllowUpdates__c,Meeting__c 
								FROM MeetingFieldMappings1__c WHERE Meeting__c = null LIMIT 25];
			fieldMappings = mappings;
		}
	}

 

Page:

<apex:form>
	<div id="fieldMappingDialog" style="display: none;">
	<apex:pageBlock >
		<table>
			<tr>
			    <th>Meeting Member Field</th>
			    <th>Lead Field</th>
			    <th>Contact Field</th>
			</tr>
           	<apex:repeat value="{!fieldMappings}" var="mapping">
			<tr>
			    <td><apex:outputField value="{!mapping.Name}" /></td>
			    <td>
		    	<apex:selectList value="{!mapping.LeadField__c}" size="1" disabled="{!NOT(mapping.LeadAllowUpdates__c)}">
			            <apex:selectOptions value="{!leadFieldsPickList}" />
			        </apex:selectList>
			    </td>
			    <td>
			    	<apex:selectList value="{!mapping.ContactField__c}" size="1" disabled="{!NOT(mapping.ContactAllowUpdates__c)}">
			            <apex:selectOptions value="{!contactFieldsPickList}" />
			        </apex:selectList>
			    </td>
			</tr>
           </apex:repeat>
	</table>
	</apex:pageBlock>
	</div>
</apex:form>

 What am I doing wrong?

I need to determine if an approval process exists for my object in an org, dynamically, so I can determine if I should display a 'Submit for Approval' button.

 

I can't find anyway to directly query for the existance of an Approval Process, (the standard recordtype: Approval, I believe, relates specific approvals that are already started for a particular object, I can't test these, as I need to know, ideally before any of them exist)

 

I thought about trying to start an approval for the current record and trapping the error message, but, if it succeeded, than the record would be submitted for approval (by the test):

 

try{
Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
req.setObjectId(this.object.id);
Approval.ProcessResult result = Approval.process(req);	
}
catch(exception e){
 if(e.contains == "Some ERROR")
   //set my flag
}

 

Thoughts? Am I just missing something?

 

 

 

I'm running Ubuntu Linux, and I'd like to install the Chatter Desktop Client.

 

However, 'Adobe Air' dropped support for Linux last year (July 2011?) 

 

As a result I had to install the last supported version of Air, and now when I try to install the client via the login portal, I cannot click on the 'Yes' button to run the installer (it simply doesn't respond)

 

Does anyone have the standalone 'air' installer they could give me so I could install the App via the standard are installer.

 

Thanks

Shouldn't 'test methods' inside of managed packages not run any triggers in other installed managed packages?

 

It's impossible for managed package producers to predict the triggers that will run after a record is insert in their test methods?

 

Example (abbreviated):

 

@isTest
static void testRemoteActions(){
   Campaign testCampaign = new Campaign(name='Test Campaign');
   insert testCampaign;
   Controller controller = new Controller();
   if(controller.isChatterEnabled){controller.updateChatterStatus('Hello world!');}
}

// check chatter enabled
class controller{
    public Boolean isChatterEnabled{get; set;}     
    public void checkChatterEnabled() 
    {
        if(User.SobjectType.getDescribe().feedEnabled)
            this.isChatterEnabled = true; 
        else
            this.isChatterEnabled = false;      
    }
}

 

 

Trigger Exception: 

System.DmlException: Update failed. First exception on row 0 with id: 000000000; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, UserTrigger; execution of AfterUpdate caused by: System.QueryException: List has no rows for assignment...'
Trigger.UserTrigger

Note: I'm not inserting a user and using System.runas(u) { } in my test method because I don't know all the required profiles/user requirement triggers in the destination org.

 

Am I just thinking about it wrong? 

 

 

 

Hello All,

 

I have a requirement to create a grid in Saleforce using jqGrid  and Json.   The jqGrid working example page http://www.trirand.com/blog/jqgrid/jqgrid.html has examples using MySQL and JSON.

 

Is there any examples using Salesforce along with JSON???

 

Any help will be greatly appreciated!!

 

Thanks

 

 

We have an Apex class that uses the 'getQueryLocator' to return a single page of results, 2000 records (single page max).

 

We are trying to implement:

    public ApexPages.StandardSetController getCampaignsSsc() {
        if (this.campaigns == null) {
            this.campaigns = new ApexPages.StandardSetController(
                Database.getQueryLocator([SELECT Id, Name, StartDate, EndDate, Type, Status, Description, Owner.Name, NumberOfLeads, NumberOfContacts, NumberOfOpportunities, NumberOfWonOpportunities, AmountAllOpportunities, Exclude_from_Calendar__c FROM Campaign ORDER BY StartDate DESC])
            );
            if(this.pagesize == null){
                this.pagesize = 2000;
            }
            this.campaigns.setPageSize(this.pagesize);
        return campaigns;
    }

 However, the campaign records always seem to come back sorted by Name is it possible I'm not setting something with the SSC before running the 'getRecords' operation that is causing them to always return this way (reguardless of the arguement in the ORDER BY clause)?

 

p.s. sorting the records on the server before returning them to the page isn't really an option as with 2000 records it would overflow the script statements limits.

We have been expirementing with installing a package that had previously only supported enterprise edition into professional edition.

 

This means modifying our APEX code to fit the creteria supported by professional edition.

 

Permission sets seem to be avaliable in 'PE' but are unsupported. As such we have chosen to 'remove' them from the managed package.

 

However, it seems that once we install this app into professional edition orgs it will NOT UNINSTALL.

 

Clicking the 'Uninstall' button, has no affect on the app. It remains installed, and there is never a confirmation of the package having never been uninstalled.

 

Can anyone confirm this?

 

Salesforce has told us that if we can't get an App to uninstall to just create a new org.

 

Of course this isn't a workable solution to create a new org for each subsequent attempt to iterate on new development for testing!


line -1, column -1: Previous load of class failed: mycontrollername

This seems to have started to happened in Spring '12.

 

We first started to notice it in an installation of a managed package that was being migrated from a Sandbox to Production on 'Enterprise Unlimited' without chatter enabled.

 

Here is what we have done so far (this error seemed to be somewhat related to referencing :

 

1. Our app was designed to support both chatter enabled/disabled orgs. We used recommended procedures (Dynamic DML, Dynamic SOQL, etc.)  to avoid any installation errors surrounding 'chatter required'.

 

2. We removed all test methods that attempted to reference the Chatter related fields (would have resulted in Apex test method failures at installation times) There are now no test method failures.

 

3. Upgraded all classes to API V.24

 

4. Removed double keyworked annotations from classes that were doubly notated: "public webservice __" now they are just: "webservice __" (using 'public' and 'webservice' on the same method would not compile into API V.24)

 

5. Ran 'Recompile All Classes' before and after installing the latest 'Patched' version into the Org.

 

6. Uninstalled and reinstalled the package completely.

 

7. Verified the App runs normally in the sandbox, and all classes have a check next to the 'Is Valid' column.

 

Any thoughts going forward?

 

Additional Posts which seem to be related (most are relatively recent which leads me to believe this issue occurs more recently in Spring '12)

http://boards.developerforce.com/t5/Apex-Code-Development/Strange-errors-when-unit-testing-in-Sandbox-cs3/m-p/391629/highlight/true#M70223

http://success.salesforce.com/questionDetail?qid=a1X30000000KHxHEAW

http://boards.developerforce.com/t5/AppExchange-Directory-Packaging/Packaging-upload-error-Previous-load-of-class-failed/m-p/400775/highlight/true#M3632

http://boards.developerforce.com/t5/Apex-Code-Development/Method-CodeCoverage-exceeds-the-maximum-number-of-allowed-op/m-p/399829/highlight/true#M71899

We have a managed package app that currently requires 'Public and Private Tagging' to be enabled by default for the org that is to be installed into.

 

This requirement is Auto Detected by the package uploader.

 

I have been tasked to get this requirement to go away. 

 

I have replaced all references to '__tag' with 'dynamic DML', except for @RemoteAction annotated methods that return types containing: "__tag"

 

The API reports: 

Save error: Global/WebService identifiers cannot be removed from managed application: Method: LIST<Task__Tag> recordTags

 Is there anyway around this so I can change the return types to: sObject or another datastructure that will allow me to avoid the installation requirement in the package uploader.

 

Thanks.

Since our org has been upgraded to Spring '12 I have had sporatic incidents where I try to edit a classes body (not change the class name or delete it), and the API returns an error:

 

Save error: This apex class is referenced elsewhere in salesforce.com.  Remove the usage and try again. : Visualforce Page - .... visualforce page that uses this class as a controller...

 

 

I'm not trying to delete the class, and removing it from my Visualforce page would require me to remove other pages/classes/etc.

 

This error comes and goes, and happens for all classes that are controllers to VF pages.

 

Some of our classes are part of managed packages, but we're editing them in the org that the package was created out of, so this shouldn't make any difference.

 

I've had some success using the Migration Tool to move changes from another org, but it also sometimes returns this error.

 

 

Hello,

 

I had a test class "TestRecordTypes" that is part of a managed package. I deleted the class because I wanted to move the test methods inside the controller that was being tested. This didn't work like I thought it would, so I wanted to restore the code from the deleted class, which I had saved locally.

 

There seems to be no way to overwrite or undelete the class. In Eclipse if I create a new class w/ the same nameI get prompted w/ "Duplicate Component Found," and it asks me if I want to overwrite the remote instance. If I choose "OK" I get a local class w/ the deleted code in it. When I save I get errors for the class and it's meta.xml file saying "Save error: Conflict found while preparing to save 'TestRecordTypes.' to server.  Remote instance has been updated since last save or sync.  Use the Synchronize Perspective to resolve the conflict." But the Synchronize with Server tool doesn't let me upload the code to the server. If I try to deploy the newly created class to the server I get an error "Class is deleted". The deleted class still shows up in the SF UI under Develop / Apex Classes but there doesn't appear to be any way to undelete the class.

 

So I appear to be stuck in that Twilight Zone episode where you walk down a street but always end up back where you started. Is this a "feature" or is there a way to restore the class?

 

thanks in advance,

joezaloom