• Padmaja
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies
Hi All,
I have to deep clone a case. 
Currently, I am able to clone emails related to case but not the attachments of the emails.
Can anyone help me with it.

Below is the code for cloning emails:
List<EmailMessage> clonedEmail = new List<EmailMessage>();
        for(EmailMessage email : [Select id,ContentDocumentIds, ParentId, ActivityId, BccAddress, CcAddress, FromAddress, FromName, Subject, TextBody, Status, HasAttachment,MessageDate from EmailMessage where ParentId =: this.recordId]){
            EmailMessage newemail = email.clone(false, true);
            newemail.ParentId = newCase.id;           
            newemail.FromAddress ='supportsandbox@test.com';
      
            System.debug('newemail.FromAddress'+newemail.FromAddress);
            clonedEmail.add(newemail);
      }
 
There is a lookup field to opportunity on case.I want to Identify First case created with a specific criteria on Opportunity without updating any opportunity or without writing any automation on Opportunity. I am supposed to write the automation(except trigger) only on Case object.

Can anyone help me with this.
There is an apex class which inserts a Product, Pricebook entry & Pricebook and populates the product & price on custom object.

Can anyone please help me cover these below lines in a test class.
 for(PriceBookEntry pbe : pbes) {
                    BQ_Detail__c bqd = new BQ_Detail__c();
                    if(product.Lightbox_Pricing__c) {
                        bqd.Product__c = product.Id;
                        bqd.Vantage_Pricing__c = true;
                        bqd.Price__c = pbe.UnitPrice;
                        bqd.CurrencyIsoCode = pbe.CurrencyIsoCode;
                    } else {
                        bqd.Product__c = product.Id;
                        bqd.Price__c = pbe.UnitPrice;
                        bqd.CurrencyIsoCode = pbe.CurrencyIsoCode;
                    }
 
  • September 14, 2020
  • Like
  • 0
Hi,

Can anyone tell me the correct answer for this.

Q)The training team at Universal Container use a custom Training object to track customer training sessions. An App Builder needs to create a relationship between the Training object and related Student’s record.
which 2 statements are true when creating a student lookup field on training object?
A. Cross-object field updates between Training and Student record are not supported.
B. On Training record, users can only delete Students, if they have access to it.
C. On Training record, the student lookup field can be made optional.
D. On Student record, users can set up Roll-up summary field on Training records.
Hi,

Referring the below article I have made the changes.
https://trailblazers.salesforce.com/answers?id=9063A000000pdAAQAY

But still I cannot see the save draft button.

Can anyone please help me fix this issue.
Hi All,
I have to deep clone a case. 
Currently, I am able to clone emails related to case but not the attachments of the emails.
Can anyone help me with it.

Below is the code for cloning emails:
List<EmailMessage> clonedEmail = new List<EmailMessage>();
        for(EmailMessage email : [Select id,ContentDocumentIds, ParentId, ActivityId, BccAddress, CcAddress, FromAddress, FromName, Subject, TextBody, Status, HasAttachment,MessageDate from EmailMessage where ParentId =: this.recordId]){
            EmailMessage newemail = email.clone(false, true);
            newemail.ParentId = newCase.id;           
            newemail.FromAddress ='supportsandbox@test.com';
      
            System.debug('newemail.FromAddress'+newemail.FromAddress);
            clonedEmail.add(newemail);
      }
 
There is a lookup field to opportunity on case.I want to Identify First case created with a specific criteria on Opportunity without updating any opportunity or without writing any automation on Opportunity. I am supposed to write the automation(except trigger) only on Case object.

Can anyone help me with this.
There is an apex class which inserts a Product, Pricebook entry & Pricebook and populates the product & price on custom object.

Can anyone please help me cover these below lines in a test class.
 for(PriceBookEntry pbe : pbes) {
                    BQ_Detail__c bqd = new BQ_Detail__c();
                    if(product.Lightbox_Pricing__c) {
                        bqd.Product__c = product.Id;
                        bqd.Vantage_Pricing__c = true;
                        bqd.Price__c = pbe.UnitPrice;
                        bqd.CurrencyIsoCode = pbe.CurrencyIsoCode;
                    } else {
                        bqd.Product__c = product.Id;
                        bqd.Price__c = pbe.UnitPrice;
                        bqd.CurrencyIsoCode = pbe.CurrencyIsoCode;
                    }
 
  • September 14, 2020
  • Like
  • 0
Hi,

Referring the below article I have made the changes.
https://trailblazers.salesforce.com/answers?id=9063A000000pdAAQAY

But still I cannot see the save draft button.

Can anyone please help me fix this issue.