• Manish Kumar 23
  • NEWBIE
  • 20 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 43
    Replies
We need a functionality of email to attachement in SFDC.
on email from users with attachment , it should attach under notes and attcahment under record of ABC object

 
Hi All,
I am using below formula to calculate SLA: It will take only working hours i.e from 10:00 to 19:00 , It will exculde Sunday . THis formula is working for all condition excet one: When I am giving  date and time before working hrs, the output SLA field is showing 9 hrs i.e worng it should show 0 hrs.
Refer below example
Date_2__c  as 12/25/2018 7:00  and Date_1__c 12/25/2018 9:00 
SLA calculation -9 Hrs( Which is wrong it should give 0 as output)
Can you please help me in resolving this issue

Below Formula I am using for calculation of SLA 
9 *( (6*FLOOR(( DATEVALUE( IF(ISNULL(Date_1__c), NOW(), Date_1__c) ) -DATE(1996,01,01))/7) 
        +
        MIN(6, 
        MOD(DATEVALUE( IF(ISNULL(Date_1__c), NOW(), Date_1__c) )-DATE(1996,01,01), 7) +
        MIN(1, 24/ 9 *(MOD( IF(ISNULL(Date_1__c), NOW(), Date_1__c) -DATETIMEVALUE('1996-01-01 04:30:00'), 1)))
        ))
        -
        (6*FLOOR((DATEVALUE( Date_2__c + MAX(DATETIMEVALUE(TEXT(DATEVALUE(Date_2__c)) & " 04:30:00") - Date_2__c,0) )-DATE(1996,01,01))/7) +
        MIN(6, 
        MOD(DATEVALUE( Date_2__c + MAX(DATETIMEVALUE(TEXT(DATEVALUE(Date_2__c)) & " 04:30:00") - Date_2__c,0) )-DATE(1996,01,01), 7) +
        MIN(1, 24/ 9 *(MOD( Date_2__c + MAX(DATETIMEVALUE(TEXT(DATEVALUE(Date_2__c)) & " 04:30:00") - Date_2__c,0) -DATETIMEVALUE('1996-01-01 04:30:00'), 1)))))
         )
Hi All,

I want to create a query that should include approval history information 

I should include Action,date,status,Assigned to,Actual Aproval,Comments and overall status details.

Can you all help me in generating this query.

Attached is the snapshot for your referenceUser-added image 

Regards,
Manish 
Hi All,
I want to fetch below information in my query can you please help me in acheving it.
User-added image
Can we deploy Inactive Class and Inactive Trigger in SFDC?
Hi All, 

When I am trying to Deleted Class from Production I am getting error

Average test coverage accross all apex classes and trigger is 58% at least 75% test coverage is required. Please see below snapshot User-added image
Hi All,

I was trying to delete Test Class, Apex Class in production instance,I followed below steps:

1. Install Force.com IDE.
2. Connect to the Sandbox Instance using IDE and find the class or trigger that you want to delete.
3. Open the matching .xml file, and change the Status XML tag from Active to Deleted. 
4. Or to disable the trigger change it to Inactive.
NOTE: Apex class Status can only be changed to "Active" or "Deleted," not "Inactive".
5. Save the file.
6. Select the two files (Code and XML) using "Ctrl-click," and then right-click on one of them.
7. Select Force.com | Deploy to server.
8. Provide your credentials for the Production org and follow the steps.

Now the proble is when I am trying to deploy the changes in Production, I am geeting faliour message saying that more than one problem occure, Can you please help me in resolving this?

User-added image
I am geeting below error when I am doing an  intgration with SFDC with other application. Can any body knows why I am getting this error
Error Details(StackTrace):
   at Salesforce.Common.ServiceHttpClient.<HttpPostAsync>d__1f`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
I have arround 5 to 6 class that is requited to be deleted in Production instance. for deleting a class I have installed IDE Ecllips and updated xml file with "Deleted" ansd then save to server. 
But unfortunalty I am geeting that code is save locally. and the changes are not refelecting in production instance
User-added image

Hi All,
Why the values are repeating. I dont want to repeat the value in report. Is there any way to do so
I Need to flow email to manager of opportunity owner ,when ever a opportunitystage(Stage1, Stage 2,Stage 3, Stage 4) is changed by opportunity owner (Ravi, Raj,Shyam and mohan).Mangare for all these 4 user are same.
User-added image
I have used below concept but email is flowing only once.
Is there any way by which set of user  automatically assigned on the Opportunity Team based on which India state that the account belongs to. If instead they are assigned on the Account team based on the India State that the account is in, can the opportunity team inherit that from the account team?
Hi All,

I am using Enterprise Edition and there is a limlitation of (200,000 max)API Requests, Last 24 Hours
they are calculating based on user licence i.e 100*200=200,000 .
Is there any way of increasing my API limit??
Hi All,

Can we use split  Java script functionality in salesforce.
My requirnment is if are entering Account name as Abc Itd.
then using split functionality it should take Abc limited as account name.
Hi All,

I have written a trigger for duplicate lead check.
When I am writting a test class I am getting only 66% of code coverage. Can you please help me

Below is the trigger for your reference.


trigger leadDuplicatePreventer on Lead
                               (before insert, after update) {

    Map<String, Lead> leadMap = new Map<String, Lead>();
    for (Lead lead : System.Trigger.new) {
       
        // Make sure we don't treat an email address that 
        // isn't changing during an update as a duplicate. 
   
        if ((lead.Email != null) &&
                (System.Trigger.isInsert ||
                (lead.Email !=
                    System.Trigger.oldMap.get(lead.Id).Email))) {
       
            // Make sure another new lead isn't also a duplicate 
   
            if (leadMap.containsKey(lead.Email)) {
                lead.Email.addError('Another new lead has the '
                                    + 'same email address.');
            } else {
                leadMap.put(lead.Email, lead);
            }
       }
    }
   
    // Using a single database query, find all the leads in 
   
    // the database that have the same email address as any 
   
    // of the leads being inserted or updated. 
   
    for (Lead lead : [SELECT Email FROM Lead
                      WHERE Email IN :leadMap.KeySet()]) {
        Lead newLead = leadMap.get(lead.Email);
        newLead.Email.addError('A lead with this email '
                               + 'address already exists.');
    }
}
Hi All,

I have written a trigger to check the duplicate name of account:

trigger accountDuplicatePreventer on Account
                               (before insert, before update) {

    Map<String, Account> accountMap = new Map<String, Account>();
    for (Account account : System.Trigger.new) {
       
        // Make sure we don't treat an Name that 
        // isn't changing during an update as a duplicate. 
   
        if ((account.Name != null) &&
                (System.Trigger.isInsert ||
                (account.Name !=
                    System.Trigger.oldMap.get(account.Id).Name))) {
       
            // Make sure another new account isn't also a duplicate 
   
            if (accountMap.containsKey(account.Name)) {
                account.Name.addError('Another new account has the '
                                    + 'same Name.');
            } else {
                accountMap.put(account.Name, account);
            }
       }
    }
   
    // Using a single database query, find all the accounts in 
   
    // the database that have the same Name  as any 
   
    // of the accounts being inserted or updated. 
   
    for (Account account : [SELECT Name FROM Account
                      WHERE Name IN :accountMap.KeySet()]) {
        Account newAccount = accountMap.get(account.Name);
        newAccount.Name.addError('A account with this Name '
                               + 'already exists.');
    }
}



now problem is I am getting"Developer script exception from Gmail : accountDuplicatePreventer : accountDuplicatePreventer: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object Trigger.accountDuplicatePreventer: line 35, column 1"

I already have account name-"Manish compnay"
Now I want to insert  another account name-"manish company"

In this case I am geeting above error.
Request your help.
I wanted to created report using Visual force and Apex .To start with this can i get  few samle repot,bulit using Visual force and Apex.So that I can learn and develope more reports .Because there are few functionality not avilabe with Standard reporting like matrix report.

Awaiting your reply
Hi All,

I have written a trigger to insert a line item in child object(Top Account)  when Top_account__c custom field is checked in account object.

The below trigger is working fine for the the account   that is ceated now and updated now .

Fow few of the account which is already exist in system and when we are updating that account with Top_account__c custom field is checked .

I am geeting two line item when I am checking Top_account__c custom field is checked .

Below is the trigger.Request your help in resolving the issue


trigger Topaccount on Account(After insert, after update) {
  List<Top_Account__c> newTop = new List<Top_Account__c>();
  for (Account acc : Trigger.new) {
  if ((trigger.isInsert || acc.Top_Account__c != trigger.oldMap.get(acc.Id).Top_Account__c) && acc.Top_Account__c == True)
  {
    Top_Account__c tp = new Top_Account__c();
    tp.Name = acc.Name;
    tp.releted_acc__c = acc.Id; // Use the trigger record's ID
    newTop .add(tp);
  }
  }
  insert newTop ;
  }
Hi All,

I am new to the trigger 

I wanted to write a trigger which will delete a related record in custom object
when there is checkbox uncheck in parent object

Regards,
Manish Tiwary
Can we deploy Inactive Class and Inactive Trigger in SFDC?
Hi All, 

When I am trying to Deleted Class from Production I am getting error

Average test coverage accross all apex classes and trigger is 58% at least 75% test coverage is required. Please see below snapshot User-added image
I have arround 5 to 6 class that is requited to be deleted in Production instance. for deleting a class I have installed IDE Ecllips and updated xml file with "Deleted" ansd then save to server. 
But unfortunalty I am geeting that code is save locally. and the changes are not refelecting in production instance
User-added image

Hi All,
Why the values are repeating. I dont want to repeat the value in report. Is there any way to do so
I Need to flow email to manager of opportunity owner ,when ever a opportunitystage(Stage1, Stage 2,Stage 3, Stage 4) is changed by opportunity owner (Ravi, Raj,Shyam and mohan).Mangare for all these 4 user are same.
User-added image
I have used below concept but email is flowing only once.
Hi All,

I am using Enterprise Edition and there is a limlitation of (200,000 max)API Requests, Last 24 Hours
they are calculating based on user licence i.e 100*200=200,000 .
Is there any way of increasing my API limit??
Hi All,

Can we use split  Java script functionality in salesforce.
My requirnment is if are entering Account name as Abc Itd.
then using split functionality it should take Abc limited as account name.
Hi All,

I have written a trigger for duplicate lead check.
When I am writting a test class I am getting only 66% of code coverage. Can you please help me

Below is the trigger for your reference.


trigger leadDuplicatePreventer on Lead
                               (before insert, after update) {

    Map<String, Lead> leadMap = new Map<String, Lead>();
    for (Lead lead : System.Trigger.new) {
       
        // Make sure we don't treat an email address that 
        // isn't changing during an update as a duplicate. 
   
        if ((lead.Email != null) &&
                (System.Trigger.isInsert ||
                (lead.Email !=
                    System.Trigger.oldMap.get(lead.Id).Email))) {
       
            // Make sure another new lead isn't also a duplicate 
   
            if (leadMap.containsKey(lead.Email)) {
                lead.Email.addError('Another new lead has the '
                                    + 'same email address.');
            } else {
                leadMap.put(lead.Email, lead);
            }
       }
    }
   
    // Using a single database query, find all the leads in 
   
    // the database that have the same email address as any 
   
    // of the leads being inserted or updated. 
   
    for (Lead lead : [SELECT Email FROM Lead
                      WHERE Email IN :leadMap.KeySet()]) {
        Lead newLead = leadMap.get(lead.Email);
        newLead.Email.addError('A lead with this email '
                               + 'address already exists.');
    }
}