• bhanu_prakash
  • SMARTIE
  • 980 Points
  • Member since 2015
  • Salesforce Developer
  • LTI

  • Chatter
    Feed
  • 21
    Best Answers
  • 5
    Likes Received
  • 0
    Likes Given
  • 134
    Questions
  • 296
    Replies
Hi,

Am struggling to get a test class for the following custom list view and hoping for some input here, apex;
 
public with sharing class RecentTechnicalBulletinsHomePage {
  @AuraEnabled
  public static List<Knowledge__kav> getArticles(){
	return [Select Id, Title, LastModifiedDate From Knowledge__kav Where RecordTypeId = '0121k000000CipgAAC' ORDER BY LastModifiedDate DESC LIMIT 10];
  }
}

Now my test class looks as follows;
 
@isTest
public class RecentTechnicalBulletinsHomePageTest
{
@testSetup
static void createArticle(){
    List<Knowledge__kav> testArt = new List<Knowledge__kav>();
            for(Integer i=0;i<10;i++) {
            testArt.add(new Knowledge__kav(Title = 'TestArt'+i));
        }
    insert testArt;
}
public static testMethod void getListView(){
        
	
     } 
}

I am just not sure what method to look for and what to test really.

Any direction/input is highly appreciated! 

Hi,

I have created a VF page and its controller extension to generate and save a PDF report in related Files on a button click. Now on button click, I just want a PDF should get saved in related Files to the record and the page should get redirected to its record detail page without displaying the PDF. This is to be done in Lightning and not Classic. So, I can't even pass record link and a record ID anywhere.

Please do suggest ways to do this. Any help would be highly appreciated.

The scenario is : when the user saves the account record in salesforce org1, it should be automatically get saved in the other salesforce org2, both the things to be happen simultaneously.. 
 note: should have to done with  REST API.. PLEASE PROVIDE ANY LINK OR THE SOLUTION to learn 
Hi, I am trying to build a related list , 
Units has Master relation to praperty

below is my class and page: But I am not getting values in my page.
Thanks in advance.
 
public class DeleteFlag
{
    public Property__c prop{get; set;}
    Public Unit__c unts{get;set;}
    public List<Unit__c> Records {get; set;}
    public DeleteFlag(ApexPages.StandardController controller)
        {
            prop=new Property__c();
            unts = new unit__c(); 
            
            Records = [select Name,Property_Unit__c FROM Unit__c WHERE 
            Property_Unit__c = :Prop.Name];
            system.debug(prop.Name);
            
            
        }

 
I have Table in visual force which pulls all currency value of perticular vendor in the year and few filters all performed to find total values quater values extra. i need to display comma after thousands. There are so many fileds so i cant if codition for all the fileds. Please let me know how to handel this?
 
Hi,

I wrote a batch to update the fields, i got the below errors for my code

User-added image
Code
global class updatezone implements Database.Batchable<sObject>,Database.stateful{
    
    //Start Method....   
    global Database.querylocator start(Database.BatchableContext bc){
        Query = 'SELECT id,No_of_Agents__c,No_of_Female_Agents__c,No_of_Male_Agents__c,Agents_40_years_and_above__c,Agents_below_40_years__c,X1_star_Agents__c,X2_star_Agents__c,X3_star_Agents__c,X4_star_Agents__c,X5_star_Agents__c'+
            				' FROM Zone__C ';
        return Database.getQueryLocator(query);
    }
    global void execute(Database.BatchableContext bc, List<Zone__C> scope){
                 for(zone__c z : [SELECT Id,Name__C,No_of_Agents__c,No_of_Female_Agents__c,No_of_Male_Agents__c,Agents_40_years_and_above__c,Agents_below_40_years__c,X1_star_Agents__c,X2_star_Agents__c,X3_star_Agents__c,X4_star_Agents__c,X5_star_Agents__c FROM 
                         Zone__C]){
                              z.No_of_Agents__C = [SELECT count() FROM Agent__C WHERE Zones__C =: z.Name__C];
                              z.Agents_below_40_years__C = [SELECT count() FROM Agent__C WHERE Age__C <=40 AND Zones__C =: z.Name__C ];
                              z.Agents_40_years_and_above__c = [SELECT count() FROM Agent__C WHERE Age__C > 40 AND Zones__C =: z.Name__C ];
                              z.No_of_Male_Agents__C = [SELECT count() FROM Agent__C WHERE Gender__C =: 'Male' AND Zones__C =: z.Name__C ];
                              z.No_of_Female_Agents__C = [SELECT count() FROM Agent__C WHERE Gender__C =: 'Female' AND Zones__C =: z.Name__C];
                              z.X1_star_Agents__c = [SELECT count() FROM Agent__C WHERE Ranking_Stars__C =1 AND Zones__C =: z.Name__C ];
                              z.X2_star_Agents__c = [SELECT count() FROM Agent__C WHERE Ranking_Stars__C =2 AND Zones__C =: z.Name__C ];
                              z.X3_star_Agents__c = [SELECT count() FROM Agent__C WHERE Ranking_Stars__C =3 AND Zones__C =: z.Name__C ];
                              z.X4_star_Agents__c = [SELECT count() FROM Agent__C WHERE Ranking_Stars__C =4 AND Zones__C =: z.Name__C ];
                              z.X5_star_Agents__c = [SELECT count() FROM Agent__C WHERE Ranking_Stars__C =5 AND Zones__C =: z.Name__C ];
                         }
upsert z;
    }
    public void finish(Database.BatchableContext bc){
         Id job= bc.getJobId();
         }
}

 
Can I use any Lightning component to create tables with multiediting mode?
How to write in trigger when the Opportunity is Closed Won the related Child Record’s Amount field will be equal to Opportunity’s Amount field.
Once I click on Submit button on a visualforce page, a Browser message should open which should have the option of "Agree" and "Disagree" and Save Button. How do I go about doing this?
<aura:component controller="MyContactListController" implements="force:lightningQuickAction" access="global">
    
    <aura:attribute name="recordId" type="Id" />
    <aura:attribute name="Account" type="Account" />
    <aura:attribute name="Contacts" type="Contact" />
     <aura:attribute name="Opportunities" type="Opportunity" />  
    <aura:attribute name="Columns" type="List" />
    <aura:attribute name="MyColumns" type="List"/>
    <aura:handler name="init" value="{!this}" action="{!c.myAction}" />
    <aura:handler name="AddRowEvt" event="c:AddNewRowEvt" action="{!c.addNewRow}"/>

    
    <force:recordData aura:id="accountRecord"
                      recordId="{!v.recordId}"
                      targetFields="{!v.Account}"
                      layoutType="FULL"
                      />
    <lightning:card iconName="standard:contact" title="{! 'Contact List for ' + v.Account.Name}">
        <!-- Contact list goes here -->
        <lightning:datatable data="{! v.Contacts }" columns="{! v.Columns }" keyField="Id" hideCheckboxColumn="true"/>
         <aura:iteration items="{!v.contactList}" var="item" indexVar="index">
                <c:dynamicRowItem ContactInstance="{!item}" rowIndex="{!index}" />
            </aura:iteration>

    </lightning:card>
    <div class="slds-modal__footer">
        <div class="slds-x-small-buttons--horizontal">
          <button class="slds-button slds-button--neutral">Create Contact</button>
          
        </div>
      </div>
    
    <lightning:card iconName="standard:opportunity" title="{! 'Opportunity List for ' + v.Account.Name}">
        <!-- Opportunity list goes here -->
        <lightning:datatable data="{! v.Opportunities }" columns="{! v.MyColumns }" keyField="Id" hideCheckboxColumn="true"/>
        <br/>
    </lightning:card>
    
    <div class="slds-modal__footer">
        <div class="slds-x-small-buttons--horizontal">
          <button class="slds-button slds-button--neutral">Create Opportunity</button>
          
        </div>
      </div>
</aura:component> this is my component ,any suggestions?
Hi All,

We have client who has its own website. When the user clicks in a link he is redirected to force.com site. But he is redirected to site URL which is is in HTTP. My requirement is that the URL should be changed from HTTP to HTTPS. The HTTPS setting checkbox in session settings is enabled. In the login settings of site, the secure web address is given as HTTPS. Is there any way that when user click on the link, it opens HTTPS instead of HTTP site URL. I tried to change to HTTPS in href tag of the website but its not working.

Thanks,
Anuj
I have trield almost every code and solution from forum still stuck into this challange.
Challange
Refactor Components and Communicate with Events
Refactor the input form for camping list items into its own component and communicate with component events.
Replace the HTML form in the campingList component with a new campingListForm component that calls the clickCreateItem JavaScript controller action when clicked.
The campingList component listens for a c:addItemEvent event and executes the action handleAddItem in the JavaScript controller. The handleAdditem method saves the record to the database and adds the record to the items value provider.
The addItemEvent event is of type component and has a Camping_Item__c type attribute named item.
The campingListForm registers an addItem event of type c:addItemEvent.
The campingListFormController JavaScript controller calls the helper's createItem method if the form is valid.
The campingListFormHelper JavaScript helper creates an addItem event with the item to be added and then fires the event. It then resets the newItem value provider with a blank sObjectType of type Camping_Item__c.

I am not pasting entire code as it is too lengthy.

I am trying from past 2 days, many hours ... still no luck.
Tried with every possible solution from Forum and StackExchange tried with fresh Trailhead Org, nothing worked.
with each try .. getting new errors.
Can someone please try the solution in their system and provide it in the comment ssection. That would be a great help.
Thanks in advance,
Manoj
 
Hello ,

I have a ligthning:dataTable not displaying correctly.

There is no header visible and also data is not visible.
Please explain why.
 
<aura:if isTrue="{!v.showCsResults}">          	
            <lightning:datatable data="{!v.csResults}" columns="{!v.csResultsColumns}" keyField="siret" hideCheckboxColumn="true" onrowaction="{!c.siretiser}" />
        </aura:if>
 
init: function (component, event, helper) {
        //This method is called on initialization
        //It formats the lightning:dataTable that will display the CS results with the appropriate columns and data types
        
         var actions = [
            { label: 'Sirétiser', name: 'siretiser' },
        ];
        
        component.set('v.csResultsColumns', [
             		{label: 'Siret', 							fieldName: 'siret', 	type: 'text'},
            		{label: 'Nom du Compte', 					fieldName: 'nomCompte', type: 'text'},
                    {label: 'Rue', 								fieldName: 'rue', 		type: 'text'},
            		{label: 'CP', 								fieldName: 'cp', 		type: 'text'},
            		{label: 'Ville', 							fieldName: 'ville', 	type: 'text'},
            		{ type: 'action', typeAttributes: { rowActions: actions } }
                ]);
    }


 
var csresults = new Array();
                    
					for (var item of results.companies) {
                        var csresult = new Object();
                        csresult.siret = item.regNo;
                        csresult.nomCompte = item.name;
                        csresult.rue = item.address.street;
                        csresult.cp = item.address.postalCode;
                        csresult.ville = item.address.city;
                        
                        csresults.push(csresult);
                    }
                    
                    
                    component.set('v.csResults', csresults);
                    component.set('v.showCsResults', true);


 
Hi All,
how to schedule batch class for  every 2 minuets

My Batch class :
global class InsertIterableBatch  implements database.Batchable<Slot__c> {
global Iterable<Slot__c> start (database.Batchablecontext bc){
        list<Slot__c> slotReclist = new list<Slot__c>(); 
        for(integer i=0;i<100;i++){
        Slot__c  slotRe = new Slot__c();
        slotre.RecordTypeId = '01228000000SxvX';
        slotRe.Duration__c = 1;
        slotRe.start_date_time__c = Datetime.newInstance(2018,5,1,15,0,0);
        slotRe.End_Date_Time__c =   Datetime.newInstance(2018,5,1,15,0,0);  
        slotRe.Max_No_Of_Students__c = 10;
        slotReclist.add(slotRe);
        }
        return slotReclist;
        }
global void execute (database.BatchableContext bc, list<Slot__c> slotreclist){
        insert slotReclist;
        }
global void finish (database.Batchablecontext bc){
        }
        }

how to schedule batch class for every 2 minuets

Visualforce Page and the corresponding peview.
HelloWorld VF page with HTML Headers
VF preview

Lightning Componet and its preview

Lightning Component with HTML Headers

Lightning component preview

Lightning Component preview

In lightning line break is applied automatically for each header tag where as in visualforce line break needs to applied to get content in new line.
And in visualforce and lightning the headers tags are rendered correctly all have same size even the headers are different




 

Hello,

I am looking for way for below two things
1) associate a lead with the a existing contact
2) associate a account with the existing contact

Thank you for guiding

I have a requirement to create one prechat form for live agent in form should be a custom id field on the bais of that field we will find account if account exist then we will create a case and  agent record.

Please help me how to create the form.

 

I'm sure I might be missing something but I'm trying to enable or confirm whether the Ant Migration Tool is enabled in my Connected Apps. In the "Lightning Experience", if I go to setup, Manage Apps under Administration Setup, I see the Ant Migration Tool listed with no 'Start URL' defined, but under Setup, App Setup, Apps, I don't see it listed anywhere. The Force.com REST API Developer Guide doesn't explicitly state what to do in this situation, but I wanted to know if based on my settings whether the Ant Migration Tool is already setup for Oauth2.
Hi,

I am trying to update if child values (contact record if anyone in all fields) changes need to update in Parent (Account ) Chatter feed. How can I achieve it?
Hi Team,

I am working on communities, how to get login in the user info.
I am using standard objects such as account, contact, and cases.
In under contact, we have checkbox has superuser. If it is checked login user need to able to view info of all cases associated with the account.
Id accId = [select contactid, contact.accountid from user where id = :userid].contact.accountid;
case ca = [SELECT AccountId,contact.Superuser__c ,CaseNumber,Id,Status FROM Case where status != null and contact.superuser__c = true and accountId =: accid];
Thanks for advance
 
Hi,
I am working on test LWCOSS and need to deploy in Github pages. Now my github site is not rendering.
my github site: https://forcelearn.github.io/LWCOSSTest/
my git source repo
https://github.com/forcelearn/LWCOSSTest
"predeploy": "yarn build",
        "deploy": "gh-pages -d build",
        "watch:production": "lwc-services watch --mode=production"
if i test with react application its rendering perfectly
I have added below code in package.json under scripts to work in react
"predeploy": "yarn build",
      "deploy": "gh-pages -d build"
 https://forcelearn.github.io/testreactapp/ (https://forcelearn.github.io/testreactapp/)

anyone can help?

Thanks,
Bhanu Prakash
Hi,
Iam trying to send email to user from opportunity need to load email template into body of email message and need to change email template based user language.

Thanks
Hi Team,

i have tried 
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_interface_QuickAction_QuickActionDefaultsHandler.htm%23apex_QuickAction_QuickActionDefaultsHandler_methods

i have created class and make a default in support settings and make OWD email id and unable to get update information in on click on send email button standard. Unable to understand where i miss .

Need to prepopulate information with template in email in Lightning

Thanks
Hi Team,

I need to send mail from case quick action, when user click on send email button. Email need to be sent in specific time like 5,10,15 later. Meanwhile if your make an mistake they need to stop previous mail and need to send email . Can we achieve in salesforce ?

Thanks
 
Hi Team,

Iam facing error 
Make sure the 'bearLocation' and 'bearSupervisor' Lightning web components have been added to the Bear record page.
User-added image
on these trailhead module
https://trailhead.salesforce.com/content/learn/projects/lwc-build-flexible-apps/single-record?trailmix_creator_id=strailhead&trailmix_id=lightning-web-components

I have added them in record page 
User-added imagei have made activation as org default in record page.

Thanks,
Bhanu Prakash
Hi Team,
 
trigger campupdate on Campaign (before insert,before update) {
  for(Campaign ca: Trigger.new){
      if(ca.Type=='Conference'){
      ca.EndDate = ca.StartDate+30;
      }
      else
          ca.EndDate =ca.StartDate;   
  }
}
how can i convert these trigger into LIghtning flow builder. I know that i can acheive these functionality using workflow or process builder. In further we are calling custom meta data type into logic . So i need to implement these functionality using flow builder
 
Hi Team,

I have 2 created custom field start date and end date ..
if opportunity stage is created . start date need to be createddate+5 and end date need to be created date +30
If  opportunity stage is created . start date need to be createddate+10 an end date need to be created date +40
If opportunity stage is created . start date need to be createddate+15 and end date need to be created date +50
Opportunity stages contains
Created
Contacted 
Sent for approval.

Need to design these using floflofs
Hi,
Iam trying to cover a class facing issue on code facing issue.
Error Message	System.QueryException: List has no rows for assignment to SObject
Stack Trace	Class.OppsendEmail.uploadPDF: line 77, column 1
Class.OppsendEmail_Test.setupTestData: line 106, column 1
Class
 
public class OppsendEmail {   
    
    public String subject {get; set;}
    public String body {get; set;}
    public blob attbody {get; set;}
    public String attname {get; set;}
   // public String sendTo {get; set;}
    public OpportunityContactRole sendToContact {get; set;}
    public list<string> toAddresses {get; set;}
    
   // public String Opportunity.Contact__c {get; set;}
    public String oppList {get; set;}
    public list<document> docList {get; set;}
    public List<Opportunity> Opp = new list<Opportunity>();
    public Map<Id, Opportunity> relatedOppMap = new Map<Id, Opportunity>();
    List<OpportunityContactRole> contactRoleArray = new List<OpportunityContactRole>();
    List<Contact> ContactList = new List<Contact>();
    //public List<AttchCls> attchLst {set;get;}
    public String currentUserEmail {get; set;}
     public String currentUserEmail1 {get; set;}
    // Custom Label
    public string customLabelValue{get;set;}   
    public String accountnumber { get; set; }
    public String accountid { get; set; }
    public Opportunity Opportu {get;set;}
    ApexPages.StandardController controller;
  
    
    /* Content */
    public string content { get; set; }
    public transient  ContentVersion contentRecord { get; set; } 
    
    // Constructor to get Opportunity data
    public OppsendEmail(ApexPages.StandardController controller){     
        customLabelValue = System.Label.New_Project_Survey_ID; 
        
        
        New_Project_Survey_ID__c PId =  New_Project_Survey_ID__c.getInstance('New Project Survey ID');
     //   contentRecord = [select id, Title, VersionData from ContentVersion where ContentDocumentId =: PId.New_Project_Survey_ID__c  LImit 1];
        
        //content = contentRecord.Title;  
        content = 'Test Title';         
        
        // Opportu = new Opportunity();
        
         this.controller = controller;
         Opportu = (Opportunity)controller.getRecord();
         system.debug('Opportu'+Opportu.Contact__c);

        
        
        
        opp = [Select OwnerId, (Select OpportunityId, Contact.Email From OpportunityContactRoles) From Opportunity 
                                where id in (Select OpportunityId From OpportunityContactRole where ContactId != '') 
                                AND Id =: ApexPages.currentPage().getParameters().get('id')];
        
        system.debug('ApexPages.currentPage().getParameters().get() >>>>>. Line 19'+ApexPages.currentPage().getParameters().get('id'));
        contactRoleArray =[select ContactID, Contact.Email, isPrimary, opportunityId from OpportunityContactRole Where isPrimary = true AND opportunityId =: ApexPages.currentPage().getParameters().get('id')];
       // sendTo   = [SELECT Id, Email, Name From Contact WHERE id =: contactRoleArray[0].ContactID ].Email;
        currentUserEmail = UserInfo.getUserEmail();
        body = 'Default body';
        subject = 'Default subject';
        system.debug('contactRoleArray >>>>> Line 18  '+contactRoleArray);
        //system.debug('Emaillist >>>>>. Line 34'+sendTo);
        system.debug('currentUserEmail >>>>>. Line 28'+currentUserEmail );
        
    }

    
    public PageReference uploadPDF(){
        
        String CurrentLoginUserId = UserInfo.getUserId();
        Opportu = (Opportunity)controller.getRecord();
        Id ContactID = Opportu.Contact__c;
        system.debug('Opportu'+Opportu.Contact__c+'   '+'ContactID   '+ContactID);           
      //  sendToContact =[select ContactID, Contact.Email, isPrimary  from OpportunityContactRole WHERE Id =: ContactID].Contact.id;
       sendToContact =[select ContactID, Contact.Email, isPrimary  from OpportunityContactRole WHERE Id =: ContactID];
        //system.debug('sendTo Line 75 >>>'+sendTo);


        try {
            //  EmailTemplate template = [SELECT Id FROM EmailTemplate WHERE Id = '00XC0000001kH4SMAU' LIMIT 1];
            Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();  
            customLabelValue = System.Label.New_Project_Survey_ID;          
           transient ContentVersion  cv_list = [select id, Title, VersionData, PathOnClient, FileExtension from ContentVersion where ContentDocumentId =: customLabelValue LImit 1];
            string EamilAttTitle = cv_list.Title+'.'+cv_list.FileExtension;
            transient Blob b = cv_list.versionData;
            
            // Create the email attachment
            Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
            efa.setFileName(EamilAttTitle); 
            efa.setBody(b);
            email.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});
            email.setSubject(subject);
            
            String SendTo = sendToContact.Contact.id;
            String[] toAddresses = new String[]{SendTo};
            String[] currentUserEmails = new String[]{currentUserEmail};
            email.setToAddresses( toAddresses );
            email.setccAddresses(currentUserEmails);
            email.setPlainTextBody(body);
            
            String[] ccAddresses = new String[] {currentUserEmail};
            // Sends the email  
            Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
            
            List<Task> taskList = new List<Task>();
            for(Opportunity Op : opp){
                   Op.Survey_Sent_Date__c = Date.today(); 
                   Op.Survey_Status__c = 'Sent';
                   
                       Task newTask = new Task();
                       newTask.WhatId = op.Id;
                    //   WhatId = CurrentLoginUserId ,
                       newTask.OwnerId = CurrentLoginUserId;
                    //   OwnerId = op.OwnerId,
                       newTask.ActivityDate = Date.today();
                       newTask.Subject = 'New Project Survey Sent';
                       newTask.Description = ' ';
                       newTask.WhoId = sendToContact.Contact.id;
                       newTask.RecordType = [SELECT Id, Name, DeveloperName FROM RecordType WHERE Name = 'Standard Task' LIMIT 1];
                       newTask.Status = 'In Progress';
                       newTask.Type  = 'Email';
                       newTask.Priority = 'Normal';
                       
                taskList.add(newTask);
                 
            }                
            update opp;
            insert taskList;
            
         Id Opport = ApexPages.currentPage().getParameters().get('id');
         system.debug('Opport 95'+Opport);
         PageReference pgref = new PageReference('/' + Opport);
         pgref.setRedirect(true);
         return pgref;
        }
        catch(exception e){
            system.debug('Error:'+e);
            apexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO,'e-'+e));
        }
        finally{
            
        }
        return null;
    }
 
    
}

Test Class:
 
@isTest
private class OppsendEmail_Test{
    public string acc;

    @istest
   public  static void setupTestData(){
        test.startTest();    
        
        Account a = new Account();
        a.Name = 'Test Co.';
        a.BillingStreet = '4332 Holden Street';
        a.BillingCity = 'San Diego';
        a.BillingState = 'California';
        a.BillingPostalCode = '92101';
        a.BillingCountry = 'United States';
        a.Phone = '501-555-5555';
        a.Website = 'www.testco.com';
        insert a;
        System.debug('created Account'+ a);
        
        Contact c = new Contact();
        c.RecordType = [SELECT Id, Name, DeveloperName FROM RecordType WHERE Name = 'External Contact' LIMIT 1]; 
        c.Job_Level__c = 'Consultant';
        c.Job_Function__c = 'Marketing';
        c.FirstName = 'Paul';
        c.LastName  = 'Test';
        c.AccountId = a.id;
        c.Email='test@gmail.com';       
        insert c;
        
        Contact c1 = new Contact();
        c1.RecordType = [SELECT Id, Name, DeveloperName FROM RecordType WHERE Name = 'External Contact' LIMIT 1]; 
        c1.Job_Level__c = 'Consultant';
        c1.Job_Function__c = 'Marketing';
        c1.FirstName = 'Paul1';
        c1.LastName  = 'Test1';
        c1.AccountId = a.id;
        c1.Email='test1@gmail.com';
       
        insert c1;
        System.debug('created Contact'+ c);
        
        Opportunity opp = new Opportunity();
        opp.RecordType = [SELECT Id, Name, DeveloperName FROM RecordType WHERE Name = 'Catalent Clinical Services Opportunity' LIMIT 1]; 
        opp.Name = 'New Record';
        opp.StageName = 'Posted';
        opp.CloseDate = Date.today();
        opp.Description = 'Test Record';  
        opp.Contact__c = C.id;
        insert opp;
        System.debug('created opportunity'+ opp);
        
       
        ContentVersion cv = new ContentVersion();
        cv.Title = 'Catalent';
        cv.PathOnClient = 'Catalent.pdf';
        cv.VersionData = Blob.valueOf('Test Content');
        cv.IsMajorVersion = true;    
        insert cv; 
        System.debug('created content version'+ cv); 
    
       New_Project_Survey_ID__c PId = new  New_Project_Survey_ID__c();
       PId.Name ='Test Custom setting';
       PId.New_Project_Survey_ID__c = cv.Id;
       Insert PId;
       system.debug('PId'+PId);
       
       
        OppsendEmail oo = new OppsendEmail(new ApexPages.StandardController(opp));
       
       
       
        PageReference pageRef2 = Page.CustomAccountLookup;
        pageRef2.getParameters().put('OpportunityId',opp.id);
        system.debug('pagereference:'+pageRef2);
        CustomAccountLookupController cc=new CustomAccountLookupController();
        cc.OpportunityId=opp.id; 
        cc.searchString=c.Id;
        
         OpportunityContactRole opportunitycontactrole_Obj = new OpportunityContactRole(OpportunityId = opp.id, ContactId = opp.Contact__c, Role = 'Business User', IsPrimary = true);
        Insert opportunitycontactrole_Obj; 
        System.debug('created opportunity contact role'+ opportunitycontactrole_Obj );
        
       OpportunityContactRole opportunitycontactrole_Obj1 = new OpportunityContactRole(OpportunityId = opp.id, ContactId = opp.Contact__c, Role = 'Business User', IsPrimary = false);
        System.debug('created opportunity contact role'+ opportunitycontactrole_Obj1 );
        
        Insert opportunitycontactrole_Obj1; 

       
       // OppsendEmail obj01 = new OppsendEmail(new ApexPages.StandardController(opp[0]));    
       /* opp.IsPrivate=false;
        opp.Name='Name593';
        opp.StageName='Prospecting';
        opp.CloseDate = Date.today();
        Update opp; 
*/
        System.debug('created opportunity'+ opp);
        opportunitycontactrole_Obj.Role='Business User';
        opportunitycontactrole_Obj.IsPrimary=false;
        Update opportunitycontactrole_Obj;
       //oo.sendTo=c.Email;
        PageReference pageRef = Page.SendEmailFromOpp;
        pageRef.getParameters().put('id',opp.id);
       Test.setCurrentPage(pageRef);
       
       oo.uploadPDF();
      test.stopTest();
       
    }
    
    
}

​​​​​​​
 
Hi Team,
I have content file in my org 
ContentDocument doc = [SELECT Id,Title,Description FROM ContentDocument WHERE ID= '06911000000eZPPA2']
i need to share that file as attachment in email on click on button. i have designed vf page and class. I can able to share document but not in Content file. Help me to design it.

Apex Class
public class sendEmail {
    
    public sendEmail(ApexPages.Standardcontroller controller){
    }

    public String subject {get; set;}
    public String body {get; set;}
    public blob attbody {get; set;}
    public String attname {get; set;}
    public String sendTo {get; set;}
    public String oppList {get; set;}
    public list<ContentVersion> docList {get; set;}
    private final Opportunity Opp;
    public blob file { get; set; }
    public ContentVersion ConVer { get; set; }

    // Constructor to get Opportunity data

    public sendEmail(){
        Opp = [SELECT Id, Name,(SELECT Contact.Name,Contact.Email,Contact.Id,Contact.AccountId,ContactId,Role, Contact.Account.Name 
                     FROM OpportunityContactRoles) FROM Opportunity WHERE Id = :ApexPages.currentPage().getParameters().get('id')
            
        ];
        docList = new list<ContentVersion>();
        EmailTemplate ev = [Select id, name,Subject,Body from EmailTemplate];
        subject = 'Test Subject';
        body = 'Test body';
    }
	 public Opportunity getOpp() {
        return Opp;
    }
    
    public PageReference send(){
        // Define the email
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); 

        EmailTemplate ev = [Select id, name,Subject, Body from EmailTemplate where name = 'Test Template'];
        String addresses;     

        String[] toAddresses = addresses.split(':',0);
        // Sets the paramaters of the email
        email.setSubject( subject );
        email.setToAddresses( toAddresses );
        email.setPlainTextBody( body );
        

        // Create the email attachment
        Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
        efa.setFileName('attname');
        efa.setBody(attbody);
        email.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});

        // Sends the email
        Messaging.SendEmailResult [] r = 
            Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});   
		
        return null;
    }
    
    public String  docName {get; set;}
    public PageReference uploadPDF(){
        /*
        Document d = new Document();
        d.folderid = UserInfo.getUserId();
        d.name = this.attname;
        d.body = this.attbody;
		*/
        ContentVersion d = [SELECT Id,Title,Description FROM ContentDocument WHERE ID= '0690I0000097dNe'];
        d.versionData = file;
        d.title = 'from VF';
        d.pathOnClient ='/foo.txt';
        try {
            insert d;
            docList.add(d);
          //  docName = d.name;
           docName = d.title;
            send();
        }
        catch(exception e){
            system.debug('Error:'+e);
            apexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO,'e-'+e));
        }
        finally{
            attbody = null;
          //  d = new Document();
        }
        return null;
    }

}

Visualforce Page:
<!---- Created to Send Email from Button on Opportunity -->

<apex:page standardController="Opportunity" extensions="sendEmail" sidebar="false" showHeader="false">
    <apex:messages />
    <apex:form id="form">
        <apex:pageblock >
            <apex:pageBlockSection title="Send Email" Columns="1">
                 <div class= "Lookup">
                <apex:outputLabel value="Send To:"/>
                <apex:inputText value="{!sendTo}" id="sendTo"/>
               
                    <a href="#" id="link1" title="Lookup" tabindex="6" >
                        <img class="lookupIcon" title="Lookup" src="/s.gif" style="vertical-align:bottom;"/>
                    </a>
                </div>
                
                <apex:outputLabel value="Subject:" for="Subject"/>
                <!--  <apex:inputText value="{!subject}" id="Subject" maxlength="80"/> -->
                <apex:inputText value="{!subject}" id="Subject" maxlength="80"/>
                
                <apex:outputLabel value="Body:" for="Body"/>
                <apex:inputTextarea value="{!body}" id="Body" rows="10" cols="80"/>
                
                <apex:inputFile value="{!attbody}" filename="{!attname}"/>
                <apex:commandButton value="Attach and Send" action="{!uploadPDF}"/>
                
                <apex:outputPanel id="PanelId">
                    <table>
                        <apex:repeat value="{!doclist}" var="str">
                            <tr>
                                <td>{!str.name}
                                </td>
                            </tr>
                        </apex:repeat>
                    </table>
                </apex:outputPanel>
            </apex:pageBlockSection>
        </apex:pageblock>
    </apex:form>
    <style>
    .lookup{
        position: relative;
        left: 181px;
        top: -30px;
        
        }
    </style>
</apex:page>
I have checked muliplte questions in forum, community and sites nothing helps me.

Thanks
 
HI,

Can we design flutter apps using salesforce SDK, did any body designed native apps using sdk. Please provide github repos to create native apps. i have checked trailhead modules they are not fullfillng which iam looking for

Thanks for advance
 
Hi Team,

trying to deisgn CSV uploder in lightning component and need to display in table after uploading CSV file and on click on save button need to save account reords in data base.
 
public class PMO_CsvUploaderController {
    public Blob csvFileBody{get;set;}
    public string csvAsString{get;set;}
    public String[] csvFileLines{get;set;}
    public List<Account> Acclist{get;set;}
    public PMO_CsvUploaderController(){
        csvFileLines = new String[]{};
            Acclist = New List<Account>(); 
    }
    
    public void importCSVFile(){
        try{
            csvAsString = csvFileBody.toString();
            csvFileLines = csvAsString.split('\n'); 
            
            for(Integer i=1;i<csvFileLines.size();i++){
                Account couObj = new Account();
                string[] csvRecordData = csvFileLines[i].split(',');            
                couObj.name = csvRecordData[1] ;        
                couObj.AccountNumber = csvRecordData[2];
                couObj.Phone = csvRecordData[3];
                couObj.Rating = csvRecordData[4];
                	/*
                    String temp_fees=csvRecordData[3];
                    couObj.Course_fees__c = Decimal.valueOf(temp_fees);
                    String temp_date=csvRecordData[4];
                    couObj.Course_Date__c = Date.parse(temp_date); 
                    */
                Acclist.add(couObj);   
            }
            insert Acclist;
        }
        catch (Exception e){
            System.debug(e.getCause());
            ApexPages.Message errorMessage = new ApexPages.Message(ApexPages.severity.ERROR,'An error has occured while importing data. Please make sure input csv file is correct');
            ApexPages.addMessage(errorMessage);
        }  
    }
}

Using these contoroller to create account.. help me to design lightning component
Hi team,

I have 3 custom objects Work__c, Team_Work__C, Work_Task__C and User__c

User__C object has Name
Work__c object has Name, Time
Team_Work__c has Work_Name (lookup to Work), User_Name(lookup to User),Role_of_work (picklist)
work_Tasks__c has Assigned_To__C, Status__c, Work (lookup to Work)

Now iam creating a work_Tasks__c 

I need to create a work record 

1. Work : Car have issue
   time : 2:00Pm
 
Then i will assign it with Team_Work__c  
Role_of_work : Picklist contains (Manager, Supervisor, technical)
 2. Team_Work__c_id : auto Number
      Work_Name     : car have issue (lookup to work)
      User_Name     : Test
      Role_of_work  : Manager 

 2. Team_Work__c_id : auto Number
      Work_Name     : car have issue (lookup to work)
      User_Name     : Test1
      Role_of_work  : Supervisor 
 2. Team_Work__c_id : auto Number
      Work_Name     : car have issue (lookup to work)
      User_Name     : Test2
      Role_of_work  : technical 
 2. Team_Work__c_id : auto Number
      Work_Name     : car have issue (lookup to work)
      User_Name     : Test3
      Role_of_work  : technical 

NOte:  it have 1 Manager(only) and 1 Supervisor need to be for each Team Work record.

Now iam trying to Work_Task__C task 

work_Tasks__c has Status__c, Assigned_To__C, Work (lookup) 
Status__c    : New, in hold, urgent
 
  3.  Work :  Car have issue
      Status :  New 
      Assigned : Test  (need to assign test because he is Manager)

      Status :  in hold 
      Assigned : Test1 (need to assign test1 because he is Supervisor)

      Status :  urgent 
      Assigned : Test2/test3  (need to assign test2/test3  because he is technical)

Thanks for advance
HI,

I have three fields   start__c, end__c and actual_date__c, Iam looking to write validation rule,
1. end date need to be less than start date
2. Start date can't be more than end date.
3. Actual date need to be between start date and end date.
Note: All are date fields and actual date is optional to save record
i have tried it. its not working
IF(
	ISBLANK(actual_date__c),			
			(
				And
				(
					(
					 start__c > actual_date__c
					),   
                    (
					  actual_date__c < End__c
					)
                )			
            )		
			,		
		   (
            And
            (
                (
                    start__c > End__c
                ),   
                (
                End__c < start__c
                )
            )
         )
)


 
Hi Team

Iam trying migrate javascript button into lightnig component need some help to design it stucked on 
{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")} 

if ({!NOT(ISNULL(Lead.Email))}) {
alert("Lead email is created");
} else if ({!Lead.phone = true}) {
alert("Lead phone number is validate");
} else if({!Lead.Status = false}) { 
alert("Lead status is false.");
} else if({!Lead.Status = true} && {!Lead.stage = true}) { 
alert("Lead has been create sucessfully");
} else { var msg = sforce.apex.execute("LeadWebClass","sendMailToLead",{LeadID:"{!Lead.Id}"}); 
alert(msg); 
window.location.reload();
}
Thanks for advance
Hi Team,

Iam creating chatbot to create a case . I have created slot name as

description   datatype as Text
Priority         datatype as Text
and iam trying to create a case using inovcable case , unable to create case
case contact need to logined in user contact name and account name need to be logined user account name.
 
public class ChatBotCreateCase {    
    @InvocableMethod(label='Create a Case' description='New case creation for the specified text')   
    public static List<Case> CreateCases(List<CreateCaseString> requests){               
        List<Case> results = new List<Case>(); 
        for(CreateCaseString request: requests){
            system.debug('Case Results:' +request.value);
            if(request.ObjCase !=null && request.ObjCase.Id != null && String.isNotBlank(request.value)){
                User us = [select id, Name,User.Contact.AccountId,User.Contact.Name from User where id =: UserInfo.getUserId()];
                Case newCase = request.ObjCase;
                newCase.Status = 'New';          
                newCase.Origin = 'Web';
                newCase.Subject = 'Reach out to user ' + us.Contact.Name + ' having email id ' + us.Contact.Email + ' for following question ';                 
                insert newCase;
                list<User> communityUser = [select id, Name,User.Contact.AccountId,User.Contact.Name from User WHERE id =: UserInfo.getUserId()];{
                    User Currentuser = Communityuser[0];
                    Currentuser.Phone = request.value;
                    update Currentuser;
                }
                return new List<Case>{newCase};            
                    }
        }
        return new list<Case>{requests[0].Objcase};     
            }     
    
    public class CreateCaseString{
        @InvocableVariable
        public string value;
        @InvocableVariable
        public Case ObjCase;
    }
    
}

Thanks for advance
Hi,

need some list of communities site which are using salesforce for their live websites
 
Hi Team,

I have a button in lead list view as Send mail to all Leads on click on button need to send mail to all users with my custom email template, How can i acheive these functionlaity .

Thanks for advance
Hi Team,

send email to user when oppournity is closed, how can we acheive that using trigger
Hi,

I need to design approval process we need to send approval for 5 users, 
If 1st user accepts then it need to more 2nd approval then 3rd then 4th then 5th
if any one reject that need to move back 
ex: if 3th rejects need to go to 2nd to approval.

How can we acheive these ?
 I have 3 objects   expense report, Region and Resource and all have lookup fields need to update using trigger.
 
 1. Expesene report has fields
 
    Expense Report Name :
    Region                :
    Company                 :
 
 2. Region object has fields
    Region Name:
    Resource   :
 
 3. Resource object has fields
    Resource Name :
    Company       :
    
    
 I need to write trigger that when expense report has created need to update company name automatically from (Expesene_report__r.Region__r.Resource__r.Company__c
 
  1. Expesene report has fields
 
    Expense Report Name :  Travel to company
    Region                :  England
    Company                :
 
 2. Region object has fields
    Region Name:  England
    Resource   :    Rajeev
 
 3. Resource object has fields
    Resource Name :    Rajeev
    Company       : Sunny Industries
    
    
    If Expense report (Travel to comapny ) is saved i need to update company as (Sunny Industries ) automatically..
How to store 700 picklist fileds ?
How can i get only text from words
EX:  Sultan Road
output : Road
How to convert text output into picklist
Hi All,

I want to create remote site setting when API call is made.
Is there any way to create remote site setting(via API).
I am using salesforce sites. Login user is guest user and I am getting error like " Invalid Session ID found in SessionHeader: Illegal Session faultcode=sf:INVALID_SESSION_ID faultactor=".

Thanks in advance.
Sachin
I have a request to create a visualforce page on the OpportunityLineItem Object that display all the opportunities associated to the same product as this OpportunityLineItem
 
Hi There,

I was given a Live Agent free trial to test before we sign a contract and implement in our website. 
I have not been able to test the live as I haven't been able to set up the test.  I was told that the snap-in code is applicable if I was setting up my Community. However, since it's a third party website that I am trying to integrate with Live agent, I have been asked to contact the salesforce development team for assistance. 

Could you please let me know how can ai setup the free trial so I can test it? 

Thanks,
Sam
Hi Team,

I have 2 created custom field start date and end date ..
if opportunity stage is created . start date need to be createddate+5 and end date need to be created date +30
If  opportunity stage is created . start date need to be createddate+10 an end date need to be created date +40
If opportunity stage is created . start date need to be createddate+15 and end date need to be created date +50
Opportunity stages contains
Created
Contacted 
Sent for approval.

Need to design these using floflofs
Hi All,

We have created simple Hello Word visualforce page which is displaying blank in salesforce 1 and working as expepcted in Lightning Experience. 
"Available for Lightning Experience, Lightning Communities, and the mobile app" checkbox is checked on visualforce page and it was working till friday.

I believe this might be issue due winter'19 release.

Please find below screenshot of lightning experience and salesforce 1 app.
1. Lightning Experince Screenshot
Lightning Experience Screenshot

2. Salesforce1 App Screenshot
Salesforce1 Screenshot

Please let me know if you came across this kind of issue and let me know if any solution available.
Hi Team,

trying to deisgn CSV uploder in lightning component and need to display in table after uploading CSV file and on click on save button need to save account reords in data base.
 
public class PMO_CsvUploaderController {
    public Blob csvFileBody{get;set;}
    public string csvAsString{get;set;}
    public String[] csvFileLines{get;set;}
    public List<Account> Acclist{get;set;}
    public PMO_CsvUploaderController(){
        csvFileLines = new String[]{};
            Acclist = New List<Account>(); 
    }
    
    public void importCSVFile(){
        try{
            csvAsString = csvFileBody.toString();
            csvFileLines = csvAsString.split('\n'); 
            
            for(Integer i=1;i<csvFileLines.size();i++){
                Account couObj = new Account();
                string[] csvRecordData = csvFileLines[i].split(',');            
                couObj.name = csvRecordData[1] ;        
                couObj.AccountNumber = csvRecordData[2];
                couObj.Phone = csvRecordData[3];
                couObj.Rating = csvRecordData[4];
                	/*
                    String temp_fees=csvRecordData[3];
                    couObj.Course_fees__c = Decimal.valueOf(temp_fees);
                    String temp_date=csvRecordData[4];
                    couObj.Course_Date__c = Date.parse(temp_date); 
                    */
                Acclist.add(couObj);   
            }
            insert Acclist;
        }
        catch (Exception e){
            System.debug(e.getCause());
            ApexPages.Message errorMessage = new ApexPages.Message(ApexPages.severity.ERROR,'An error has occured while importing data. Please make sure input csv file is correct');
            ApexPages.addMessage(errorMessage);
        }  
    }
}

Using these contoroller to create account.. help me to design lightning component
HI,

I have three fields   start__c, end__c and actual_date__c, Iam looking to write validation rule,
1. end date need to be less than start date
2. Start date can't be more than end date.
3. Actual date need to be between start date and end date.
Note: All are date fields and actual date is optional to save record
i have tried it. its not working
IF(
	ISBLANK(actual_date__c),			
			(
				And
				(
					(
					 start__c > actual_date__c
					),   
                    (
					  actual_date__c < End__c
					)
                )			
            )		
			,		
		   (
            And
            (
                (
                    start__c > End__c
                ),   
                (
                End__c < start__c
                )
            )
         )
)


 
Hi All,

I am invoking a @InvocableMethod from my Einstein Bot and unfortunately, it seems to have some error and the chat get transferred to a Live agent and stops. I need to debug my @InvocableMethod in order to understand the error. I have tried with logs in developer console and Debug Logs but nothing gets recorded when Invoking the method. Please share your insights on this issue.

Thanks and Regards
Ajay Krishna R
Hi Expert,

I am using below code in my lightning componant but facing error "Jquery_File/jquery-3.3.1.min.js 404 (Not Found)" in browser console.

here "Jquery_File" is static resources name and 
 <ltng:require scripts="{!$Resource.Jquery_File + '/jquery-3.3.1.min'}" />

https://testnewdomian-dev-ed.livepreview.salesforce-communities.com/sfsites/c/resource/1535093740000/Jquery_File/jquery-3.3.1.min.js 404 (Not Found)

Thanks
Mukesh

 
Can someone help here.I am automation engineer.Want to move to slesforce.What will you do if saleforce shuts down someday?
Hi All,

Can someone please tell me. is it possible to load data from Oracle or ther DB directly to Eisntein Analytics platform.

Thanks,
Ram

First time using a salesforce web-to-lead form in a vue app. Trying to add axios (requirement for the current project) and am getting back a COR issue:
Failed to load https://ap4.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8081' is therefore not allowed access.
 
import axios from 'axios';

export default ({
  name: 'app',
  data() {
    return {
      country: '',
      first_name: '',
      last_name: '',
      email: '',
      company: '',
      URL: '',
      phone: '',
      revenue: '',
      emailOptOut: ''
    }
  },
  methods: {
    submitForm() {
      axios.post('https://ap4.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8', {
        crossdomain: true,

        country: this.country,
        first_name: this.first_name,
        last_name: this.last_name,
        email: this.email,
        company: this.company,
        URL: this.URL,
        phone: this.phone,
        revenue: this.revenue,
        emailOptOut: this.emailOptOut
      }).then(response => {
        this.response = JSON.stringify(response, null, 2)
      })
    }
  }
})
<template>
<div id="app">
 <div class="main">
      <div class="container"> 
        <img src="/images/image.png" alt="">
          <h1>Test Account<br>Sign Up</h1>  
          <form @submit.prevent="submitForm">

        <input type=hidden name="oid" value="webtoformnumber">
        <input type=hidden name="retURL" value="https://www.project.com/thankyou">

<div class="field">
    <label for="country">
      Country
    </label>
  <div class="control">
      <input class="input" id="country" name="country" type="text" v-model= "country" required autocomplete="off">
  </div>
</div>

<div class="field">
  <label for="first_name">First Name</label>
  <div class="control">
    <input class="input" id="first_name" name="first_name" type="text" v-model= "first_name" required autocomplete="off">
  </div>
</div>

<div class="field">
  <label for="last_name">Last Name</label>
  <div class="control">
    <input class="input" id="last_name" name="last_name" type="text" v-model= "last_name" required autocomplete="off">
  </div>
</div>

Pretty new at this so apologise in advance is theres already an answer out there (checked but can't seem to find one for vue/sfdc/axios)
Any help would be greatly appreciated! Thanks!
i am getting this error while logging through username and password through login.salesforce.com.But iam able to login into the application through SSO .
Hi,

Am struggling to get a test class for the following custom list view and hoping for some input here, apex;
 
public with sharing class RecentTechnicalBulletinsHomePage {
  @AuraEnabled
  public static List<Knowledge__kav> getArticles(){
	return [Select Id, Title, LastModifiedDate From Knowledge__kav Where RecordTypeId = '0121k000000CipgAAC' ORDER BY LastModifiedDate DESC LIMIT 10];
  }
}

Now my test class looks as follows;
 
@isTest
public class RecentTechnicalBulletinsHomePageTest
{
@testSetup
static void createArticle(){
    List<Knowledge__kav> testArt = new List<Knowledge__kav>();
            for(Integer i=0;i<10;i++) {
            testArt.add(new Knowledge__kav(Title = 'TestArt'+i));
        }
    insert testArt;
}
public static testMethod void getListView(){
        
	
     } 
}

I am just not sure what method to look for and what to test really.

Any direction/input is highly appreciated! 
Hello All, 

I built a Asset Tracking object in our salesforce instance to track our assets internally. I added a button called "Request Item" that kicks off an approval process to admin when submitted. Everything is working on that end, however, when the user (any user) clicks "Request Item" the error message. If they go through the form and fill out info, it's works perfectly fine, however i think the error message will throw people off. How do I remove it?

Error: Invalid Data. 
Review all error messages below to correct your data.

Pops up. It's due to the fact that the contact name has duplicates, so i'd like to remove the error message so it runs smoothly. This is the button code. User-added image

/a5V/e? 
CF00NC0000007IvpQ={!Contact.Name} 
&CF00NC0000007IvpQ__lkid={!Contact.Id} 
&CF00NC0000007J19p={!Account.Name} 
&CF00NC0000007J19p__lkid={!Account.Id} 
&CF00NC0000007J1DX={!TODAY()} 
&retURL=%2F{!Contact.Id}

Help Please!
I have account and contact standard object . I want to insert data in account and contact object together using apex. contact details should be inserted into account . Please help me out
We have a custom object, Purchase Request, that we'd like to clone along with its line items. Currently, we have the native "clone" button that only clones the Purchase Request itself but does not clone with the Purchase Request Line Items. Any help would be appreciated!
Hi,

I am on the "Build Better With UX > UX Prototyping Basics > Iterate On Your Prototype" module, and the Challenge for doing:

Add icons to the rest of card titles for the Contacts and Leads to make it clearer for the user which card is which, using the iconName attribute of the lightning:card base Lightning component.
In the Apex Controller, limit the account, contact and lead SOQL queries to return 5 records.

will not find the code I have *definitely* inputted (the icons and listings are showing up in my playground AOK).

The error I get is:

Challenge Not yet complete... here's what's wrong: 
Could not find the iconName code for contacts in the ResultsSection component.


But from my console:
<h2 class="slds-text-heading--medium slds-p-vertical--medium">Contacts</h2>
      <div class="slds-grid">
        <ul class="slds-col slds-size--1-of-1">
          <aura:iteration items="{!v.contacts}" var="contact" indexVar="index">
            <li class="slds-size--1-of-3 slds-show--inline-block">
              <lightning:card variant="narrow" iconName="standard:user" class="slds-m-around--small">
                <aura:set attribute="title">

It is definitely there.

What's going on here?

Thanks.