• Vijay_sfnerd
  • NEWBIE
  • 5 Points
  • Member since 2017
  • VIJAYA RAGHAVA REDDY KAPADAM

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 8
    Replies
 Hi,
I have a custom billing_account__c object on which we can create cases of particular record type.
I am giving case creation function through a custom button.
Here is the challenge am trying to solve.
If there is a open case already existing on billing_account__c on that record type, I would like to close new case and if does not
Exist I will go ahead and create a case.
I am trying this using triggers but since new could not find a way.
Can someone help with this!?
Regards 
Vijay
I am trying to login in apex data loader. but I am not able to see screen fully.
Is there a fix for this? I am practicing import and export with data Management tools > use data loader to export data

User-added image
 
When  I try to verify the exercise on Create Reports and Dashboards for Sales and Marketing Managers
Visualize Your Data trailhead.

There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: 
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, O número da conta precisa ter pelo menos 8 caracteres: []

I do not know how to fix it. 
Hello,
Can anybody help me on this Case Trigger I'm working on?

Basically when a new case comes in via W2C, I have a trigger to link the Account (or create one if needed). It works in sandbox but something is going wrong with the amount of data returned in my query on line 14. The custom E_mail__c field is indexed, and I'm not sure what else I could check.

Is there something I'm missing in my WHERE clause (in particular to line 14 of the code snippet)?
trigger CaseAutocreateAccount on Case (before insert) {
    List<String> emailAddresses = new List<String>();
    
    //First exclude any cases where the account is set
    for (Case caseObj:Trigger.new) {
        if (caseObj.AccountId==null &&
            caseObj.SuppliedEmail!='')
        {
            emailAddresses.add(caseObj.SuppliedEmail);
        }
    }

    //Now we have a nice list of all the email addresses.  Let's query on it and see how many Accounts already exist.
    List<Account> listAccounts = [Select Id,E_mail__c From Account Where E_mail__c in :emailAddresses];
    Set<String> takenEmails = new Set<String>();
    for (Account a:listAccounts) {
        takenEmails.add(a.E_mail__c);
    }
    
    Map<String,Account> emailToAccountMap = new Map<String,Account>();
    List<Case> casesToUpdate = new List<Case>();

    for (Case caseObj:Trigger.new) {
        if (caseObj.AccountId==null &&
            //caseObj.Origin=='Web' &&
            caseObj.SuppliedEmail!=null &&
            //caseObj.SuppliedName!='' &&
            //!caseObj.SuppliedName.contains('@') &&
            caseObj.SuppliedEmail!='' &&
            !takenEmails.contains(caseObj.SuppliedEmail))
        {
            //The case was created with a null Account
            //Let's make a account for it
            String[] nameParts = caseObj.SuppliedName.split(' ',2);
            if (nameParts.size() == 2)
            {
                Account acct = new Account(FirstName=nameParts[0],
                                            LastName=nameParts[1],
                                            E_mail__c=caseObj.SuppliedEmail);
                emailToAccountMap.put(caseObj.SuppliedEmail,acct);
                casesToUpdate.add(caseObj);
            }
        }
    }
    
    List<Account> newAccounts = emailToAccountMap.values();
    insert newAccounts;
    
    for (Case caseObj:casesToUpdate) {
        Account newAccount = emailToAccountMap.get(caseObj.SuppliedEmail);
        
        caseObj.AccountId = newAccount.Id;
    }
}

Thanks for any help provided!

-Mark
  • November 08, 2017
  • Like
  • 0
I just completed the first challenge.  The Check Challenge button is inactive. What should I do?  
The default behaviour of clicking on a report in a dashboard in our instance runs the report again instead of showing the report at the time the dashboard was last refreshed.

For example: I have a dashboard which is scheduled to run at midnight every night but when trying to open the results by clicking on the section in the dashboard it runs it again and displays new data.

Is there a way to change this behaviour so that clicking on the report in the dashboard displays the historic data instead of displaying the new data?

Thanks,

Chris.
The Error I get is: "Step Not yet complete... here's what's wrong: 
Please check that your report includes at least all of these columns: Supply: Supply Name, Unit Cost, Quantity and Total. 
Note: you may run into errors if you've skipped previous steps."

this is my report:
my Report
not sure where I made a mistake