• Saad J 5
  • NEWBIE
  • 25 Points
  • Member since 2020

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
trigger AccountCustomerDetail on Customer_Detail__c (before insert) {
    set<id>accountId = new set<id>();
    for(Customer_Detail__c customer : trigger.new){
        accountId.add(customer.id);
    }
List<Account> acclist = [Select id,BillingStreet,BillingCity from Account 
                        where id in: accountId];
    Map<id,Account>accMap = new Map<id,Account>();
    for(Account acc: trigger.new){
        accMap.put(acc.id, acc);
    }
    for(Customer_Detail__c customer : Trigger.new){
        customer.APShipping_Street__c = accMap.get(customer.Id).BillingStreet;
        customer.AP_Shipping_City__c = accMap.get(customer.Id).BillingCity;
    }
}

Err is  Line 9 Invalid loop variable type expected Customer_Detail__c was Account. Please help me to solve this.
trigger AccountCustomerDetail on Customer_Detail__c (before insert) {
    set<id>accountId = new set<id>();
    for(Customer_Detail__c customer : trigger.new){
        accountId.add(customer.id);
    }
List<Account> acclist = [Select id,BillingStreet,BillingCity from Account 
                        where id in: accountId];
    Map<id,Account>accMap = new Map<id,Account>();
    for(Account acc: trigger.new){
        accMap.put(acc.id, acc);
    }
    for(Customer_Detail__c customer : Trigger.new){
        customer.APShipping_Street__c = accMap.get(customer.Id).BillingStreet;
        customer.AP_Shipping_City__c = accMap.get(customer.Id).BillingCity;
    }
}

Err is  Line 9 Invalid loop variable type expected Customer_Detail__c was Account. Please help me to solve this.
Can anyone help me out in creating a LWC component where I want to show group of case records based on Status Picklist.

On datatable, I want to show Cases which are active and inactive, under active I want to show all cases which are active and under inactive I want to show all cases which are inactive.

for example

ACTIVE
CASE1
CASE2
CASE3

Inactive
Case100
Case101
Case103

Active and Inactive are picklist values on case object under Status__c field
I would like to rank my result !
Rank1 for the highter amount value
Rank2 for an other value
Rank3 and so on