• Samrendra Singh
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
Hi Guys,

Please help me. I am facing below error for my code

Error:

Line: 4, Column: 5 Invalid constructor syntax, name=value pairs can only be used for SObjects: Contact  OK

Code:


//Create a new contact

List<Contact> conList = new List<Contact> {
    new Contact(FirstName='Nagraj',LastName='B',Department='Finance'),
    new Contact(FirstName='Deepak',LastName='Shivalingappa',Department='Design'),
    new Contact(FirstName='Sachin',LastName='Gotal',Department='PIM'),
    new Contact(FirstName='Rachithra',LastName='R',Department='Automation')     
};
    
// Bulk insert all contacts with one DML call
    
    insert conList;

// List to hold the new contacts to update

List<Contact> listToUpdate = new List<Contact>();

// Iterate through the list and add a title only
//   if the department is Finance

for(Contact con : conList){
    if(con.Department == 'Finance'){
        con.Title = 'Financial Advisor';
        // Add updated contact sObject to the list.
        listToUpdate.add(con);
    }
}    
// Bulk update all contacts with one DML call
update listToUpdate;
 
Hello Friends,

I need your help for the below error which i am facing in the "
Reports & Dashboards for Lightning Experience>>>>Visualize Your Data with the Lightning Dashboard Builder"-

Challenge not yet complete in sam@cerner123.com
The 'Opportunity Stages' report is not a summary report.


Challenge: 
Create a report named Opportunity Stages with the report type Opportunities
Set the range to All Time, include the fields Opportunity Name and Opportunity Owner, and group by Stage
Save the report in any folder
Create a dashboard with the name Big Deals
Save the dashboard in any folder
Add a component and select report Opportunity Stages
Ensure that the title of the component is Opportunity Stages
Display as Donut Chart
Save and refresh the dashboard at least once


Many thanks,
Sam
Hi Guys,

Please help me. I am facing below error for my code

Error:

Line: 4, Column: 5 Invalid constructor syntax, name=value pairs can only be used for SObjects: Contact  OK

Code:


//Create a new contact

List<Contact> conList = new List<Contact> {
    new Contact(FirstName='Nagraj',LastName='B',Department='Finance'),
    new Contact(FirstName='Deepak',LastName='Shivalingappa',Department='Design'),
    new Contact(FirstName='Sachin',LastName='Gotal',Department='PIM'),
    new Contact(FirstName='Rachithra',LastName='R',Department='Automation')     
};
    
// Bulk insert all contacts with one DML call
    
    insert conList;

// List to hold the new contacts to update

List<Contact> listToUpdate = new List<Contact>();

// Iterate through the list and add a title only
//   if the department is Finance

for(Contact con : conList){
    if(con.Department == 'Finance'){
        con.Title = 'Financial Advisor';
        // Add updated contact sObject to the list.
        listToUpdate.add(con);
    }
}    
// Bulk update all contacts with one DML call
update listToUpdate;
 
Hello Friends,

I need your help for the below error which i am facing in the "
Reports & Dashboards for Lightning Experience>>>>Visualize Your Data with the Lightning Dashboard Builder"-

Challenge not yet complete in sam@cerner123.com
The 'Opportunity Stages' report is not a summary report.


Challenge: 
Create a report named Opportunity Stages with the report type Opportunities
Set the range to All Time, include the fields Opportunity Name and Opportunity Owner, and group by Stage
Save the report in any folder
Create a dashboard with the name Big Deals
Save the dashboard in any folder
Add a component and select report Opportunity Stages
Ensure that the title of the component is Opportunity Stages
Display as Donut Chart
Save and refresh the dashboard at least once


Many thanks,
Sam