• MJ Kahn / OpFocus
  • NEWBIE
  • 450 Points
  • Member since 2012
  • VP Development & Product Strategy

  • Chatter
    Feed
  • 14
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 101
    Replies
Hello All,

I have created a VisualForce page with a list that allows the end user to enter the values into the fields all at once.  At the end of each row, they have an option to add another row or to save all the data.  

In standard view, I have a verification rule on one of the Field X that makes sure if Field Y equals a specific value, then Field X cannot be Null.  This works great in the Standard view; however throws an exception error when entering through the VF list.  

I am not sure how to write a code for the VF list that verifies that Field X is not Null when Field Y equals a specific value.  Moreover, I have my list listNewTime and I do not know how to access the data temporarily being stored there prior to running the insert command.  

Thank you in advance. 
I am attempting to match up users coming in from an external POST request to Salesforce users via a SOQL query of the name that returns a user record, then use the ID from the user record to insert a custom object record with a User Lookup field. However I am getting the following error: 
Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, User: id value of incorrect type: 005U0000003GvJKIA0: [User__c]
This error is being thrown because the ID needs to be 15 characters, but is, in practice, coming out as 18 characters. I have tried a few different methods of limiting the string to 15 chars, but to no avail. This is frustrating because it works just fine in the sandbox environment, it is only when deployed to production that this error comes up.

Methods I have tried:

1. No string correction
// match names list to users and create records for each user
        finalCount = names.size();
        for (Integer j = 0; j < finalCount; j++) {
        
            User matchUsr = [SELECT Id, Name
                                FROM User
                                WHERE Name = :names[j]
                                LIMIT 1];
            String usrId = matchUsr.Id;
            
            indivs.add(new Late_Tasks_by_User__c(User__c=usrId,Dependent_Tasks__c=deps[j],Actual_Late_Tasks__c=lates[j],Date__c=datej));
            usrId = '';
            echoOut += names[j] + ', ';
        }

2. Substring the usrId string to (0,15) 
// match names list to users and create records for each user
        finalCount = names.size();
        for (Integer j = 0; j < finalCount; j++) {
        
            User matchUsr = [SELECT Id, Name
                                FROM User
                                WHERE Name = :names[j]
                                LIMIT 1];
            String userMatch = matchUsr.Id;
            String usrId = userMatch.subString(0, 15);
            
            indivs.add(new Late_Tasks_by_User__c(User__c=usrId,Dependent_Tasks__c=deps[j],Actual_Late_Tasks__c=lates[j],Date__c=datej));
            usrId = '';
            echoOut += names[j] + ', ';
        }

3. Take one character from the ID string of the user record at a time (0-14), and add to new usrId string
// match names list to users and create records for each user
        finalCount = names.size();
        for (Integer j = 0; j < finalCount; j++) {
        
            User matchUsr = [SELECT Id, Name
                                FROM User
                                WHERE Name = :names[j]
                                LIMIT 1];
            String userMatch = matchUsr.Id;
            String usrId = '';
            for (Integer xc = 0; xc < 15; xc++) {        
                usrId += userMatch.subString(xc, xc+1);
            }
            
            indivs.add(new Late_Tasks_by_User__c(User__c=usrId,Dependent_Tasks__c=deps[j],Actual_Late_Tasks__c=lates[j],Date__c=datej));
            usrId = '';
            echoOut += names[j] + ', ';
        }

None of these have produced a working result. All three continue to return an 18 character string as the usrId variable. I have found several threads on this forum regarding this topic, but the only solutions that are listed with those questions are either syntax error with the specific code, or someone saying that you have to subString the ID. If anyone has any solutions or ideas beyond that, please let me know.

Thanks,
Joe
Hello all, 

I have been trying to test an Event trigger but I'm kind of lost in a particular part of the execution that I want and need to test.
On the Event object I have a Boolean custom field, has_Attachment__c. So if you insert an attachment in an event this Boolean field will be set to true. How do I test this?  
I use a centralize object initialization class: 
 
public with sharing class EventCentralizeObjectInitialization {
	
	
	 public static List<Event> InitTestInsertEvents(Integer count)
     {
     	
     	Account account = new Account(Name ='testEventAfterInsertAccount'); 
    	insert account; 
    	
    	Profile p = [SELECT Id FROM Profile WHERE Name='System Administrator']; 
        User u = new User(Alias = 'systemAd',
                          Email='systemAd@testorg.com', 
       					  EmailEncodingKey='UTF-8', 
       					  LastName='Testing', 
       					  LanguageLocaleKey='en_US', 
            			          LocaleSidKey='en_US', 
            			          ProfileId = p.Id, 
            			          TimeZoneSidKey='America/Los_Angeles', 
            			          UserName='systemAdEvent@testorg.com');
    	
    	insert u; 
    	
    	DateTime dt = System.now(); 
    	
    		List<Attachment> eventAttMap = new List<Attachment>();
     		Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body');
     		
     		List<Event> eventList = new List<Event>(); 
     		    		    		        	        	
        	for(Integer x=0; x< count; x++)
        	{
        		eventList.add(new Event(OwnerId = u.Id,
        		                  Subject ='The test subject',
        				  StartDateTime= dt.addMinutes(-120),
        				  EndDateTime = dt,
        				  WhatId = account.id,
        				  Activity_Type__c = 'Inspection')); 
        	}
        	
        	        		
        	return eventList;	
    
       }
         
 }

Then I pull the method InitTestInsertEvents to my test class like this: 
 
@isTest
private class TestEventAfterInsert {

    public static testMethod void testPrepareEventAfterInsert()
    {
    		 
    	List<Event> eventList = EventCentralizeObjectInitialization.InitTestInsertEvents(2); 
    	List<Attachment> attList = new List<Attachment>();
    	List<FeedItem> feedList = new List<FeedItem>();
    	List<Event> eventToUpdate = new List<Event>();
    	Set<Id> ownerIds = new Set<Id>();
    	Set<Id> accountIds = new Set<Id>();
    	Set<Id> eventAttIds = new Set<Id>(); 
    	Id eventID;
    	
    	
    	Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body');
    	
    	
    	Test.StartTest();  
    	insert eventList;
    	Test.StopTest(); 
    	
    	Map<Id, Event> eventmap = new Map<Id, Event>(eventList);
    	List<Event> events = [SELECT Id, OwnerId, Account.Id, has_Attachment__c, (SELECT Id FROM Attachments) FROM Event WHERE Id IN :eventmap.keySet()]; 	
    	
    	System.assertEquals(events.size(), 2); 
     
     	for(Event e: events)
     	{
     		if(e.Id!=null){
     			attList.add(new Attachment(
     			Name='The test attachment',
     			Body=bodyBlob,
     			ParentId= e.id,
     			OwnerId = e.OwnerId));
     			    			
     		}
     		
     	System.assertNotEquals(attList.size(), 0); 
     	
     	   	
     	}
     	
     	if(!attList.isEmpty() && attList.size()>0)
     	{
     		insert attList; 
       	}
     
     	for(Attachment a: attList)
     	{
     		if(!attList.isEmpty())
     		{
     			Id eventIdAtt = a.ParentId;
     			eventAttIds.add(eventIdAtt);				
     			}
     		}
     		
     	List<Event> eventListAttIds = [SELECT Id, OwnerId, Account.Id, has_Attachment__c FROM Event WHERE Id IN: eventAttIds];	
     	
     		for(Event e: eventListAttIds)
     		{
     			if(!eventListAttIds.isEmpty() && eventListAttIds.size()>0)
     			{
     				e.has_Attachment__c = true;
     				ownerIds.add(e.OwnerId);
     				accountIds.add(e.Account.Id);
     				eventId = e.Id;
     				eventToUpdate.add(e);
     				
     				System.assertEquals(e.has_Attachment__c, true); 
     			}
     		}update eventToUpdate;
     		
     
  }	
}

If I run the test class I only get 47% of the test coverage.
I have been trying different things without getting that percentage higher than 47 :( 

So the question is, how can I pass the events to the test class with an attachment if I can't insert the attachments becasue the ParendIt is not present? Anyone knows how to tests this particular scenario?
Thanks. 
 
I have a problem with an integration job and a trigger that seem to be colliding and I was wondering if anyone could help me. There is an integration job running in PowerCenter that takes opportunities and creates contacts from the information on the opportunity. There is also a trigger that runs to update the contact roles when these contacts are created. The trigger is causing problems with the power center job and the power center log shows this error:

2015-06-16 02:58:33 : ERROR : (28559 | WRITER_1_*_1) : (IS | Int_Serv_pcpw_Unicode) : node01_pcpw : WRT_8164 : Error loading into target [Contact] : Error received from salesforce.com. Fields []. Status code [CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY]. Message [ContactOpportunityAssoc: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 200; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [ContactId]: [ContactId]

This is causing some contacts not to get created.

The trigger is called ContactOpportunityAssoc and here's the code:
trigger ContactOpportunityAssoc on Contact (after insert) {
set<String> custnmbr = new set<String>();
Map<String,Id> mapCnts = new Map<String,Id>();
for (Contact c: Trigger.new){
if (c.cnt_plcsc_CustNmbr_ExtID__c != null)
{
custnmbr.add(c.cnt_plcsc_Customer_Number__c);
}
/*List all Contacts that have the customer number the same as the loaded custnmbr set*/ 
mapCnts.put(c.cnt_plcsc_Customer_Number__c , c.Id);
}

List<OpportunityContactRole> ocr = new List<OpportunityContactRole>();
/*List all Contacts that have the customer number the same as the loaded custnmbr set*/
for(Opportunity opp: [Select Id, Customer_Number__c 
From Opportunity 
Where Customer_Number__c IN: custnmbr]){

OpportunityContactRole ocr2 = new OpportunityContactRole();
ocr2.ContactId = mapCnts.get(opp.Customer_Number__c);
ocr2.OpportunityId = opp.Id;
ocr2.IsPrimary = true;
ocr2.Role = 'Primary Insured';
/*System.debug('DLB932 - '+ocr2);*/
ocr.add(ocr2);
}

/*Insert the new list of OCR's*/
if(!ocr.isEmpty())
{insert ocr;}

Thank you!
Hi All

I have creaed a approval process and uploading a PDF document and technical writer will submit for approval process, then approver will receive the email with PDF, however approver receiving the PDF but without content ( blank PDF ). Below is the code, 
<messaging:emailTemplate subject="Document Submitted" recipientType="User" relatedToType="Compliance_Documents__c">
<apex:image url="/servlet/servlet.FileDownload?file=015W0000000Dmru"
height="64" width="64"/>
    <messaging:htmlEmailBody >
        <html>
        <img src="http://www.XXXX.com/ucmprdpub/groups/public/documents/logo/logo_png.png"/>
            <body>
            <p>Dear {!recipient.name},</p>
            
            <p>Attached is document related to Compliance Document "{!relatedTo.Compliance_Document_Name__c} ". </p>
            <p>Please Review the document and <B> Approve/Reject.</B> To approve or reject this item, click this link </p>
            <P>
                <apex:outputLink value="https://cs13.salesforce.com/{!relatedTo.id}">
                    Approve / Reject
                </apex:outputLink>
                <Br/><Br/>or <Br/><Br/>
                <B> To Approve through email :</B> reply to this email with one of these words in the first line of the email message: APPROVE, APPROVED.
                <Br/><Br/>
                <B> To Reject :</B> Please click on the above link.
                <Br/><Br/>
                <B>For Comments: </B>
If replying via email, you can also add comments on the second line. Comments will be stored with the approval request in Salesforce CRM.
            </P>
            <br/> <br/>
           <b> Previous approval history </b>

        <c:ApprovalItem recordId="{!relatedTo.Id}" />
         <br/>
          <br/>
        
            Kind Regards, <br/>
            Document Compliance Team
            
            </body>
        </html>
    </messaging:htmlEmailBody>
    
    <messaging:attachment filename="{!relatedTo.name}" renderAs="PDF">
        <apex:repeat var="cx" value="{!relatedTo.id}">
        </apex:repeat> 
    </messaging:attachment>
</messaging:emailTemplate>



Regards
Shaker
I’m about to go live with a Community, and I’ve created a custom domain for it. I’ve created the CNAME entry, and in Salesforce, I configured the Domain and its URL, uploaded a CA-Signed certificate, and added the certificate to the domain, all carefully following the documentation. And I’ve waited several days for everything to propagate. Most of the time, now, when I browse to my custom domain (let’s call it my.abc.com), I see the correct page (the login page), I can log into the Community, and everything is fine.
 
However, for some people, in some browsers, they get a message saying “This connection is untrusted,” like this:

This connection is untrusted

This doesn’t happen for everybody. Most people can use the custom domain just fine, which leads me to believe that the domain and certificate are configured properly. The person who reported this error in Firefox is able to get to the Community just fine using another browser on the same computer on the same network.
 
Telling my Community users to just click “I understand the risks” isn’t an option. Why do some people get this error, and what can I do to prevent it?
 
I have a SelectList which contains a list of user actions (replaces the need for multiple buttons). I have successfully implemented AcionSupport to invoke an Apex call, but I want to issue a "confirm" dialog on 2 of the actions in the list. My JS skills are very primitive, so I suspect this is not really a difficult task.

Here is my VF code excerpt:

<apex:selectList id="nextAction" value="{!nextAction}" size="1" 
Title="Select the next action">
<apex:selectOptions value="{!nextActionList}"></apex:selectOptions>                        
<apex:actionSupport event="onchange" action="{!doNextAction}" /> 
</apex:selectList>


I want to put an "onchange" event on the selectList which passes the selected option to a JS script which checks the action and optionally displays a confirm warning.

Any help greatly appreciated

 
Good day Ladies and Gents.

I lay before you the fruit of many days of frustration, labor and tears, begging for your help.

There are a few moving parts here, so let me introduce them one by one, with nicknames.

TheVisualForcePage - A humble visualforce page, attached to standard controller User, with a custom extension.

TheVFExtensionCtrl - A braggadocious apex class, who wants the world to know how awesome it is(n't).

TheVFComponentOfDoom - A visualforce component with a custom Controller that exposes two very insubordinate Command buttons. In our case, this component exists to provide a re-usable "delete" button, associated logic and general frustration.

TheVFComponentCtrl - An apex class whose sole purpose in life is to delete an F'ing record. Like the fat kid at primary school sports day, it's main issue is that nobody calls on it. (and therein lies our problem)

To set the stage with these moving pieces, we should consider that the Visualforce page displays, depending on mode, a list of either makes, models or years of cars owned by the given user. Because in my fictional world, users may own multiple Ferrari F12 Berlinetta's (different colors of course.) We can safely assume that if one were to navigate to Farrari, and then Berlinetta, we would see at least one record displayed on our VF page. (2013 of course). These records are displayed in a custom list view format created by using an Apex:Repeat tag.

It's here where we discover our first problem. The list view has, as it's last column a series of "actions" like: "Sell", "Delete" (dear god, who would ever delete a Farrari f12???) and edit. Sell and Delete are command buttons exposed via our handy components. To simply this issue, lets pretend we only have a delete button.

Now, to the untrained, unsuspecting eye a visualforce component, with it's own controller invoked on a page during an Apex:Repeat loop doesn't sound all that complicated. Sure there's the issue of passing in an ID to the logic of the component controller, but that's time-tested, mother approved. Indeed, I thought I was, well, done with this until ...

As it turns out, pressing the delete button has a very curious set of consequences in this setup, consequences I can not fully explain, nor fix.

When you click on the delete command button, the page refreshes (yay, i want that!) However:

Detailed logging shows that the master vfpage's associated controller extension's constructor is executed. Without error
That the component's deleteThisCar method is Never invoked.
Visually, the page state has been lost. What do I mean? I mean that the page that was displaying years of Ferrari F12 Berlinetta's is now just blank, showing only the headers of the listview.

Not to be outdone by an overgrown java app, I've tried the following approaches:

Updating my code to use apex:ActionRegion tags around the components
Tried every damn combination of reRender on the command buttons. Curiously, this had the effect of not reloading the page, and not calling my apex method.
I said, F-IT loudly and refactored the code to not use a component -- invoking an action method directly on the master controller, but this also failed! causing the page to reload, without my action method being invoked
I have slept on the problem. (no joke, this usually works for me. I wake up with the answer.)
I have asked Co-workers to look at it. They suggested the actionRegion bit.
I tried giving up on my trusty commandButtons attempting to use a standard input button with an ActionFunction -- Curiously, this invokes the constructor of my component controller, but not the actual delete function.

Suffice it to say, that overgrown java app is raining on my day.

This feels like somehow the wrong form is being submitted, which is distinctly maddening because i've also rewritten the master vf page such that it had 2 forms (search in header, main page form) and 5 forms (Search in header, 1 form per "mode") Neither has worked.

I realize that it'd be hypocritical in the extreme if I posted this question without some kind of code attached, so here's the component and it's extension. The VF page itself is quite lengthy and I've not finished "sanitizing" it for public consumption.
 
<apex:component controller="ACE_DeleteCarCmpCtrl" allowDML="true">
<apex:attribute name="tv"
    description="ID of the Car model and year to display controls for."
    type="Id"
    required="false"
    assignTo="{!CarVersionId}"
/>
<apex:attribute name="t"
    description="ID of the Car model to display controls for."
    type="ACE_Track__c"
    required="false"
    assignTo="{!Car}"
/>


    <apex:outputPanel layout="block" id="theoutputpanel">
    <apex:actionRegion >
    <!-- <apex:actionFunction name="sayHello" action="{!deleteTrackOrVersion}" rerender="TrackVersionsForSelectedTrack" /> -->
        <apex:commandButton action="{!deleteCarOrYear}"
            value="Delete Car"
            rendered="{!IF(ISNULL(Car), false , true)}"
            styleClass="btn btn-sm btn-default"
            />
        <!-- <input type="button" class="submit" onclick="sayHello"/> -->
        <apex:commandButton action="{!deleteCarOrYear}"
            value="Delete Car Version"
            styleClass="btn btn-sm btn-default"
            rendered="{!IF(ISNULL(CarVersionId), false , true)}"
            rerender="nothing"
            />
    </apex:actionRegion>
    </apex:outputPanel>
</apex:component>
and the controller for it:
public with sharing class ACE_DeleteCarCmpCtrl {

Public ACE_Car_Version__c carVersion {get; set;}
Public Id carVersionId  {get; set { carVersionId = value; }}
Public ACE_Car__c car {get; set;}

public ACE_DeleteCarCmpCtrl() {
    system.debug('$$$$$$$$$$$$$$ : ' + ApexPages.currentPage().getParameters());
}

public PageReference deleteTrackOrVersion() {
    system.debug('************* : ' + ApexPages.currentPage().getParameters());
    try {
        if (car != null && carVersion != null) {
            throw new ACE_contentManagementLib.ContentManagementException('Both car and carVersion cannot be populated when invoking this component');
        } else if (carVersion == null && car == null) {
            throw new ACE_contentManagementLib.ContentManagementException('Both car and carVersion cannot be null when invoking this component');
        } else if (carVersion != null) {
            ACE_ContentManagementLib.deletecarVersion(carVersionId);
        } else if (car != null) {
            ACE_ContentManagementLib.deleteTrack(track);
        }
    } catch (ACE_ContentManagementLib.ContentManagementException e) {
        ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, e.getMessage()));
    }
    //return null;
    //Also tried null above. no joy.
    PageReference pageRef = new PageReference('/AwesomePage?id=' + UserInfo.getUserId() );
    system.debug('$$$$$$$$$$$$$$ : ' + ApexPages.currentPage().getParameters());
    pageRef.setRedirect(true);
    return pageRef;
}
}


 
I need to get a list of all users who are currently logged into my org.

This idea (https://success.salesforce.com/ideaView?id=08730000000BpPOAA0) explains that, as of a few months ago, this is possible. It explains where to find this information via the browser (Setup | Security Controls | Session Management), and also says that it's available through the API. Can anyone point me to documentation that explains how to get it via the API?

Thanks!
Getting an error Visualforce Page
[Error] Error: Unknown property 'String.Name'

and code is as blow:

<apex:page Controller="AccountList" sidebar="false">
    <script type="text/javascript"
    src="https://maps.google.com/maps/api/js?sensor=false"></script>
    <style>    
        #map {
            font-family: Arial;
            font-size:12px;
            line-height:normal !important;
            height:400px;        
            padding: 20px;
        }       
        .roundCornerCss{ 
            /* outer shadows  (note the rgba is red, green, blue, alpha) */
            -webkit-box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.4); 
            -moz-box-shadow: 0px 1px 6px rgba(23, 69, 88, .5);
            
            /* rounded corners */
            -webkit-border-radius: 12px;
            -moz-border-radius: 7px; 
            border-radius: 7px;
            
            /* gradients */
            background: -webkit-gradient(linear, left top, left bottom, 
            color-stop(0%, white), color-stop(15%, white), color-stop(100%, #D7E9F5)); 
            background: -moz-linear-gradient(top, white 0%, white 55%, #D5E4F3 130%); 
        }   
    </style>
    <script type="text/javascript">                   
        var geocoder;
        var map;
        var infowindow = new google.maps.InfoWindow();
        var places = [];
        var title_content = new Array();                    
        var popup_content = new Array();                    
        var address = new Array();
        var address_position = 0;                    
        var timeout = 600;
        function initialize(){
            geocoder = new google.maps.Geocoder();
            var latlng = new google.maps.LatLng(29.01, 77.38);
            var myOptions = {
              zoom: 2,
              center: latlng,
              mapTypeId: 'roadmap'
            } 
            <apex:repeat value="{!objAccounts}" var="loc" id="addressesId">
                title_content.push("Name: "+"{!loc.Name}"+" \nClick for more Detail");                 
                address.push("{!loc.BillingStreet}, {!loc.BillingCity}, 
                +"{!loc.BillingPostalCode},{!loc.BillingCountry}");
                popup_content.push("<b>Account Name: {!loc.Name}
                +"<br/>Street: {!loc.BillingStreet}"
                +"<br/>City: {!loc.BillingCity}<br/>Postal Code: {!loc.BillingPostalCode}"+
                +"<br/>Country: {!loc.BillingCountry }</b>");                                                    
            </apex:repeat>    
            map = new google.maps.Map(document.getElementById("map"), myOptions);
            addMarker(address_position);
        }        
        function addMarker(position){
            geocoder.geocode({'address': address[position]}, function(results, status){
                if (status == google.maps.GeocoderStatus.OK) {
                    places[position] = results[0].geometry.location;                                    
                    var marker = new google.maps.Marker({
                        position: places[position],
                        title:title_content[position],
                        icon: getMapIconUrl(position+1),
                        map: map
                    });
        
                    google.maps.event.addListener(marker, 'click', function() {
                        if (!infowindow) {
                            infowindow = new google.maps.InfoWindow();
                        }
                        infowindow.setContent(popup_content[position]);
                        infowindow.open(map, marker);
                    });
                }
                else{
                    if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT){
                        setTimeout(function() { addMarker(position); }, (timeout * 3));
                    }
                }
                address_position++;
                if (address_position < address.length){
                    setTimeout(function() { addMarker(address_position); }, (timeout));
                }
            });
        }
        /*
            @Description: To Put diffren color image on Google Map
            @Param: Marker Number to Add on map.
        */
        function getMapIconUrl(markerNumber){
            if(markerNumber > 21){
                markerNumber = markerNumber%20;
            }                    
            var mapIconUrl = "{!URLFOR($Resource.GoogleMarkers, 'GoogleMark/1.png')}";
            var newIcon = markerNumber+'.png';
            mapIconUrl = mapIconUrl.replace('1.png',newIcon);
            return mapIconUrl;
        }         
    </script>  
    <apex:pageMessages />
    <div id="map" class="roundCornerCss"></div>   
    <script>
         initialize();
    </script>
</apex:page>
I have an embedded VF page on the Account Detail.  However the page frequently supercedes the height in pixels set by the page layout.  This isn't a problem with scrollbars enabled however the embedded page renders with it scrolled by the bottom by default.  Is there a way around this?

Thanks in advance.
I have a Scheduled Batch Apex job that has been running nightly for a couple of months now. The start method does a relatively simple query to get a QueryLocator for a bunch of Attachments. Last night, I got the following error message:

Subject: Developer script exception from <my org name> : 'Batch_Attachments' : java.io.IOException: Missing cursor chunk (offset 0, count 400), key: V:SFDC::x/<my org id>/T/01ga000001i0STTAA2/0.cursor

Apex script unhandled exception by user/organization: 005a0000007hfmB/<my org id>

Failed to process batch for class 'Batch_Attachments' for job id '707a000001BYsGh'


No line number - this appears to be a failure in the Batch Apex system, not in the Apex code. 

Any thoughts on what it means, why it happened, or how to avoid it in the future?

Thanks!
Well I created a Public Class/Controller, then I couldn't find it (wasn't coming up in any search), so I tried and recreating it, but it says it's already created.  What gives?  This is very bizarre behavior.  
Hi,

I want to use a custom button which takes the user to new contact page . My visualforce page is based on Account standard controller. I am trying to as below , but it give me and errror.
Error: Field $Action.Contact.New does not exist. Check spelling 
Error: Field $Action.Contact.New does not exist. Check spelling.



<apex:page standardController="account" extensions="AccountDetailController">
<apex:commandButton action="{!URLFOR($Action.Contact.New)}" value="New Contact">
</apex:page>

How can i access the action method of contact from account standard controller visualforce page.??

Regards,
raj

I have an unusual problem. I  have developed an Apex class which implments schedulable.  I go into Setup -> Develop -> Apex Classes -> Schedule Apex and fill in the form. Now, when I'm selecting the class I just press the icon to give me a list and it only returns the one class which implements schedulable, which would appear the smart way of letting you select the class.

 

However, I get the following error -

Error: You must select an Apex class that implements the Schedulable interface.

 

I'm really baffled by this, see code below.

 

global class TimesheetWeeklyJob implements Schedulable{
    global void execute( SchedulableContext SC ) {
        WeeklyTimesheetProcess.markSubmitted();
        WeeklyTimesheetProcess.createNewSheets();
    }
}

 

I have a VF page that I'm embedding in a standard page layout. I'd like to pass a parameter into the VF page. The VF page's controller will look at the parameter and the current record, then decide what to display on the embedded page.

 

I have the VF page and controller written. But how can I get the standard page layout editor to pass a parameter in to the VF page? Is that even possible? If not, do you have any other suggestions?

 

Thanks!