• docbill
  • NEWBIE
  • 30 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 46
    Replies

Whenever I try installing the newest version of the Force.IDE I get stuck on the first title page.

 

This page the following information:

 

<com.genuitec.pulse.explorer.credentials.first.use.title>   [PULSE IMAGE]

<com.genuitec.pulse.explorer.credentials.first.use.description>

Free registration, using only your e-mail address!

...


Already a Pulse user? Log in now!

Powered by Pulse

                                        [BACK] [NEXT] [LAUNCH]

 

The three buttons at the bottom are greyed out.   There is nothing on the page that is fillable or clickable.   I simply cannot find a way past this screen, a way to create a pulse user, or a way to "Log in now!".   Nothing.  I'm just stuck.

 

The previous version of the IDE works, and can be upgraded.   However, it decided to uninstall itself for some unknown reason.  Of course I can install it again, and redo the upgrade process.   But it would be much better if I could just get the correct version to install.

 

 

The following series of posts is an implementation of the idea:

 

https://sites.secure.force.com/success/ideaView?c=09a30000000D9xt&id=08730000000BrQtAAK

 

When viewing the text, the linewrap looks mangled, but it appears the code will cut & paste correctly back into eclipse.   At some point in the future I'll probably offer this on the app exchange.

 

The following is an example of a visual force page for editing accounts with locked fields.

 

 

<apex:page standardController="Account">
<c:DetailsEdit value="{!account}" helpURL="/help/doc/user_ed.jsp?loc=help&target=account_edit.htm&section=Accounts" save="{!save}" cancel="{!cancel}">
<apex:pageBlockSection columns="1">
<apex:repeat value="{!$ObjectType.Account.FieldSets.EditFields}" var="f">
<apex:inputField value="{!account[f]}" />
</apex:repeat>
<apex:repeat value="{!$ObjectType.Account.FieldSets.LockedFields}" var="f">
<apex:outputField value="{!account[f]}"/>
</apex:repeat>
</apex:pageBlockSection>
</c:DetailsEdit>
</apex:page>

 

 

Please participate in the Salesforce IDE survey: https://www.surveymonkey.com/r/B5QXMVQ 
Here is my apex batch:

global class EmailAlertToQuoteProposalApprovalUser implements Database.Batchable<sObject>, database.stateful{
    
    public String EVENT_TYPE_MEETING = 'Meeting';
    private Datetime EndTime=System.now();
    private String query;
    public String limitSize;
    private long recordcount;
    private string debuglog='';
    private integer batchcounter=0;
    private datetime processstarttime=system.now();
    private boolean haserror=false;
    private set<id> processedaccounts=new set<id>();
   
    global EmailAlertToQuoteProposalApprovalUser(datetime activitydatetime){
        if(activitydatetime==null){
            EndTime=System.now().adddays(-1);
        }
    }
   
   global Database.QueryLocator start(Database.BatchableContext BC){
       log('Batch process start time: ' + processstarttime);
       log('Batch process id: ' + bc.getJobID());
       log('Acvitity End Time Parameter: ' + EndTime);
       Datetime dtTimeNow=system.now();
       query='SELECT Id,Pending_With_Email__c,Submitted_Date_time__c FROM Apttus_Proposal__Proposal__c WHERE Submitted_Date_time__c!=null AND Submitted_Date_time__c>=: dtTimeNow' + ' ORDER BY Id';
       if(limitSize!=null)
       {
        query = query + ' LIMIT ' +  limitSize;
       }     
            
       log(query); 
       return Database.getQueryLocator(query);                                    
      
    }
   
    global void execute(Database.BatchableContext BC, List<sObject> scope){
        log('Batch number: ' + batchcounter);
        set<id> QuoteProposalId=new set<id>(); 
        list<Apttus_Proposal__Proposal__c>  lstQuoteProposal=new list<Apttus_Proposal__Proposal__c>();
        for(sobject so: scope){
            id quoteid=(Id)so.get('Id');
            Apttus_Proposal__Proposal__c objQuote= (Apttus_Proposal__Proposal__c)so;
            if(!processedaccounts.contains(quoteid)){
                QuoteProposalId.add(quoteid);
                lstQuoteProposal.add(objQuote);
            }
        }
        if(QuoteProposalId.size()>0){
            log('Number of accounts to be processed: ' + QuoteProposalId.size());
            log('Account Ids: '+ QuoteProposalId);
            List<String> CCAddress=new List<String>();
            CCAddress.add('abaranwal@kloudrac.com');
            string TemplateId=system.Label.quoteEmailTemplate;
            
            processedaccounts.addAll(QuoteProposalId);
            try{
                Messaging.SingleEmailMessage[] mails=new Messaging.SingleEmailMessage[0];
                 
                for(Apttus_Proposal__Proposal__c qt:lstQuoteProposal){
                    list<string> AdditionalRecipients=new list<string>();
                    AdditionalRecipients.add(qt.Pending_With_Email__c);
                    Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                    mail.setToAddresses(AdditionalRecipients);
                    mail.setCcAddresses(CCAddress);
                    //mail.setOrgWideEmailAddressId(OrgWideEmailId);
                    mail.setTemplateId(TemplateId);
                    mail.whatid=qt.id;
                    mail.setTargetObjectId('003n0000008FULE'); 
                    mails.add(mail);

                }
                
                log('Sending emails ... count: ' + mails);
                Messaging.sendEmail(mails); 
            
                        
            }catch(Exception e) {
                haserror=true;
                string body=e.getMessage();
                log(body);
    
            }
        }else{
            log('No Quote/Proposal is processed in this batch');
        }
        ++batchcounter;
    }

    global void finish(Database.BatchableContext BC){
        log('Entire batch process has ended');
        SaveDebugLog();
    } 
    
    public static void SendEmail(String Subject,String Body,String[] Recipeints){
        /*String Displayname=Lookup.getTarget('UpdateOpportunity', 'Config','FromAddress', true);
        //OneCRM.sandbox@ge.com
        Id OrgWideEmailId=[Select Id, DisplayName, Address from OrgWideEmailAddress where Address =:Displayname].Id;    
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        mail.setToAddresses(Recipeints);
        mail.setSubject(Subject);
        mail.setPlainTextBody(Body);
        mail.setOrgWideEmailAddressId(OrgWideEmailId);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});*/
                
    }
    

    private void log(string msg){
        debuglog+=msg+'\n';
        system.debug(logginglevel.info,msg);
    }
    
    private Id SaveDebugLog(){
        String recStr =  'Transaction Log';
        
        Integration_Log__c log= new Integration_Log__c();
        log.Call_Method__c = 'BatchProcessQuoteProposalEscalationEmail';
        log.Object_Name__c = 'Quote/Proposal';
        log.Call_Time__c = processstarttime;            
        log.Status__c = haserror?'Failure':'Success';
        insert log;        
        
        recStr += '\nInterfaceId:' + log.Object_Name__c;
        recStr += '\nObjectId:' + log.Object_Id__c;
        recStr += '\nCallTime:' + log.Call_Time__c.format('yyyy.MM.dd  HH:mm:ss.SSS z');
        recStr += '\nStatus:' + log.Status__c;
        recStr += '\nLogId:'+ log.Id;
        recStr += '\n';            
        recStr += debuglog;
        
        Blob recBlob= Blob.valueOf(recStr);
        Attachment att= new attachment();
        att.Name = 'Log Details ' +system.now()+'.txt';
        att.ParentId = log.Id; 
        att.Body = Blob.valueof(recStr); 
        insert att;     
        
        return log.id;
    }    
    
    public static void startbatch(datetime activitytime){
        
        EmailAlertToQuoteProposalApprovalUser aula=new EmailAlertToQuoteProposalApprovalUser(activitytime);
        aula.log('activitytime: ' + activitytime);
        aula.EndTime=activitytime;
        if(activitytime==null){
            aula.EndTime=System.now().adddays(-1);
        }
        ID batchprocessid = Database.executeBatch(aula);
        System.debug('Apex Job id: ' + batchprocessid );
    }
}


And here is schedulable:  I want to run batch file after every 5 minutes... Please Help
===============================================

global class scheduledQuoteReminderBatchable implements Schedulable {
   global void execute(SchedulableContext sc) {
       EmailAlertToQuoteProposalApprovalUser aula=new EmailAlertToQuoteProposalApprovalUser(system.now());
       ID batchprocessid = Database.executeBatch(aula);
       
   }
}
Hi all,

i recently started encountering the mighty "System.LimitException: Maximum stack depth reached: 11" during some apex development in a sandbox. The apex code we are developing is a BPM (Business process management) tool, so far it has been good but after the last changes it has to handle a quite some data; assuming we don't have an infinite recursion in our code could the error be due to the large amount of data (and thus large number of statements) being involved? If yes why do i see the number 11 in the error?
We first create a new object GTABLE_SM2__c via the asynchronous create() metadata call.   Then we attempt to add multiple fields to this object via another create() call.

Prior to the Summer '14 update for the organization's server, this was performed without issue.   Following the Summer '14 update, this create() call fails if the number of fields is greater than 6.  The SOAP fault is "UNKNOWN_EXCEPTION: Async job could not be executed".

If the create() is performed for 6 or fewer fields on this object, then it succeeds.

This behavior has been observed for both API 29 and API 30 endpoints.

We observed this across multiple Salesforce servers, and noticed that as Summer '14 was rolled out to a server, the behavior of its organizations began showing this problem.


Sample SOAP log of the create() data for 7 fields (header trimmed):

<soap:Body>
    <create xmlns="http://soap.sforce.com/2006/04/metadata">
        <metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CustomField">
            <fullName>GTABLE_SM2__c.COLA__c</fullName>
            <label>COLA</label>
            <precision>18</precision>
            <scale>0</scale>
            <type>Number</type>
        </metadata>
        <metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CustomField">
            <fullName>GTABLE_SM2__c.COLB__c</fullName>
            <label>COLB</label>
            <length>80</length>
            <type>Text</type>
        </metadata>
        <metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CustomField">
            <fullName>GTABLE_SM2__c.COLC__c</fullName>
            <defaultValue>false</defaultValue>
            <label>COLC</label>
            <type>Checkbox</type>
        </metadata>
        <metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CustomField">
            <fullName>GTABLE_SM2__c.COLD__c</fullName>
            <label>COLD</label>
            <type>Date</type>
        </metadata>
        <metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CustomField">
            <fullName>GTABLE_SM2__c.COLE__c</fullName>
            <label>COLE</label>
            <length>5</length>
            <type>Text</type>
        </metadata>
        <metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CustomField">
            <fullName>GTABLE_SM2__c.COLF__c</fullName>
            <label>COLF</label>
            <precision>18</precision>
            <scale>9</scale>
            <type>Number</type>
        </metadata>
        <metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CustomField">
            <fullName>GTABLE_SM2__c.COLG__c</fullName>
            <defaultValue>false</defaultValue>
            <label>COLG</label>
            <type>Checkbox</type>
        </metadata>
    </create>
</soap:Body>



The full response message:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="http://soap.sforce.com/2006/04/metadata">
    <soapenv:Body>
        <soapenv:Fault>
            <faultcode>sf:UNKNOWN_EXCEPTION</faultcode>
            <faultstring>UNKNOWN_EXCEPTION: Async job could not be executed</faultstring>
        </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>

I have a simple trigger that works in the sandbox, does exactly what I want it to do. Cannot get code coverage above 40%.

I also do not know how to see what code is not covered. The test class below was pieced together from samples I found.

Any help would be appreciated!

 

Trigger:

 

trigger Pharmacy_Demo_Completed on Task (before insert){
   for (Task T : trigger.new){
      string TaskProfile = 'Implementation Director';
      string TaskSubject = t.subject;
      string TaskType = 'Send Contracts';
      if (TaskSubject == 'Pharmacy Demo Completed'){
          List <User> usr = [select Id from User where Profile.Name =:TaskProfile limit 1];
          system.debug (Usr.size());

          If (Usr.size() < 1){
             system.debug ('No entries found for ');}
                                       
          if (usr.size() > 0){
                User u = [select Id ,name from User where Profile.Name =:TaskProfile limit 1];
                t.ownerid = u.id;
                t.type = TaskType;}
      
}
}
}
Test Class: (Saves without error)

 

@isTest
public class Taskusertest2 {
    List<Task> insertedTasks = new List<Task>{};
    static testMethod void myUnitTest() {
    for(Integer i = 0; i < 100; i++)    
        {Task t = new Task();
            t.IsRecurrence = FALSE;
            t.sma__CreatedLocationVerified__c = FALSE;
            t.IsReminderSet = FALSE;
            t.MA_Clean_State__c = 'tx';
            t.Subject = 'Testing';
            t.Type = 'Research';
            t.Priority = 'Normal';
            t.Description = 'Task Class Test';
            t.Status__c = 'Demo Scheduled';
            t.Status = 'Completed';
        insert t;}
        
         List<Task> insertedTasks = [SELECT Description
                                                FROM Task
                                                WHERE Status = 'Demo Scheduled'];
         {for(Task t : insertedTasks)
          System.assertEquals(
          'This Task is probably left over from testing. It should probably be deleted.',
          t.Description);}
        
    }}

 

I am getting the following error message sporadically when I run my unit tests:

 

System.DmlException: Delete failed. First exception on row 0 with id a09f0000000e6DpAAI; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: []

 

Sometimes, I don't get the error message at all.  Other times, I get the error, but it occurs on different unit tests.  It occurs randomly.

 

I have a custom setting that I use to externalize some common variables that I use within my apex code.  In my unit test, I first delete my existing custom setting from the org and then recreate my custom setting and the associated values and insert so I have the custom setting setup and populated for my unit test.

 

So, in my unit test, when I delete my existing custom setting, it randomly complains with the UNABLE_TO_LOCK_ROW error.  Is there a way I can avoid this error? 

 

My code runs fine, I've tested it thoroughly and it all runs without error.  The error is only occurring in my unit tests.

 

Any help is appreciated.

Thanks.

If we want to stop the batch of an object, .If we delete the schedule jobs then it will permanently deleted or temporary.

If we want to permanently stop the batch ,what we have to do except delete the batch class?

 

Thanks in advance

It seems that the new Summer'13 update enforces you to work with 18 character ID's always. For example, this happens in apex:

 

Id Id15 = string.valueOf(Id18).substring(0,15);
System.AssertEquals (Id15,Id18);

 

Pre-Summer that assertion fails, as Id15 is the 15 character Id and Id18 is the 18 character Id.
In our custom code many times we use Custom Setting and Custom Labels to avoid hardcoding recordtypes, profiles and other "constant" values. We usually worked with 15 character Ids as Salesforce (SOQL) sometimes returns 15 and other times returns 18 character Ids.

 

Now it seems the ID type always returns 18 character, if you do something like this the assertion is true:

 

Id Id15 = '012200000005byN';
System.AssertEquals (Id15,'012200000005byNAAQ');

 

As this is happening now with the Summer'13 but not happening before with Spring'13, this invalidates many coding.

We found this problem as Salesforce triggered a deep system error like this Salesforce System Error: 1619326252-34083 (1564369920) (1564369920) trying to compare a SelectOption loaded with record types with a Custom Settings String Id Stored.

 

This is a really weird annoyance. You can take a workaround working always with ID type instead of storing Ids into Strings, and always working with 18 character Ids, wether you hardcode Ids into apex and formulas (not a good approach) or you use custom setting and labels to store the ids.

 

Hope this helps... I lost all morning trying to figure out this.

Savepoint sp = Database.setSavepoint();

 

Database.rollback( sp );

 

 

Can you tell me what is the advantage of above statements, plz give a small ex to understand this.

I dont want to execute validation rule upon running test class?

Ok, I know there are a lot of posts on this topic, and I am familiar with the two Visualforce techniques for doing this (using an outputField bound to an SObject currency field, and using the outputText value="{0,number,###,##0.00}" ). However, in my use case, I'm trying to display a currency value in the title of a pageBlock:

 

 

<apex:pageBlock title="Refund Amount: {!refundAmount}" >

 

I can't really use the outputText or outputField options here, so I think I need to do the formatting in my controller. The Apex documentation states that String.format(String, List<String>) works "in the same manner as apex:outputText." Has anyone actually used this method to format a Decimal value into a properly formatted currency String in Apex code?

  • November 17, 2010
  • Like
  • 0

Is anyone doing this successfully?  We're at a point where I'd like to migrate from just using regular code comments to using full blown javadoc-accessible documentation, to make it easier and more appealing for our devs to reuse code.

 

Can anyone provide any examples of generating javadoc html from the .cls files stored by Eclipse?

I have a text formula to which I would like to add a carriage return/line break.  I tried concatenating chr(13) and chr(10), but the validation didn't like it.  Is this possible?