• Vinu Varghese
  • NEWBIE
  • 30 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 8
    Replies
I have a Flow Pause in Partner Community. When I resume the flow, it runs in a small window instead of a full Window. How do I fix this issue. Thanks for your help
How to get the next SlNo after the following query. Suppose the following query returns value 0 and I wanted to added 1 to the SlNo to find the next SlNo. How can I achieve this. What is the best way to do this. Please note that Serial_Number_Counter__c is defined as a Rollup summary.

List<AggregateResult> SlNo = [Select Name, max(Serial_Number_Counter__c) from Deposit__c group by name];

Thanks
I have the following select statement, but it giving me error. When I query seperately it works. I tried under query editor also. Same error.

List<Deposit_Detail__c> depositDetailList = [Select Deposit__r.Name,  Id,Amount__c, Member_Name__c from Deposit_Detail__c Where Id IN :trigger.new];

please help me.

Thanks

 
I wanted to create a trigger which pass trigger.new to  class where it perform some validation. But my poblem here is I wanted to use the same Class for other objects's trigger too. example I have an Account trigger which pass trigger new to a class called Validation Class with the following :
Public class validationClass {
   Public static void validation(List<Account> triggerList){ }

I would like to use the same class for Contact Object too. i.e.
    Public static void validation(List<Contact> triggerList){ }

Is there any way I can pass Object Name as variable?
I am a Salesforce Certified Administrator and Salesforce Certified Platform Developer 1. I have 1 year experience as a Administrator cum Developer. Open for a new position. Any help would be appreciated.
I am having difficulty for the following:

I have a workflow rule for inserting a record. I also have a Before Insert and After insert trigger on the same object.

When I insert a record, how many times the trigger fire? I know that the order of execution as Before Insert, Validation , After Insert, .... workflow rule etc.

I think the trigger fire initially 2 times (before and after trigger) then after workflow rule again 2 more times (before and after trigger). total 4 times. Is that right? 
Given Map<Id, Account> accountMap = new Map<Id, Account> {[SELECT Id, Name FROM Account]}; What are three valid Apex loop structures for iterating items in the collection?
Choose 3 answers
a.       For(ID accountId : accountMap.keySet()) {--}
b.      For(Account accountRecord : accountMap.value()) {--}
c.       For( Integer i=0; i< accountMap.size(); i++) {--}
d.      For(ID accountId : accountMap) {--}
e.      For(Account accountRecord : accountMap.keySet()) {--}

I think A,B,C
I have the following error after deleting a record.  Insert and Update are OK. but deleting the record giving the following error. 
Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details. The requested resource does not exist

trigger InvoiceTotal on Invoice_Item__c (after insert, after update, after delete) {

    set<ID> setId = new set<ID>();
    List<invoice__c> lstInvoice = new List<invoice__c>();
           
    If (!trigger.isdelete) {
    for(Invoice_Item__c fndId :trigger.new){
        setId.add(fndId.invoice__c);
   
    decimal Totamount = 0;
    for(invoice__c parentInvoice :[select id, name, invoice_no__c, (select id, invoice__c, Total_Price__c, name  from invoice_Items__r) from Invoice__c where id in :setId]){
        Invoice__c Inv = new Invoice__c();
        Inv.id = parentInvoice.id;
        For(Invoice_Item__c item :parentInvoice.invoice_items__r){
            Inv.Total_amount__c =item.Total_Price__c;
            Totamount = Totamount + Inv.Total_amount__c;
            Inv.Total_amount__c = Totamount;
        }
            system.debug('Total  Amount of this Invoice = '+Totamount);
           lstInvoice.add(Inv);
    }
    }
    }
    Else if(trigger.isdelete){
        for(Invoice_Item__c fndId :trigger.old){
                setId.add(fndId.invoice__c);
            system.debug('Total price deleted 1 :'+fndId.invoice__c+'---'+fndId.Total_Price__c);
        decimal Totamount = 0;
            Invoice__c lstInvoice = [Select Total_amount__c from Invoice__c where id in :setId];
            lstInvoice.Total_Amount__c = lstInvoice.Total_Amount__c - fndId.Total_Price__c;
            system.debug('Previous Total Amount should be updated :'+lstInvoice.Total_Amount__c);
           
            system.debug('Total price deleted  2 :'+fndId.invoice__c+'---'+fndId.Total_Price__c);
            update lstInvoice;
        }
       
    }
    If (!trigger.isdelete){

            update lstInvoice;
    }
}



 
trigger InvoiceTotal on Invoice_Item__c (after insert, after update) {
    set<ID> setId = new set<ID>();
    List<invoice__c> lstInvoice = new List<invoice__c>();
    
    for(Invoice_Item__c fndId :trigger.new){
        setId.add(fndId.invoice__c);
    }
    
    for(invoice__c parentInvoice :[select id, name, invoice_no__c, (select id, invoice__c, Total_Price__c, name  from Invoice_Item__c) from Invoice__c where Invoice__c.id in :setId]){
        Invoice__c Inv = new Invoice__c();
        inv.id = parentInvoice.id;
        inv.Total_amount__c =parentInvoice.Total_price__c;
        lstInvoice.add(inv);
    }
    update lstInvoice;
}
I have a Flow Pause in Partner Community. When I resume the flow, it runs in a small window instead of a full Window. How do I fix this issue. Thanks for your help
I have the following select statement, but it giving me error. When I query seperately it works. I tried under query editor also. Same error.

List<Deposit_Detail__c> depositDetailList = [Select Deposit__r.Name,  Id,Amount__c, Member_Name__c from Deposit_Detail__c Where Id IN :trigger.new];

please help me.

Thanks

 
I have the following error after deleting a record.  Insert and Update are OK. but deleting the record giving the following error. 
Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details. The requested resource does not exist

trigger InvoiceTotal on Invoice_Item__c (after insert, after update, after delete) {

    set<ID> setId = new set<ID>();
    List<invoice__c> lstInvoice = new List<invoice__c>();
           
    If (!trigger.isdelete) {
    for(Invoice_Item__c fndId :trigger.new){
        setId.add(fndId.invoice__c);
   
    decimal Totamount = 0;
    for(invoice__c parentInvoice :[select id, name, invoice_no__c, (select id, invoice__c, Total_Price__c, name  from invoice_Items__r) from Invoice__c where id in :setId]){
        Invoice__c Inv = new Invoice__c();
        Inv.id = parentInvoice.id;
        For(Invoice_Item__c item :parentInvoice.invoice_items__r){
            Inv.Total_amount__c =item.Total_Price__c;
            Totamount = Totamount + Inv.Total_amount__c;
            Inv.Total_amount__c = Totamount;
        }
            system.debug('Total  Amount of this Invoice = '+Totamount);
           lstInvoice.add(Inv);
    }
    }
    }
    Else if(trigger.isdelete){
        for(Invoice_Item__c fndId :trigger.old){
                setId.add(fndId.invoice__c);
            system.debug('Total price deleted 1 :'+fndId.invoice__c+'---'+fndId.Total_Price__c);
        decimal Totamount = 0;
            Invoice__c lstInvoice = [Select Total_amount__c from Invoice__c where id in :setId];
            lstInvoice.Total_Amount__c = lstInvoice.Total_Amount__c - fndId.Total_Price__c;
            system.debug('Previous Total Amount should be updated :'+lstInvoice.Total_Amount__c);
           
            system.debug('Total price deleted  2 :'+fndId.invoice__c+'---'+fndId.Total_Price__c);
            update lstInvoice;
        }
       
    }
    If (!trigger.isdelete){

            update lstInvoice;
    }
}



 
trigger InvoiceTotal on Invoice_Item__c (after insert, after update) {
    set<ID> setId = new set<ID>();
    List<invoice__c> lstInvoice = new List<invoice__c>();
    
    for(Invoice_Item__c fndId :trigger.new){
        setId.add(fndId.invoice__c);
    }
    
    for(invoice__c parentInvoice :[select id, name, invoice_no__c, (select id, invoice__c, Total_Price__c, name  from Invoice_Item__c) from Invoice__c where Invoice__c.id in :setId]){
        Invoice__c Inv = new Invoice__c();
        inv.id = parentInvoice.id;
        inv.Total_amount__c =parentInvoice.Total_price__c;
        lstInvoice.add(inv);
    }
    update lstInvoice;
}