• Miranda L 2
  • NEWBIE
  • 5 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 7
    Replies
I have created report so I want to calculate revenue. How could I calculate in report.
Hello there,
I am creating report which I want to take value from Other recordType for example 
Custom Object has Transaction__c Look field and Transaction__c Object has 3 RecordType 
1/ Order
2/ Trading
3/Finish
Our invoice get connected with Transaction__c Order Record type of the ID so I am unable to take value in the report for Trading Report type.
Could you pelase suggest me. How can I create formula or something in the report to take value from Transaction__c object other report type.
Thanks
Hello there,
I am getting following error while sending the data from third party
"error":{"code":"CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY","message":"accountTrigge: execution of BeforeInsert\n\ncaused by: System.NullPointerException: Attempt to de-reference a null object\n\nClass.TriggerAccount.calculateTime: line 23, column 1\nClass.TriggerAccount.handle: line 12, column 1\nClass.Triggers.manage: line 51, column 1\nTrigger.accountTrigger: line 53, column 1"

Please guide me
 
Hello there,
How to create validation which should not display themself as their manager or some lines of code to not to display them or ignore them to display themself as their own manager.
Please guide
1. Is it possible to fetch all the picklist field names along with the picklist field values available in Salesforce? Is there any object available in salesforce to query picklist values? Eg: Select Name From Picklist_Table__c ?
 
2. Using SOQL query is it possible to fetch the picklist values through R-language query? 
Hello there,
We have custom buttons in custom objects which is placed in classic through page layout but those buttons not visible into lightning. Is there have any possible reasons.
Thanks
Hello there,
someone from our Salesforce org click on the lightning so my organization switched to lightnig but they do not want to shift to the lightning. How could I back to Classic without telling them to click on classic and disable lightning.
Thanks
I am having implementation Custom  object where I am using edit,Delete,Clone and Submit for Approval buttons for view links and button "No override (use default)".
For the edit button I am overriding vf page and for the new button I am overriding my vf page as well but I am not able to use for the view detail page inline edit. Could anyone help me.
1. View No override (use default)
User-added image

2. Edit Overriding with vf page
User-added image
Hello there,
I have a custom object called Revenue has lookup relation with  => Contract, it  has lookup relationship with => Opportunity, so  I want to find Opportunity owner please let me know, can we achieve with formula
Thanks
Hello there,
Please help me to fix this error. My records not updating.

Apex script unhandled exception by user/organization: 0051X0000018hKG/00D1X0000008akn
Source organization: 00Db0000000HO6N (null)
Failed to process batch for class 'AllTimeRevenueAndYtDRevenueBatch' for job id '7071X00000FepEJ'

caused by: System.LimitException: Too many query rows: 50001

Class.AllTimeRevenueAndYtDRevenueBatch.execute: line 23, column 1
global class AllTimeRevenueAndYtDRevenueBatch implements Database.Batchable<sObject>,Database.Stateful,Schedulable {
global Decimal sum;
    public list<Account> oldInvoicesToUpdate = new list<Account>();
    public list<Account> invToUpdate = new list<Account>();
    public Set<ID> newEntitiesIds = new Set<ID>();
    global AllTimeRevenueAndYtDRevenueBatch(){}
        /* Batch class constructor */
    //Start method
    global Database.QueryLocator start(Database.BatchableContext BC)
    {
        //String query='SELECT id, Amount from Opportunity';
         String query='SELECT id, Normalized_Amount__c,Account__c from Invoice__c';
         return Database.getQueryLocator(query);
        }

    //Excute method
    
global void execute(Database.BatchableContext BC, List<Invoice__c> scope)
{
    //Excution logic
    //List<Opportunity> opp= new List<Opportunities>();
    //AggregateResult[] gr= [SELECT SUM(Amount) optyamt FROM Opportunity];
    AggregateResult[] gr= [SELECT SUM(Normalized_Amount__c) NormalizeAmount,Grouping(Account__c), Account__c
                                 FROM Invoice__c
                                 WHERE Category_Invoice__c != 'Monthly' AND Status__c != 'invoice_canceled' 
                                 GROUP BY Account__c];
    
    for(AggregateResult ag:gr){
          if((ID)ag.get('Account__c') != null){
                                         invToUpdate.add(new Account (
                                             ID = (ID)ag.get('Account__c'),
                                             //YtD_Revenue_for_Kantox__c = (Double)ag.get('NormalizeAmount'),
                                             AllTimeRevenueKantox__c = (Double)ag.get('NormalizeAmount')
                                             
                                         ));
                                     }
        
        //sum = (Decimal)ag.get('optyamt');
         
    }
    try{
            if(!invToUpdate.isEmpty()){
                update invToUpdate;
            }
        } catch(DmlException e) {
            System.debug('The following exception has occurred: ' + e.getMessage());
        }
    
}
      global void finish(Database.BatchableContext BC){
            // Finish logic
          system.debug(''+sum); 
       }
    public void execute(SchedulableContext Sc) {
        AllTimeRevenueAndYtDRevenueBatch batch = new AllTimeRevenueAndYtDRevenueBatch();
        Database.executeBatch(batch);    
    }
}

 
I need help to improve my code because in this method I am getting Nullpointerexception please suggest me
private void storeData(){
        Map<ID,Invoice__c> newInvoices = (Map<ID,Invoice__c>) Trigger.newMap;
  
        for(Invoice__c i: newInvoices.Values()){
            newEntitiesIds.add(i.Account__c);
        }
        
        if(Trigger.isUpdate){
            for(Invoice__c i: (List<Invoice__c>) Trigger.Old){
                if(i.Account__c != newInvoices.get(i.id).Account__c){
                    oldEntitiesIds.add(i.Account__c);
                }
            }
        }
           
        
    }

 
HI,
I need help to cover following code into my test class
User-added imageUser-added imageUser-added image
Hello folks, Third party sending data to SF and but some fields are missing. 
input as below {:eName=>"Account", :records=>[{:profiles_reference=>"AYzDyW6D2I", :
but third party shows its 200 success message but sync is missing. 
I am getting Webservice response
salesforce resp {"statusCode"=>200, "status"=>"Success", "recordReferences"=>[], "errors"=>[]}

 
Hello there,
How to create validation which should not display themself as their manager or some lines of code to not to display them or ignore them to display themself as their own manager.
Please guide
1. Is it possible to fetch all the picklist field names along with the picklist field values available in Salesforce? Is there any object available in salesforce to query picklist values? Eg: Select Name From Picklist_Table__c ?
 
2. Using SOQL query is it possible to fetch the picklist values through R-language query? 
Hello there,
Please help me to fix this error. My records not updating.

Apex script unhandled exception by user/organization: 0051X0000018hKG/00D1X0000008akn
Source organization: 00Db0000000HO6N (null)
Failed to process batch for class 'AllTimeRevenueAndYtDRevenueBatch' for job id '7071X00000FepEJ'

caused by: System.LimitException: Too many query rows: 50001

Class.AllTimeRevenueAndYtDRevenueBatch.execute: line 23, column 1
global class AllTimeRevenueAndYtDRevenueBatch implements Database.Batchable<sObject>,Database.Stateful,Schedulable {
global Decimal sum;
    public list<Account> oldInvoicesToUpdate = new list<Account>();
    public list<Account> invToUpdate = new list<Account>();
    public Set<ID> newEntitiesIds = new Set<ID>();
    global AllTimeRevenueAndYtDRevenueBatch(){}
        /* Batch class constructor */
    //Start method
    global Database.QueryLocator start(Database.BatchableContext BC)
    {
        //String query='SELECT id, Amount from Opportunity';
         String query='SELECT id, Normalized_Amount__c,Account__c from Invoice__c';
         return Database.getQueryLocator(query);
        }

    //Excute method
    
global void execute(Database.BatchableContext BC, List<Invoice__c> scope)
{
    //Excution logic
    //List<Opportunity> opp= new List<Opportunities>();
    //AggregateResult[] gr= [SELECT SUM(Amount) optyamt FROM Opportunity];
    AggregateResult[] gr= [SELECT SUM(Normalized_Amount__c) NormalizeAmount,Grouping(Account__c), Account__c
                                 FROM Invoice__c
                                 WHERE Category_Invoice__c != 'Monthly' AND Status__c != 'invoice_canceled' 
                                 GROUP BY Account__c];
    
    for(AggregateResult ag:gr){
          if((ID)ag.get('Account__c') != null){
                                         invToUpdate.add(new Account (
                                             ID = (ID)ag.get('Account__c'),
                                             //YtD_Revenue_for_Kantox__c = (Double)ag.get('NormalizeAmount'),
                                             AllTimeRevenueKantox__c = (Double)ag.get('NormalizeAmount')
                                             
                                         ));
                                     }
        
        //sum = (Decimal)ag.get('optyamt');
         
    }
    try{
            if(!invToUpdate.isEmpty()){
                update invToUpdate;
            }
        } catch(DmlException e) {
            System.debug('The following exception has occurred: ' + e.getMessage());
        }
    
}
      global void finish(Database.BatchableContext BC){
            // Finish logic
          system.debug(''+sum); 
       }
    public void execute(SchedulableContext Sc) {
        AllTimeRevenueAndYtDRevenueBatch batch = new AllTimeRevenueAndYtDRevenueBatch();
        Database.executeBatch(batch);    
    }
}

 
I need help to improve my code because in this method I am getting Nullpointerexception please suggest me
private void storeData(){
        Map<ID,Invoice__c> newInvoices = (Map<ID,Invoice__c>) Trigger.newMap;
  
        for(Invoice__c i: newInvoices.Values()){
            newEntitiesIds.add(i.Account__c);
        }
        
        if(Trigger.isUpdate){
            for(Invoice__c i: (List<Invoice__c>) Trigger.Old){
                if(i.Account__c != newInvoices.get(i.id).Account__c){
                    oldEntitiesIds.add(i.Account__c);
                }
            }
        }
           
        
    }

 
I have a Contact(Parent) and Prorgam Enrollment(Child). 

A contact can have multiple Program Enrollments. There is a date field on the Program Enrollment. 
For example, If a contact has 4 Program Enrollments and if I update the date field in One Program Enrollment, the same date should be updated in the other program enrollments too?? 

Can I achieve this through workflow rules? or process builder with out any code?


I appreciate your time and Help!