• HariDinesh
  • SMARTIE
  • 1006 Points
  • Member since 2011

  • Chatter
    Feed
  • 37
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 292
    Replies

Can any one please let me know when do we use list? when do we use map? when do we use set?

 

I'm bit confused regarding their usage.

  • September 13, 2012
  • Like
  • 0





public with sharing class CreateSPrintBacklogContExt_1 {

       public List<Backlog__c> sblogs {get; set;}

public final Sprint__c parSprint;     
       public  Request__c StartDate{get;set;}
       public  Request__c EndDate{get;set;}

 public CreateSPrintBacklogContExt_1(ApexPages.StandardController myController) {
    
     
       StartDate =  new Request__c();
       EndDate =  new Request__c();     
       parSprint=[Select ID,Name,Project__c,Release__c  from Sprint__c  WHERE ID = :((Sprint__c)myController.getrecord()).ID];           
       sblogs = new List<Backlog__c>();
       Backlog__c SBacklog = new Backlog__c();      
       SBacklog.Sprint__c = parSprint.Id;             
       sblogs.add(SBacklog);     


  public PageReference Insertbacklog() {
Insert sblogs;
PageReference parrec = new PageReference('/apex/CreateBacklogs?id={!Sprint__c.id}');
 parrec.setRedirect(true);
return parrec;
}





error :Id value {!Sprint__c.id} is not valid for the Sprint__c standard controller

Hi!

 

Could please someone tell me how do I modify url in a tab with IF statment?

For instance, if formula = /apex/MyPage then it does work, but when i set it to IF(1=1,/apex/MyPage,/apex/MyPage) -- it doesn't. How would you modify the las statement to make it work?

 

I do NOT want to open VF page instead of url because:

In our tab we are opening an external url. Sometimes this url doesn't work (if a custom setting hasn' been created). So I'm trying to check if a custom setting exists first, and if it doesn't then I want to open a VF page saying 'go create custom settings record'.

 

Thanks in advance

I have upgraded my Java Eclipse install, and need to re-install the Force IDe plugin.. no problem done it a 100 times..

except I am getting this data error now.

on both version 25 and 24..

 

Problems downloading artifact: osgi.bundle,com.salesforce.ide.api,25.0.0.201206181021.
MD5 hash is not as expected. Expected: cfe2af79a543696580b0dc8120ae63ea and found 494430c70a7cfcd0c7e8dc4aa88a3860.
Problems downloading artifact: osgi.bundle,com.salesforce.ide.documentation,25.0.0.201206181021.
MD5 hash is not as expected. Expected: 314d2f02d4c7e63caaff7feff76dcd87 and found 56003a3e322c7c19e95a4f7761b6842a.

 

is there a problem with the package?

Hi All,

 

Following is the error, which is displaying when i am trying to install force.com in eclipse -

 

An error occurred while collecting items to be installed
session context was:(profile=epp.package.java, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
Problems downloading artifact: osgi.bundle,com.salesforce.ide.api,25.0.0.201206181021.
MD5 hash is not as expected. Expected: cfe2af79a543696580b0dc8120ae63ea and found 6a6316e82af3bb7c590631bbaf86ece5.
Problems downloading artifact: osgi.bundle,com.salesforce.ide.core,25.0.0.201206181021.
MD5 hash is not as expected. Expected: 2850ffbb014faaf022bbb32f146ee699 and found a9ec6d0ec89ae775f36ab8cb9906c89b.
Problems downloading artifact: osgi.bundle,com.salesforce.ide.documentation,25.0.0.201206181021.
MD5 hash is not as expected. Expected: 314d2f02d4c7e63caaff7feff76dcd87 and found 9699663dabb960b3c4c2bf3319d26825.

 

 

Kindly advice as to waht could be the error.

 

Many thanks in advance 

 

Regards

Anidev

  • September 07, 2012
  • Like
  • 0

Hi,

 

I know that we can iterate at most 50M rows using query locator, does anybody have any idea about SOQL rows limit for sub query used in query locator? 

 

Thanks in advance.

 

Thanks,

Lakhan

Is it possible to write a validation rule on FORMULA field, will it work

  • September 06, 2012
  • Like
  • 0

Hi

 

I am new to development.

 

I have a  custom object  Add, contains three fields num1, num2, result.

 

i want to write a trigger for addition of num1 and num2.

 

when i enter num1 and num2 the result field will be automatically displyed.

 

Regards

 

Is any material//videos on Changeset

  • August 29, 2012
  • Like
  • 0

Hello,

Can anyone help me correct this error? I am not a developer hoping someone can walk me through what steps to take to get this running correctly

Thank You,

Brian

 

8/28/2012 1:00 AM

 Batch ApexFailedFirst error: Inactive User, orgId: 00DA0000000BYaz userId: 005A0000001cdlv011 8/28/2012 1:00 AMDistributionListClass 707A000000QjvGg
  • August 28, 2012
  • Like
  • 0

Hi,

 

I'm using custom labels on my visualforce page.  This generally works ok however in a popup screen I have when the custom label is long the apex:pagemessage displays funny (the severity icon is overlapped with the text(.  I was thinking that I could get around this by adding line breaks into the Custom Label but a <br> tag cannot be added when creating a custom label.  Does anyone know if there is a way to do something like this?  I know &nbsp; can be used to add spaces.  For a line break is there a similar non <br> tag which cab be used?  Or is there a way of escaping the <br> when I try to add it to the custom label?

 

Thanks in advance for any suggestions.

1)     what is the storage capacity for dev, config and fullcopy sandboxes ? what are the differences ?

2)     How many editions are there in salesforce ? (what shoud we tell when asked in interview ?)

3)     How many licenses are there ? (what shoud we tell when asked in interview ?)

4)     what are Governor Limits ?

 

Hi,

 

Is it possible to rename the field name in reports? ie, we drag and drop the field and can we have a new name (as display name) for report alone. 

 

Thanks,

Aravind

i want information  about sfdc life cycle

  • August 26, 2012
  • Like
  • 0

 

 I have a requirement to display either of  Standard Page (Account page )and Customized Standard page (Account Page with few extra custom sections added) based on a Picklist selection.  My problem is can we customize a standard page and save it as another page? Also, do we need JavaScript/ VF event like 'onchange'  for displaying different pages?  Appreciate your help.

hello All,

 

Here I'm again with some un-coverage issue for Apex In-BoundEmailService class in sfdc.

 

Here is myInbound emailservice class-

 

global class inBoundEmail implements Messaging.InboundEmailHandler
{
   global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope)
   {
        Messaging.InboundEmailResult result = new Messaging.InboundEmailresult();
        String subToCompare = 'Create Contact';

        if(email.subject.equalsIgnoreCase(subToCompare))
        {
            Contact c = new Contact();
            c.Email=email.fromAddress;
            
            // capture phone number and city also from incoming email.
            // Splits each line by the terminating newline character  
            // and looks for the position of the phone number and city 
            String[] emailBody = email.plainTextBody.split('\n', 0);
            c.LastName=emailBody[0].substring(0);
            c.Phone = emailBody[1].substring(0);
            c.Title = emailBody[2].substring(0);
                       
            insert c;
            
            // Save attachments, if any
            if (email.textAttachments != null)
            {
            for(Messaging.Inboundemail.TextAttachment tAttachment : email.textAttachments)
            {
            Attachment attachment = new Attachment();

            attachment.Name = tAttachment.fileName;
            attachment.Body = Blob.valueOf(tAttachment.body);
            attachment.ParentId = c.Id;
            insert attachment;
            }
            
            }

            //Save any Binary Attachment
            
            if (email.binaryAttachments != null)
            {
            for(Messaging.Inboundemail.BinaryAttachment bAttachment : email.binaryAttachments) {
            Attachment attachment = new Attachment();

            attachment.Name = bAttachment.fileName;
            attachment.Body = bAttachment.body;
            attachment.ParentId = c.Id;
            insert attachment;
            }
           } 
        }

        result.success = true;
        return result;
             
   }
   }

Thisis the Test Class which is creating no error but it's not covering all test conditions.

 

//Test Method for main class
   
   static testMethod void TestinBoundEmail()
   {
     // create a new email and envelope object
     
   Messaging.InboundEmail email = new Messaging.InboundEmail() ;
   Messaging.InboundEnvelope env = new Messaging.InboundEnvelope();
   
   // setup the data for the email
   
  email.subject = 'Test Job Applicant';
  email.fromAddress = 'someaddress@email.com';
  
  // add an Binary attachment
  
  Messaging.InboundEmail.BinaryAttachment attachment = new Messaging.InboundEmail.BinaryAttachment();
  attachment.body = blob.valueOf('my attachment text');
  attachment.fileName = 'textfileone.txt';
  attachment.mimeTypeSubType = 'text/plain';
  email.binaryAttachments = new Messaging.inboundEmail.BinaryAttachment[] { attachment };
 
  // add an Text atatchment
  
  Messaging.InboundEmail.TextAttachment attachmenttext = new Messaging.InboundEmail.TextAttachment();
  attachment.body = blob.valueOf('my attachment text');
  attachment.fileName = 'textfiletwo.txt';
  attachment.mimeTypeSubType = 'texttwo/plain';
  email.textAttachments =   new Messaging.inboundEmail.TextAttachment[] { attachmenttext };
 
  // call the email service class and test it with the data in the testMethod
  inBoundEmail  testInbound=new inBoundEmail ();
  testInbound.handleInboundEmail(email, env);
    
   // create a contact data
   
    Contact testContact= new Contact();
    testContact.Email='someaddress@email.com';
    testContact.LastName='lastname';
    testContact.Phone='1234567234';
    testContact.Title='hello';
    insert testContact;
    
    system.debug('insertedcontact id===>' +testContact.Id);
   
   // Create Attachmenat data
   
  Attachment attachmnt =new Attachment();
  attachmnt.name='textfileone.txt';
  attachmnt.body =blob.valueOf('my attachment text');
  attachmnt.ParentId =testContact.Id;
  insert  attachmnt ;
   
   
   }
   

 

Could any one please make me correct in this case.

 

I tried to put all conditions and test data still it's creating problem.

 

Thanks for your valuable suggestions.

 

Thanks & regards,

jaanVivek

Hello,

 

I have made a trigger to update records from account to Opportunity but it doesn't work.

I think there is a problem in the mapping... I have looked into salesforce Force.com Apex code Developer Guide but I make no success..

Here is my trigger, hope someone can tell me how to correct it.. thanks

 

trigger UpdateAccountToOppty on Account (Before Insert, Before Update) {

    List<Account> accountWithOpptys = [SELECT id,Industry__c,Segment__c,Sub_Segment__c, (select id,accountId,RecordTypeId, Industry__c,Segment__c,Sub_Segment__c 
         from Opportunities  where accountId IN :Trigger.newMap.keySet() 
         AND Business_group__c='Amcor Flexibles Europe & Americas'
         ) 
         from Account where Id IN :Trigger.newMap.keySet()];
    
    //Loop through Accounts only once
    for(Account a : accountWithOpptys){
        
         //Loop through related Opportunities only once
         for(Opportunity o: a.Opportunities){
            if(o.RecordTypeId != '012200000002HdgAAE'){
                o.industry__c = a.industry__c;
                o.segment__c = a.segment__c;
                o.sub_segment__c = a.sub_segment__c;
            }
         }
    
   }

}

 

Hi

 

Is there any version control functionality in sfdc??

 

Amruta

I have a fully functioning cross object update trigger but my tests fail with:

 

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, UpdateAccountPartsSurveyDate: execution of AfterInsert caused by: System.QueryException: List has no rows for assignment to SObject Trigger.UpdateAccountPartsSurveyDate: line 6, column 1: 

 

The Trigger:

 

trigger UpdateAccountPartsSurveyDate on TIMBASURVEYS__Recipient__c (after update, after insert) {

Account myAccount = new Account();
TIMBASURVEYS__Recipient__c Recipient = trigger.new[0];

myAccount = [SELECT
Id
,Name
,Date_of_Last_Parts_Survey_Sent__c
FROM
Account
WHERE
Id = :Recipient.TIMBASURVEYS__RelatedAccount__c
];
// Truncate Date
Datetime dt = Recipient.TIMBASURVEYS__DateSendInvitation__c;
Date dateval = date.newInstance(dt.year(), dt.month(), dt.day());

if (myAccount.Date_of_Last_Parts_Survey_Sent__c == null || myAccount.Date_of_Last_Parts_Survey_Sent__c < dateval)
{
myAccount.Date_of_Last_Parts_Survey_Sent__c = dateval;
update myAccount;
}

}

 

The Test Class:

 

@isTest private class TestSurveyAcctDateTrigger {

static testMethod void TestSurveyAcctDateTrigger () {
Account account = new Account();
TIMBASURVEYS__Recipient__c recipient = new TIMBASURVEYS__Recipient__c();
recipient.Name = 'This is a trigger test';
recipient.TIMBASURVEYS__DateSendInvitation__c = date.PARSE('07/11/2012');
insert recipient;
}
}

Hi

 

i want to hide the salesforce provided Help link which is available in all pages.

especially i want  to hide th link in Relates list, for example"Open Activities Help" in Open Activities related list.

 

is there any option to hide this link by configuring Layouts or through profiles or any options for this?

 



 

Thank you for the Help..

I saw many threads about Force.IDE installations issues.   I think that for non-developer newbies (like myself),  it is more important to know which installations are working. (e.g which combination of Eclipse version and Force.com IDE plugin are compatible). So I'd like to share my experience

 

Here please find my installation procedure which was successful and smooth

 

1)      Install Eclipse Classics 3.7.2 (Indigo SR2) : here is the download page  http://www.eclipse.org/downloads/packages/eclipse-classic-372/indigosr2

 

2)      Install Force.com Plug in for  Eclipse 3.6:  please follow this instruction:   http://wiki.developerforce.com/page/Force.com_IDE_Installation_for_Eclipse_3.6

 

 

The above installations just installs folders with a bunch of files. You DON'T need Admin access to do the installation. But you need to make sure that you install it under a directory to which you have "full control" access. (e.g. "My Documents" folder).

 

If you have already installed other Eclipse version (e.g. Eclipse 4.2), you can either keep it or uninstall it (there is a uninstall directory under Eclipse folder. I could not recall the detailed path).  It is not a problem to have multiple Eclipse versions under the same machine.

 

 

(PS: I first tried Eclipse 4.2 with Force.com plug-in for Eclipse 3.6 and ended up with error related to missing component.  I tried various solutions mentioned in multiple threads but could not fix it)

 

Bing Maletz

  • September 30, 2012
  • Like
  • 0

While installing Force.com IDE in Eclipse Helios version, i'm getting below given error message.

 

Cannot complete the install because one or more required items could not be found.
Software being installed: Force.com IDE 25.0.0.201206181021 (com.salesforce.ide.feature.feature.group 25.0.0.201206181021)
Missing requirement: Force.com IDE Core 25.0.0.201206181021 (com.salesforce.ide.core 25.0.0.201206181021) requires 'package org.apache.log4j 0.0.0' but it could not be found
Cannot satisfy dependency:
From: Force.com IDE 25.0.0.201206181021 (com.salesforce.ide.feature.feature.group 25.0.0.201206181021)
To: com.salesforce.ide.core [25.0.0,26.0.0)

 

Please help me to fix this error and get installation done.

  • September 29, 2012
  • Like
  • 0

Hi Geeks,

        For adding multiple addresses to an Account we have created a custom object with all address field. By checking default we have a workflow which uupdates all the fields on Account Record.

 

Here our requirement is when there should be only one default checked.

 

Let say

1. Address 1 marked as default

2. Added new Address 2

So here when checked default on Address 2 1st we need to uncheck from Address1 and the workflow will be fired for field update on account record.

 

 

Thanks,

Karthik

Hi Every one,

 

I am facing below issue with trigger.Trigger is ment for the below functionality.

 

when I try to insert or update any record in one custom object(forecasting__c) and this insert/Update of record in Forecasting has to reflect in the another custom object called VP_Approval__c.

 

ERROR:

 

caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing.
Even if a field is indexed a filter might still not be selective when:
1. The filter value includes null (for instance binding with a list that contains null)
2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times)

Trigger.VPApprovalCreateUpdateValues: line 92, column 1

 

In line 92 I have the below query:

 

public List<aggregateResult> forecastListQ = [select  sum(Manager_s_Amount__c) ManagerAmount, sum(Sales_executive_Amount__c) SalesAmonut, sum(Pipeline_Amount_ThisMonth__c) PipelineMonthAmount, sum(Amount__c) amount, Branch1__c, Product_Family1__c, Target_for__c, Months__c, Quarter__c, CALENDAR_YEAR(Close_Date__c) year from Forecasting__c where (RecordTypeID =: RecordTypeIDvalue) and  Branch1__c IN :branchSet and Branch1__c != null and Product_Family1__c IN :prodFamilySet and Product_Family1__c != null and Target_For__c IN :targetForSet and Target_For__c != null and Quarter__c IN :quarterSet and Quarter__c != null and CALENDAR_YEAR(Close_Date__c) IN :yearset and (RecordTypeID =: RecordTypeIDvalue) group by Product_Family1__c, Branch1__c,Target_for__c,Months__c,Quarter__c, CALENDAR_YEAR(Close_Date__c)]; 

 

This problem I am getting when I have more than 50000 records.

 

Please some one sugget me to avoid this error.

 

Thanks in Advance.

 

Can any one please let me know when do we use list? when do we use map? when do we use set?

 

I'm bit confused regarding their usage.

  • September 13, 2012
  • Like
  • 0





public with sharing class CreateSPrintBacklogContExt_1 {

       public List<Backlog__c> sblogs {get; set;}

public final Sprint__c parSprint;     
       public  Request__c StartDate{get;set;}
       public  Request__c EndDate{get;set;}

 public CreateSPrintBacklogContExt_1(ApexPages.StandardController myController) {
    
     
       StartDate =  new Request__c();
       EndDate =  new Request__c();     
       parSprint=[Select ID,Name,Project__c,Release__c  from Sprint__c  WHERE ID = :((Sprint__c)myController.getrecord()).ID];           
       sblogs = new List<Backlog__c>();
       Backlog__c SBacklog = new Backlog__c();      
       SBacklog.Sprint__c = parSprint.Id;             
       sblogs.add(SBacklog);     


  public PageReference Insertbacklog() {
Insert sblogs;
PageReference parrec = new PageReference('/apex/CreateBacklogs?id={!Sprint__c.id}');
 parrec.setRedirect(true);
return parrec;
}





error :Id value {!Sprint__c.id} is not valid for the Sprint__c standard controller

i have developed One VF Page:

1.How to redirect the Same page after saving the record???
2.How to Implement Save & New Functionality ???

VF Page

<apex:page standardController="Work_Performed__c">
<apex:form >
        <apex:pageBlock title="Work performed">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="Save"/>
                 <apex:commandButton action="{!cancel}" value="Cancel"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Work Performed" columns="2" collapsible="true" dir="LTR" id="My">
                <apex:inputField value="{!Work_Performed__c.Note__c}"/>
                <apex:inputField rendered="false" value="{!Work_Performed__c.Case_Number__c}"/>
               
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

  • September 12, 2012
  • Like
  • 0

Im trying to create an email template, but would like to add a formula or something that will populate based on the time "Good "Afternoon" "Morning" based on the time the person is sending the email. Any ideas on how i could do this?

  • September 12, 2012
  • Like
  • 0

Hi!

 

Could please someone tell me how do I modify url in a tab with IF statment?

For instance, if formula = /apex/MyPage then it does work, but when i set it to IF(1=1,/apex/MyPage,/apex/MyPage) -- it doesn't. How would you modify the las statement to make it work?

 

I do NOT want to open VF page instead of url because:

In our tab we are opening an external url. Sometimes this url doesn't work (if a custom setting hasn' been created). So I'm trying to check if a custom setting exists first, and if it doesn't then I want to open a VF page saying 'go create custom settings record'.

 

Thanks in advance

I have upgraded my Java Eclipse install, and need to re-install the Force IDe plugin.. no problem done it a 100 times..

except I am getting this data error now.

on both version 25 and 24..

 

Problems downloading artifact: osgi.bundle,com.salesforce.ide.api,25.0.0.201206181021.
MD5 hash is not as expected. Expected: cfe2af79a543696580b0dc8120ae63ea and found 494430c70a7cfcd0c7e8dc4aa88a3860.
Problems downloading artifact: osgi.bundle,com.salesforce.ide.documentation,25.0.0.201206181021.
MD5 hash is not as expected. Expected: 314d2f02d4c7e63caaff7feff76dcd87 and found 56003a3e322c7c19e95a4f7761b6842a.

 

is there a problem with the package?

Hi,

I'm working in a recruitment application in which I have a Vacancy object.

I would like to broadcast the vacancy from the app to the user's LinkedIn network.

I want to know how to connect salesforce with linkedIn, and if possible also with twitter and facebook. I need some sample code or any help.

Thanks.

  • September 11, 2012
  • Like
  • 0

Hi guys.

 

I have batch calss name:Del_leads

and a Schedule Class bulkdelleads.

 

When i am writing test method for batch class it is not covering the execute method i am calling this execute from schedule class.Can any body help to figure out the problem.

 

Batch Class:-

=====================

global class Del_leads implements Database.Batchable<sobject>
{

public String query;
public date d=System.today();
public integer i=7;
Public Date z=d-i;
Public String s;
public integer j;
Public string k='Name'+','+'Company'+','+'phone'+','+'Email';

global Database.QueryLocator start(Database.BatchableContext BC){
system.debug(query);
return Database.getQueryLocator(query);

}

global void execute(Database.BatchableContext BC,List<Lead> Lds){
for( j=0;j<lds.size();j++){
if(j==0){
s +=k+'\n'+ lds[j].Name+','+lds[j].Company+','+lds[j].phone+','+lds[j].Email;
} else{
s +=+'\n'+ lds[j].Name+','+lds[j].Company+','+lds[j].phone+','+lds[j].Email;
}
}

Blob b=Blob.valueOf(s);
Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
efa.setFileName('attachment.csv');
efa.setBody(b);

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setToAddresses(new String[] {'franktoanil@gmail.com'});
mail.setSenderDisplayName('Batch Processing');
mail.setSubject('Batch Process Completed');
mail.setPlainTextBody('Please find the attachment of deleted records');
mail.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
delete Lds;
}

global void finish(Database.BatchableContext BC){
System.debug(LoggingLevel.WARN,'Deleting Leads Finished');
}

=====================================================
/*-----------------Test Method-----------------Only 47 % test coverage*/

=====================================================
public static testMethod void Del_leads (){
List <Lead> lds = new List<Lead>();
for(integer i = 0; i<200; i++){
Lead l = new Lead(LastName='Anil',Company='ef');
lds.add(l);
}
insert lds;

test.startTest();
Del_leads dl = new Del_Leads();
dl.query='select id,Name,Company,Phone,Email from lead where createddate<=:z and date_opened__c=null ';
ID batchprocessid = Database.executeBatch(dl);
test.stoptest();
System.AssertEquals(
database.countquery('SELECT COUNT()'+' FROM Lead '),200);
}
}

============================

Schedule Class

============================

global class bulkdelleads Implements Schedulable{
public static String CRON_EXP = '0 0 0 3 9 ? 2022';
global void Execute(SchedulableContext SC){

Del_leads ld=new Del_leads();
ld.query='select id,Name,Company,Phone,Email from lead where createddate<=:z and date_opened__c=null ';
database.executebatch(ld);

}

==================================

/*----------Test Method------------------ 100% test Coverage-*/

==================================
static testmethod void bulkdelleads () {
Test.startTest();

Lead l = new Lead ();
l.LastName = 'Raghu ';
l.company='eg';
insert l;

// Schedule the test job

String jobId = System.schedule('bulkdelleads ',bulkdelleads.CRON_EXP,new bulkdelleads ());
// Get the information from the CronTrigger API object

CronTrigger ct = [SELECT Id, CronExpression, TimesTriggered,
NextFireTime
FROM CronTrigger WHERE id = :jobId];

// Verify the expressions are the same

System.assertEquals(bulkdelleads.CRON_EXP,ct.CronExpression);

// Verify the job has not run

System.assertEquals(0, ct.TimesTriggered);

// Verify the next time the job will run

System.assertEquals('2022-09-03 00:00:00',
String.valueOf(ct.NextFireTime));

Test.stopTest(); 

}

}

 

Thanks

Anil.B

 

Hai All,

      I have small Doubt,

How to display Error message Under a Custom field(not SObject field) or item in Visualforce through Apex.

HI. Can anyone help me what mistake am I doing here. The problem is the trigger is inserting the record for twice.

 

How to stop it? 

 

trigger SalesOrder on Sales_Order__c (after update){

//delete savepoint
    Savepoint sp = Database.setSavepoint();
    
    List <Sales_Order_Status_History__c> sosh = new List<Sales_Order_Status_History__c>();
   if(Trigger.isUpdate){
        for(Sales_Order__c  so : Trigger.new){
            if(so.Sales_Order_Status__c == 'Order Acknowledgement' ||
               so.Sales_Order_Status__c == 'Customer Inputs' ||
               so.Sales_Order_Status__c == 'Scheduling'  ||
               so.Sales_Order_Status__c == 'Order Acceptance' ||
               so.Sales_Order_Status__c == 'Design Queue' ||
               so.Sales_Order_Status__c == 'Design' ||
               so.Sales_Order_Status__c == 'Punching/Bending Queue' ||
               so.Sales_Order_Status__c == 'Punching/Bending' ||
               so.Sales_Order_Status__c == 'Fabrication Queue' ||
               so.Sales_Order_Status__c == 'Fabrication' ||
               so.Sales_Order_Status__c == 'Customer Inspection' ||
               so.Sales_Order_Status__c == 'Powder Coating Queue' ||
               so.Sales_Order_Status__c == 'Pre-Treatment & Powder Coating' ||
               so.Sales_Order_Status__c == 'Assembly Queue' ||
               so.Sales_Order_Status__c == 'Assembly' ||
               so.Sales_Order_Status__c == 'Finished Goods Queue' ||
               so.Sales_Order_Status__c == 'Finished Goods' ||
               so.Sales_Order_Status__c == 'Pending Closure' ||
               so.Sales_Order_Status__c == 'Closed' ||
               so.Sales_Order_Status__c == 'Cancelled' ){
               
                   sosh.add(new Sales_Order_Status_History__c(Status__c = so.Sales_Order_Status__c, SO_No__c = so.Name,Record_Created_Date__c=so.createdDate,Last_Modified_Date__c=so.systemModStamp,Record_User__c=userinfo.getUserName()));   
            }


     
        }

 

//delete try-catch
        try {

            insert sosh;

        } catch (DmlException e) {
              Database.rollback(sp);
          }              
 }

Any ideas on how to fix this? Thanks.

 

Save error: Unable to perform save on all files: com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.internal.bind.v2.runtime.reflect.Accessor    **** line 1    Force.com save problem