• Mahesh S
  • NEWBIE
  • 0 Points
  • Member since 2016
  • Developer
  • Deloitte

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies

Hello Community,

Recently we have implemented the Email2Case and all the necessary steps are done properly, it works as expected.

So new req. is when the Case is created from Email2Case, OOTB will assign the Account and Contact feilds if the email exists in the Org. but we want to update fews fields(editable by users) on Case object based Account info. 

when I implemented it in Before Insert Trigger on Case obj. it does NOT really updates the fields. 

so trying to understand the Flow of creation if records. when the SF receive Email from "abcd123@test.com". will it create EmailMessgase record first or Case record first. 

 

this is in BeforeInsert Case Trigger 
public static void updateCaseAcc(List<Case> caseList){
        
        Map<Id, Id> mapAccIds = new Map<Id, Id>();
        for(case e2case : caseList){
            if(e2case.RecordTypeId == e2case_RT && !mapAccIds.containsKey(e2case.Id)){
                mapAccIds.put(e2case.Id, e2case.ContactId);

        }}
        system.debug('Map2'+mapAccIds); //it shows Null=003Au00000mXXXIX0
        
        Map<Id, Account> AccDetails = new Map<Id, Account>([
            SELECT phone, BillingStateCode 
            FROM Account 
            WHERE Id IN (select AccountId from Contact where Id IN :mapAccIds.values())               
        ]);
        
        for(case updateCase: caseList){
            Account acc = AccDetails.get(updateCase.AccountId);
            if(String.isNotBlank(updateCase.AccountId) ){
                updateCase.state__c = acc.BillingStateCode;
                updateCase.mobile__c =  acc.Phone;

            }
        }
    }
 

anyone's help would highly appreciated and thank you in advance!!
 

Hello LWC experts, 

I'm facing issue display the Apex controller result in LWC. so i want to display in the form of dropdown list in my LWC. can someone please help with this and Thank you in Advacnce 

Apex: 

    @AuraEnabled(cacheable=true)
    public static List<InsurancePolicyParticipant> showOnlyBDIpolicy(string AccountId){
        return [SELECT Id, InsurancePolicy.Name FROM InsurancePolicyParticipant
                    WHERE PrimaryParticipantAccountId =: clientId];
    }


JS file:

    get productNumberOptions(){
        console.log('***  '+JSON.stringify(this.productOptions))
        return this.productOptions;
    }

    handleProductChange(event){
        this.productNumber = event.detail.value;
    }
    @wire(displayBDIpolicy, {AccountId: '$recordId'} )
    wiredBDIpolicy({error, data}){
        if(data){
            console.log('$$$$  '+JSON.stringify(data))
            for(let i = 0; i < data.length; i++){
                this.productOptions.push({ label: data[i].InsurancePolicy.Name, value: data[i].Id });
            }
            console.log(JSON.stringify(this.productOptions));
        }
        if(error){
            console.log(error);
            showToast(this, 'error', error);
            }
    }

HTML file:

                <lightning-layout-item size="4" padding="around-small" >
                    <lightning-combobox label={LABEL.PRODUCTNUMBER} placeholder={LABEL.PRODUCTNUMBER} value="NAmnea 231e" options={productNumberOptions} required onchange={handleProductChange}></lightning-combobox>
                </lightning-layout-item>

 

User-added image

I have Managed package Object(PDF) and new SOD suggested to make OWD of the PDF obj to Private and create  sharing rules on PDF  obj. 
we dont have RecordType in the Obj. 

my Opinion is create sharing rules with Owner based criteria( cause Roles and sub's should see their  old PDF records)

is it right process to proceed?
 
I'm looking through my event logs for calls to soon to be deprecated API versions. I have a list of calls and it shows the CONNECTED_APP_ID making these calls. How do I find the Connected App in my system that has that ID?
Hiya,

Just trying to create a process automation that sends an email alert when it's two weeks before a date of birth.

Can anyone help?
i am getting following error

***Challenge Not yet complete... here's what's wrong: 
We can’t find your solution for users to report on custom objects named “SolarBots and Status Data,” or it's not stored in the correct place.***

for this i have created solution and assigned category other reports to it 

please let me know any other inputs you want from my side