• Suraj Tripathi 47
  • ALL STAR
  • 6188 Points
  • Member since 2020
  • Salesforce Application Architect
  • Cloud Analogy


  • Chatter
    Feed
  • 188
    Best Answers
  • 0
    Likes Received
  • 6
    Likes Given
  • 0
    Questions
  • 1641
    Replies
 I have just started my salesforce journey so I'm sorry If my doubt is too silly but please help me
What is the least number of records we can have on a batch? I'm trying to update a single lead record using batch class. Am I allowed to do so? Coz I don't want to update all the lead records.
Code I wrote:
apex:outputPanel rendered="{
        !OR(
            AND(
                Preferred_Language__c == 'English',
                Case_Category__c != 'Bug'
            ),
            AND(
                Case_Category__c == 'Administration',
                OR(
                    Case_Sub_Category__c == 'Admin',
                    Case_Sub_Category__c == 'New User',
                    Case_Sub_Category__c == 'Password Reset',
                    Case_Sub_Category__c == 'Other'
                )
            )
    )}"> </apex:outputPanel>

But this is not working. Please Suggest
 
i am getting this error Missing ';' at '{' please help

list<Account> accList= [select id,name,billingcity,annualrevenue,industry,rating from Account];
list<account> accNew= new list<account>();
for(account ac:accList){
    if(ac.Billingcity=='Hyderabad')
        {
            ac.Rating='Hot';
        }
        elseif(ac.Billingcity=='Paris')
       {
            ac.Rating='Cold';
        }
        elseif(ac.Billingcity=='Austin')
       {
            ac.Rating='Warm';
        }
        elseif(ac.Billingcity=='Vizag')
       {
            ac.Rating='Yahoo';
        }       
        else(ac.Billingcity=='Other')
        {
            ac.Rating='Google';
        }
   
accNew.add(ac);    
    }
update accNew; 
Hi please take it as a priority because I am new in vf page learning and the client has required a pdf of the render vf page.

 
Hi Everyone,
  I have Cus_Object__c and Account(Cust_Status__c in Account). In my Cus_Object__c have a field called 'Cus_Status__c' this field values are inserted by apex code.
Like:
Cus_Object__c cus  = new Cus_Object__c();
cus.Cus_Status__c = 'Success';

Whenever the Cus_Status__c field value is not null, I need to update Cus_Status__c field value in my Account object Cust_Status__c field.

Is possible? Any Suggestions?
Thanks in advance.
Hi all. Im trying to insert some account records and also its related case and opportunity records. I wrote the below code but it is throwing an error as ' Expecting '}' but was: '<EOF>' 
can any one point the mistake in the code please ?
 
#Apex
Accounnt acc = new Account();
acc.name = 'Samurai'; 
acc.employees = 20; 
insert acc; 
 
if (acc.id != null){
 system.debug(acc.id);    
  for (integer counter = 1 ; counter <= 5; counter++) { 
  case cs = new case ();
  cs.origin = 'Phone'; 
  cs.status = 'high';
  cs.accountid = cs.id;
   insert cs; 
 
   if ( cs.id !=null){  
    system.debug (cs.id); 
    for (integer counter = 1; counter <=5; counter++){
    Opportunity opp = new Opportunity ();  
    opp.Name = 'Salman'; 
    opp.closedate = system.today();
     opp.stage = 'prospecting';  
      opp.accountid=opp.id;  
       insert opp;  
 
        if (opp.id!=null){    
         system.debug(opp.id);   
             }     
        }     
    }   
  }     
Hello, I am having trouble finding a way to pull aggregate data from the below Apex class that I have for a component being built. We need to record the count of Id's and Total units from the child record ChildAccounts. I am relatively new to coding and so any information and help would be greatly appreciated!
 
public with sharing class GetAccountContactData {
    @AuraEnabled(cacheable=true)
    public static List<Account> getAccountData() {
        return [SELECT Id, Name, 
        (SELECT Id, Name, Email, Phone, Title FROM Contacts), 
        (SELECT Id, Name, Region_picklist__c, Total_Units__c FROM ChildAccounts) 
        FROM Account WHERE Active__c = TRUE AND RecordTypeId = '0122K000001Dio1QAC' ORDER BY Name];
    }
}

 
public with sharing class Auracsv {
    @AuraEnabled
    public static void processData(String fileData,String sobjectName,List<String> fields) {
        
        Schema.SObjectType targetType = Schema.getGlobalDescribe().get(sobjectName);
        try{
            if(fileData!=null){ 
                String[] fileLines = new String[]{};
                    fileLines = fileData.split('\n');
                    
                List<sObject> myList = new List<sObject>();
                for (Integer i=1,j=fileLines.size();i<j;i++){
                    String[] inputvalues = new String[]{};
                        inputvalues = fileLines[i].split(',');
                    sObject obj = targetType.newSObject();
                    integer rowsize=inputvalues.size();
                    
                    for(integer l=0;l<rowsize-1;l++){
                        system.debug('fields.get(l)'+fields.get(l)); 
                        if(String.isNotBlank(inputvalues[l]) )
                        {
                            String value= inputvalues[l].length()>255 ? inputvalues[l].substring(0,254) : inputvalues[l];
                            obj.put(fields.get(l),value);
                        }else{
                            obj.put(fields.get(l),'');
                        }
                           
                    }
                    myList.add(obj);   
                }
                insert myList;
            
            }
            
        }catch(Exception e){
            System.debug('exception'+e);   
        }  
    }
    
    @AuraEnabled
    public static List<Map<string,string>> getObjectList()
    {
        List<Map<string,string>> SObjectList = new List<Map<string,string>>();
        
        for(Schema.SObjectType objTyp : Schema.getGlobalDescribe().Values()){
            String name = objTyp.getDescribe().getName();
            SObjectList.add(new Map<string,string>{'label'=>name,'value'=>name});
            System.debug('name'+name);
            
        }
        return SObjectList;  
        
    }
    
    @AuraEnabled
    public static List<Sobject> updateData(string objectName, string file){
        system.debug('Json : '+file+'----------'+objectName);
        Blob json = EncodingUtil.base64Decode(file);
        system.debug('Json file : '+json.tostring());
        String[] fileLines = json.tostring().split('\n');
        string[] headers = fileLines[0].split(',');
        List<Sobject> objectList = new List<Sobject>();
        for(integer i=1; i<fileLines.size() ;i++){
            string[] rows = fileLines[i].split(',');
            sObject sObj = Schema.getGlobalDescribe().get(objectName).newSObject();
            for(integer j=0;j<headers.size();j++){
                sObj.put(headers[j].trim(), rows[j].trim());
            }
            objectList.add(sObj);
            
        }
        system.debug('Object : '+objectList);
        insert objectList;
        return objectList;
    }
}

Heres my WIP test class code====

@isTest
public class TestAuracsv {
    public static String[] csvFileLines;
    public static Blob csvFileBody;
    
     @TestSetup
    static void Accountdata(){
        Account acc = new Account();
        acc.Name = 'Lokesh';
        acc.AccountNumber = '56293723';
        acc.Type = 'Other';
        acc.Industry = 'Chemicals';
        insert acc; 
    }
    @IsTest
    static void testmethod1(){
        Account acc = new Account();
        acc.Name = 'Lokesh';
        insert acc;
        
        Test.startTest();       
        csvFileBody = Blob.valueOf(str);
        String csvAsString = csvFileBody.toString();
     
        AccountListController.updateData('Account', EncodingUtil.base64Encode(Blob.valueOf(str)));
        AccountListController.getObjectList();
         
    }
}

As I'm newbiee.There are some errors in test class and I'm trying to clear that.

 
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setMethod('GET');
req.setEndpoint('https://demo1691926.mockable.io/Api12');
req.setHeader('Content-Type', 'application/json');
HttpResponse response = h.send(req);
system.debug('response  : '+response.getBody());
String json1= response.getBody();
DesearlizingJson desearilize1=(DesearlizingJson) Json.deserialize(json1,DesearlizingJson.Class);
System.debug('Phone is' +desearilize1.phone);
System.debug('name  is' +desearilize1.name);


Wrapper class
public class DesearlizingJson {
    public Decimal phone;
    public String name;
    public Decimal mobile;

}
json:
{
 "Phone":75645433221,
 "name":"var",
 "mobile":8766555544
 }
ouput is:
phone is :87675565
name is  : varsha


i need help how to retrieve (i,e Expected output:)
phone:8898999
name:varsha 

i,e how to retrive both key and its corresponding value in debug log

Thanks in Advance 
 
public class EmployeeController {
    
    @AuraEnabled
    public static list<Map<String,Object>> getLightningPickListValues(String fieldName, string objectName) {
        list<Map<String,Object>> returnList = new list<Map<String,Object>>();
        try {
            returnList.add(new Map<String,Object>{'label'=>'--Select--','value'=>'--Select--'});
            Map<String, schema.SObjectField> feildMap = Schema.getGlobalDescribe().get(objectName.trim()).getDescribe().fields.getMap();
            list<Schema.PicklistEntry> values = feildMap.get(fieldName.trim()).getDescribe().getPickListValues();
            for (Schema.PicklistEntry obj : values) {
                returnList.add(new Map<String,Object>{'label'=>obj.getLabel(),'value'=>obj.getValue().remove('\'').escapeUnicode()});
            }
            System.debug('MAP with FEILD TYPE : '+returnList);
        } catch (Exception e) {
            System.debug('Error in lightning picklist values : '+e.getMessage()+' at line no :'+e.getLineNumber());
            
        }
        return returnList;
    }
    
    @AuraEnabled
    public static List<Map<string,object>> getEmployee(string typeEmployee){
        List<Map<string,object>> returnList = new List<Map<string,object>>();
        Map<string,string> imageMap = new Map<string,string>();
        List<employee__c> employeeList;
        if(typeEmployee == 'All'){
            employeeList = [select id, name,Date_of_Birth__c,Mobile__c,Blood_Group__c from employee__c];
        }else{
             employeeList = [select id, name,Date_of_Birth__c,Mobile__c,Blood_Group__c from employee__c where Department__c =:typeEmployee ];           
        }
        Set<Id> tempSet = new Set<Id>(); 
        for(employee__c emp : employeeList){
            tempSet.add(emp.Id);
        }
        system.debug('Temp Set : '+tempSet);
        for(ContentDocumentLink doc : [SELECT Id, ContentDocumentId, ContentDocument.LatestPublishedVersionId,ContentDocument.LatestPublishedVersion.Title,LinkedEntityId FROM ContentDocumentLink WHERE LinkedEntityId In :tempSet]){
            imageMap.put(doc.LinkedEntityId,doc.ContentDocument.LatestPublishedVersionId);
        }
        for(employee__c emp : employeeList){
            string imageUrl = imageMap.get(emp.Id) == null ? 'https://img.lovepik.com/original_origin_pic/19/01/17/ffea3ab99d95aca466f5c9f3ccb6a7f3.png_wh300.png' : 'https://emorphis-b-dev-ed.my.salesforce.com/sfc/servlet.shepherd/version/download/'+imageMap.get(emp.Id);
            returnList.add(new Map<string,object>{
                'Name'=>emp.name,'Date_of_Birth__c'=>emp.Date_of_Birth__c,'Mobile__c'=>emp.Mobile__c,'Blood_Group__c'=>emp.Blood_Group__c,'Image'=>imageUrl
            });
        }        
        return returnList;
    }
    
     @AuraEnabled
    public static List<employee__c> updateEmployee(List<employee__c> dataList , string file){
        system.debug('Data before update : '+dataList);
        upsert dataList;
        if(string.isNotBlank(file)){
            ContentVersion conVer = new ContentVersion();
            conVer.ContentLocation = 'S'; 
            conVer.PathOnClient = 'testing.jpg'; 
            conVer.Title = 'Testing Files'; 
            conVer.VersionData = EncodingUtil.base64Decode(file); 
            insert conVer;    
            
            
            Id conDoc = [SELECT ContentDocumentId FROM ContentVersion WHERE Id =:conVer.Id].ContentDocumentId;
            ContentDocumentLink conDocLink = New ContentDocumentLink();
            conDocLink.LinkedEntityId = dataList[0].Id;
            conDocLink.ContentDocumentId = conDoc; 
            conDocLink.shareType = 'V';
            insert conDocLink;
        }
        system.debug('Data after update : '+dataList);
        return dataList;
    }
    
    @AuraEnabled
    public static void deleteEmployee(string recordId){
        system.debug('recordId : '+recordId);
        delete[select id from Employee__c where Id = : recordId ];
    }
    
}

Test Class=============(Percentage- 95%, Wanted percentage- 100)

@isTest
public class EmployeeControllerTest {
    
    @TestSetup
    static void makeData(){
        Employee__c emp = new Employee__c();
        emp.Name = 'Lokesh';
        emp.Blood_Group__c = 'B+';
        emp.Department__c = 'All';
        emp.Date_of_Birth__c = Date.today();
        insert emp;
        
        ContentVersion conVer = new ContentVersion();
        conVer.ContentLocation = 'S'; 
        conVer.PathOnClient = 'testing.text'; 
        conVer.Title = 'Testing Files'; 
        conVer.VersionData = EncodingUtil.base64Decode('file'); 
        insert conVer;    
        
        
        Id conDoc = [SELECT ContentDocumentId FROM ContentVersion WHERE Id =:conVer.Id].ContentDocumentId;
        ContentDocumentLink conDocLink = New ContentDocumentLink();
        conDocLink.LinkedEntityId = emp.Id;
        conDocLink.ContentDocumentId = conDoc; 
        conDocLink.shareType = 'V';
        insert conDocLink;
    }
    
    @IsTest
    static void testMethod1(){
        EmployeeController.getLightningPickListValues('Department__c', 'Employee__c');
        EmployeeController.getEmployee('All');
        Employee__c emp = new Employee__c();
        emp.Name = 'Lokesh';
        emp.Blood_Group__c = 'B+';
        emp.Date_of_Birth__c = Date.today();
        String file = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATQAAACkCAMAAAAuTiJaAAAAolBMVEX39/fNAADRAAD5///NAwP4+/vPAADJAADNBAT39vbNCQn4/Pv28fH5//7OGBjOExP17Oz05+fij4/QKCjPHh7y3d3SERHTGBjVLi7SDQ3UIyPXPT3w19fuzc3y4uLswsLYTU3qs7PffHzSPz/RMzPrvb3edXXbWlrZamrYX1/hlJTRLy/mo6Por6/ZU1PWOTnghYXlnp7TRkbYZWXggYHhenq2EDuzAAAYI0lEQVR4nO1dC3uiSLNOdduNggEFREBRFOUiiorm//+1U9Ukk8xszJDv7Gw0Y+0+szMTyUKlLu9bl+bh4S53uctd7nKXu9zlLne5y13ucpe73OUuNyMC5avv4cZE8Nl6se3f1dZaBO8tMiZZEAzvWmsnwhgdAhl2mOfsva++mZsQwR92W2AsDh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h9Aca70ntSLdC2/kmDK805BTlrcGzx8dvTv6UYmyVlvnZHNdCbQVLmnYMxk3TcLQtbvUfr2wkt/rBWG1t0GMaJ3j6TJB1lZTJt9UbA7yh0oPOYXTit8lVopgDTZaA8k15xVG+/XwmjtYi1zALmf/whxGRLhonWIZ9kqSwOs9uYj/pT0gsZ68jR5Q+gke1W6JcFGpgn8Rc7+sxbLr6lGBvKBBcH2A11rE/ls/KsXg012d1yu/ffEjGgVPD0/rA3F9ty6SkAvGdsFR9HbY6I/AuE2+F44r8TosSjavcyP6W3QjnhObruAez/UpAVnMb/YFIUyWI6vENV/CXLo78PxH4kYr/8tVNgGNNUNUmaF6pkV7fi9eUidv7Pr+QT/XUiWe2UFYWzbHHX2HuCQf7NaRliNlb2ZTLpFIvePfS/KyKyw+UbpU3rHb112ExbnUP3t4rgvTfjt2IKbDKxp/fI/xnpr+dDftfYJ+Urztu6y13ucpe73OUud7nLXe5yl7vc5S53uctn5P8A9RPNftqy6HMAAAAASUVORK5CYII=';
        EmployeeController.updateEmployee(new List<Employee__c>{emp}, EncodingUtil.base64Encode(Blob.valueOf(file)));
        EmployeeController.deleteEmployee([select id from Employee__c limit 1].Id);
    }
}
Hello, I keep getting an ApexApplication email saying:

Failed to invoke future method 'public static void UploadDocument(String)' on class 'S3Controller' for job id '7073l0000FSMaBy'

caused by: System.LimitException: Query of LOB fields caused heap usage to exceed limit.



The line of code that is causing the error is this:
List<ContentVersion> versions=[SELECT VersionData,Title,ContentDocumentId,FileExtension FROM ContentVersion WHERE ContentDocumentId = :ids AND IsLatest = true];

How can I change my code so that if that error comes up, I still query the files but ONLY query the 1st file (as a way of avoiding the error)?


I TRIED this:

        List<ContentVersion> versions = new list<contentversion>();
        try{
        versions=[SELECT VersionData,Title,ContentDocumentId,FileExtension FROM ContentVersion WHERE ContentDocumentId = :ids AND IsLatest = true];
        }
        catch (exception e){
            versions=[SELECT VersionData,Title,ContentDocumentId,FileExtension FROM ContentVersion WHERE ContentDocumentId = :ids AND IsLatest = true limit 2];
        }

BUT it didn't work. I am still getting the same ApexApplication error email. 
@testSetup
    static void setup() {
        List<Account> accounts; 
        
        // get some account Ids -- we will just create a couple of dummies
        
        System.debug ('AccountProcessorTest.setup() entered');
        try {
             accounts.add (new Account (name = 'who cares'));
             accounts.add (new Account (name = 'who cares 2'));
             insert accounts;
             System.debug (accounts.size() + ' accounts created');
        }
        catch (Exception e) {
           System.debug('The following exception of type ' + e.getTypeName() + ' has occurred: ' + e.getMessage());
        }

The method consistently fails at the first accounts.add() call.  

09:37:52:002 USER_DEBUG [19]|DEBUG|The following exception of type System.NullPointerException has occurred: Attempt to de-reference a null object

There are no validation rules on account.   I can create this account via the UI supplying nothing but the name.

thanks in advance
public class UpdateOpportunity {
    public static void descriptionUpdate() {
        List<Opportunity> opp = [SELECT  Id,Name,Description From Opportunity WHERE StageName='Closed Won'limit 5];
        System.debug(opp);
        for ( Opportunity opps :opp)
        { 
            if(opps.Description == Null){
                opps.Description = 'This Opportunity is converted into Account';
            }
            else if(opps.Description == ''){
                opps.Description = 'This Opportunity is converted into Account';
            }
        }
              Update opp;
    }
}
  • July 29, 2021
  • Like
  • 0

Hi,
I have Contact object with Team Member as child object. The sum of all the allocations of Team Members under a certain contact cant exceed 100.  
This helper class is not working properly. Please advise:

 

public class TrigAllocToTeamHandler {
    public static void chkTeamAlloc(List<Team_Member__c> teamList){
        
        for(Team_Member__c tm:teamList){
        List <Team_Member__c> tms = [SELECT ID, Allocation_to_Team__c FROM Team_Member__c 
                                     WHERE Contact_Resource__c =:tm.Contact_Resource__c];  
                                       
            Integer sum=0;
         
        for (Team_Member__c teamMem:tms){
            sum += Integer.valueOf(teamMem.Allocation_to_Team__c);
            if(sum < 100){
                tms1.add(teamMem);
            }
            else{
                tm.addError('Total allocation to all the Teams cant be more than 100%');
                break;
            }            
        }
    }
    }

}

Hi Everyone.
I want to add colors to LWC standard Lightning datattable. Please let me know how to add. 
<div class="slds-m-top_small slds-m-bottom_xx-large" >
                        <c-custom-type-component
                            class="POdataTable" 
                            key-field="Id" 
                            data={POrecords}
                            columns={columns} 
                            onrowselection={selectedRecord}  
                            selected-rows={preSelectedRows}
                            onsave={handleReturnQuantity}
                            draft-values={saveDraftValues} 
                            onclick={removeInlinePopover}
                            oncancel={clearSelecteData}
                            min-column-width="120"
                            onrowaction={getPopUpInfo}
                            suppress-bottom-bar={supp}
                            onpicklistchanged={picklistChanged}
                        ></c-custom-type-component> 
                    </div>

-----JS----
{label:'PO#', fieldName:'PO_Number__c', type:'text',class : "POdataTable", innerWidth:120, cellAttributes: 
        { class: 'slds-text-color_success slds-text-title_caps slds-color__background_gray-5'}
    },-------- so on columns
-------CSS-----
.THIS {
}
.THIS .POdataTable thead th span { 
background-color: #2a5596; 
color: white;
}
Hello!

I am looking to do a trigger on the task that would send values to a custom object (Comments History). The custom object should inherit the following fields from the task: Comments, Subject, Name,  Created by, Related to.

Any help with a trigger would be great.

Thanx!
i want to change owner through trigger on new record when industry = agriculture else shows error

Please anyone give me code for this
i have tried this much

trigger changeownerTrigger on Account (before insert) {

    for(Account ac: trigger.new){
        
        if(ac.Industry=='Agriculture')
            
    }
}
Creating a formula field based on the age band based on the individual age from number 3 and above , Based on the table


AGe  Age Band
1     <20

2    <20

3     <20

4 <20

5 <20

6 <20

7 <20

8 <20

9 <20

10 <20

20 20-24

21 20-24

22 20-24

23 20-24

24 20-24

25 20-24

26 25-29

27 25-29

 
How do I insert a Line break to a visualforce page?

I've tried <br/> /p \n /n

I'm also using apex:outputPanel in our decision letter and haven't found a way to insert some breaks.
Please Check the image and Tell me where I did mistake plz
I have just given only one text field of student name but I'm getting double...Please help
Hi everyone,am trying to create a contact related to paritcular account in lightning .tried so far..,and embeded this component in accountrecord page ,but unable to save. can someone help me out .

Thanks in Advance.
apex:
public class QuickCreatecontact {
@AuraEnabled
    public static void createcontact(contact con,Id AccountId){
        con.AccountId=AccountId;
        insert con;
    }
}

component:
<aura:component controller="QuickCreatecontact" implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction" access="global" >
    <aura:attribute name="createcontact" type="contact"/>
    <aura:attribute name="accountId" type="string"/>
   <!-- <aura:handler name="init" value="{!this}" action="{!c.doinit}"/>-->
    <div>
        <lightning:input type="text" name="{!v.createcontact.LastName}" label="Enter LastName" />
        <lightning:input type="text" name="{!v.createcontact.FirstName}" label="Enter firstName"/>
        <lightning:input type="phone" name="{!v.createcontact.phone}" label="Enter phone"/>
        
    </div>
    <div>
        <lightning:button label="save" variant="brand" onclick="{!c.dosave}"/>
     </div>
</aura:component>

js:
({
    dosave : function(component, event, helper) {
        var action=component.get("c.createcontact");
        action.setParams({
            con:component.get("v.createcontact"),
            Id:component.get("v.accountId")
        });
        action.setCallback(this,function(response){
            var state=response.getState();
           
            if(state==='SUCCESS'){
                var result=response.getReturnValue();
               alert('SUCCESS');
                
               
            }else if(state==='INCOMPLETE'){
                
            }
        });
        $A.enqueueAction(action);
    }
})
Hi friends and devs, I created a Text field named Teacher Name but it's showing two text fields with the name "Teacher name"... BTW I have checked the box that that field should be a must.
 
 I have just started my salesforce journey so I'm sorry If my doubt is too silly but please help me
Hi there!

I've tried to test my query Account class but in vs code it displays : 
=== Test Summary
NAME VALUE
─────────────────── ───────────────────────
Outcome Skipped

Here is my class & my class test, if someone gets an idea? 
public with sharing class FA_QR_Account {
    public FA_QR_Account() {

    }
    
    public Map<Id,Account> getAccountsByIds(set<Id> setAccountIds) {
        Map<Id,Account> mapAccountId = new Map<Id,Account> ([
            SELECT Id, Chiffre_d_affaire__c 
            FROM Account 
            WHERE Id in:setAccountIds 
        ]);

        return mapAccountId;
    }

}


 
@isTest
public class TestFA_QR_AccountTest 
{ 
    @isTest
    static testMethod void testgetAccountsByIds() 
	{
		
        // Add all required field
        Map<Id,Account> mapAccountId = new Map<Id,Account>;
        for(String count =0; count<0; count++){
           mapAccountId.add(new Account (Name = 'Jack'+count, Chiffre_d_affaire__c = '20000', Id = '0011U00000TFV7M' ,+count)); 
        }
        insert mapAccountId;
		

        Test.startTest();

		FA_QR_Account.getAccountsByIds();
		
        Test.stopTest();

        Account acc= [SELECT Id FROM Account LIMIT 1];
        
		System.assertEquals (String.valueOf(acc.Id),'0011U00000TFV7M' );
		
	}
}



 
Hi All,
I have created a visual force page to create a pdf in order object. Earlier it was worked fine but now I am facing this error:
"common.apex.runtime.impl.executionexception: sobject row was retrieved via soql without querying the requested field: order.ordernumber"

Here is my controller:
public class OrderPdf {
    public  Order ord{set;get;} 
    public OrderItem ordIt{set;get;}
    public Organization  org{set;get;}
    public  string rec;
    public OrderPdf(apexpages.StandardController sc){ 
        rec=apexpages.currentPage().getparameters().get('id');
  ord = [SELECT ID,AccountId,Customer_PO_Date__c,Customer_PO_Number__c,Delivery_Terms__c,Incoterms_2010_named_place__c,Payment_Terms__c,Port_of_Arrival__c,CurrencyIsoCode,Name,OrderNumber,EffectiveDate,Ship_Via__c,Supplier_Number__c,Account.CIN__c,Account.Email__c,Account.Phone,BillToContact.Email,BillToContact.Phone,TotalAmount,BillToContact.FirstName,BillToContact.LastName,account.name,account.billingcountry,account.billingcity,account.billingstate,account.billingPostalCode,account.billingStreet,account.shippingcountry,account.shippingcity,account.shippingstate,account.shippingPostalCode,
             account.shippingStreet,(select Product2Id,Product2.Name,OrderItemNumber,Product2.Description,Total_Price_Incl_GST__c,Quantity,Delivery_Date__c,HSN_Code__c,CAS_No__c,UOM__c,Description,UnitPrice,TotalPrice from orderItems) from order where id =: rec];  
    }
       public  pagereference SaveFile(){
         PageReference pdf = Page.OrderPDFAttachement;
           pdf.getParameters().put('id',rec);
           pdf.setRedirect(true);
          blob body =Test.isRunningTest() ? Blob.valueOf('UNIT.TEST'):pdf.getContentAsPDF();
          string filename = ' My File Name ';  
          ContentVersion conVer = new ContentVersion();
          conVer.ContentLocation = 'S'; // S specify this document is in SF, use E for external files
          conVer.PathOnClient = 'Attachment.pdf'; // The files name, extension is very important here which will help the file in preview.
          conVer.Title = String.valueOf('SOMU '+ string.valueof(system.today().format())+'.pdf'); // Display name of the files
          conVer.VersionData = body; // converting your binary string to Blog
          insert conVer;
          Id conDoc = [SELECT ContentDocumentId FROM ContentVersion WHERE Id =:conVer.Id].ContentDocumentId;
           ContentDocumentLink cDe = new ContentDocumentLink();
           cDe.ContentDocumentId = conDoc;
           cDe.LinkedEntityId =rec; // you can use objectId,GroupId etc
//cDe.ShareType = 'I'; // Inferred permission, checkout description of ContentDocumentLink object for more details
//cDe.Visibility = 'System Administrator';
           insert cDe;
           pagereference p=new pagereference('/'+rec);
           return p;
    }
    public  pagereference SendFile(){
          PageReference pdf = Page.OrderPdf;
          pdf.getParameters().put('id',rec);
         //  Blob b =pdf.getContentAsPDF();
          Blob b =Test.isRunningTest() ? Blob.valueOf('UNIT.TEST'):pdf.getContentAsPDF();
        ContentVersion conVer = new ContentVersion();
conVer.ContentLocation = 'S'; // S specify this document is in SF, use E for external files
conVer.PathOnClient = 'Attachment.pdf'; // The files name, extension is very important here which will help the file in preview.
conVer.Title = String.valueOf('SOMU '+ string.valueof(system.today().format())+'.pdf'); // Display name of the files
conVer.VersionData = b; // converting your binary string to Blog
insert conVer;
           Id conDoc = [SELECT ContentDocumentId FROM ContentVersion WHERE Id =:conVer.Id].ContentDocumentId;
 //Create ContentDocumentLink
ContentDocumentLink cDe = new ContentDocumentLink();
cDe.ContentDocumentId = conDoc;
cDe.LinkedEntityId =rec; // you can use objectId,GroupId etc
//cDe.ShareType = 'I'; // Inferred permission, checkout description of ContentDocumentLink object for more details
//cDe.Visibility = 'System Administrator';
insert cDe;
        pagereference p=new pagereference('/'+rec); 
        return p;
           }    
}
---------------------------------------------------------------------------------------------
Visualforce page:
<apex:page extensions="OrderPdf" renderas="pdf" standardController="order" applyHtmlTag="false" applyBodyTag="false" showHeader="false">   
     <head>
        <style type="text/css">
            @page{
             size:21cm 29.7cm; 
              @bottom-right{
                content:"Page " counter(page) " of " counter(pages);
            }
            }
            
        </style> 
    <img src="https://somugroup--dev1.sandbox.file.force.com/servlet/servlet.FileDownload?file=0151s000000E4iq" style="background-color:#D3D3D3; width: 90px; height: 50px" align="left" /> <br/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

    </head>
    <tr>
         <td colspan= "2" align="left">        <br/> <span style="font-size: 14px;"><b>Contact: {!ord.BillToContact.FirstName}{!ord.BillToContact.LastName}</b></span></td> 
       <td style="font-size: 15px;text-align: right" width="5%">&nbsp; <b>Order:{!ord.OrderNumber} </b><br/></td>  
  
            </tr> 
      <table style="width:100%" border="0" cellspacing="0">          
        <tbody>
        <tr>
     <td colspan= "2" align="left">        <br/> <span style="font-size: 14px;"><b>{!ord.account.name}</b></span></td> 
            
            </tr>
            <tr><td >
       <span style="font-size: 15px;">{!ord.account.billingStreet}<br/>{!ord.account.billingcity}<br/>{!ord.account.billingstate}<br/>{!ord.account.billingPostalCode}<br/>{!ord.account.billingcountry}<br/>CIN#: {!ord.Account.CIN__c}<br/>Email: {!ord.Account.Email__c}<br/>Phone: {!ord.Account.Phone}<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><br/>
       </td>
       
       <table style="width:10%" border="1" cellspacing="0" align="right">
           <tr>
           <td style="font-size: 15px;text-align: center"  width="5%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <b>Type</b><br/></td>
           <td style="font-size: 15px;text-align: center"  width="5%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <b>Order</b><br/></td>
          <td style="font-size: 15px;text-align: center"  width="5%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <b>Order Date</b><br/></td>
          <td style="font-size: 15px;text-align: center"  width="5%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <b>Revision Date</b><br/></td>
           <td style="font-size: 15px;text-align: center"  width="5%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <b>Buyer</b><br/></td>

           </tr>
            <apex:repeat value="{!Order}" var="ort">
            <tr>
                
                <td style="font-size: 12px;" align="left" >Standard Purchase Order </td>
                <td style="font-size: 12px;" align="left"> {!ort.OrderNumber}</td>
                <td style="font-size: 12px;" align="left">
                <apex:outputText value="{0,date,dd'-'MM'-'yyyy}">
                  <apex:param value="{!ort.EffectiveDate}" /> 
                  </apex:outputText></td>
               <td style="font-size: 12px;" align="left">
                <apex:outputText value="{0,date,dd'-'MM'-'yyyy}">
                  <apex:param value="{!ort.PoDate}" /> 
                  </apex:outputText></td>
           <td style="font-size: 12px;" align="left" >SP </td>

             </tr>
              
              </apex:repeat>
       </table>
           
            </tr>
            
 <br/>
            <td >
             <span style="font-size: 15px;text-align: right">      <b>Somu Group Of Companies </b></span><br/>   
            <span style="font-size: 15px;text-align: right">      <b>No.20,Somu Centre,29th Main,BTM Layout, </b></span><br/>
            <span style="font-size: 15px;text-align: right">      <b>2nd Stage </b></span><br/>
            <span style="font-size: 15px;text-align: right">        Bangalore 560076</span><br/>
            <span style="font-size: 15px;text-align: right">        Karnataka   </span><br/>
            <span style="font-size: 15px;text-align: right">         India </span><br/><br/>
            </td>
                    <tr>
     <td colspan= "3" align="left">        </td> 
            
            </tr> 
            <tr><td >
<span style="font-size: 15px;"><b>Deliver To : </b> <br/>
                <span style="font-size: 15px;">{!ord.account.shippingStreet}<br/>{!ord.account.shippingcity}<br/>{!ord.account.shippingstate}<br/>{!ord.account.shippingPostalCode}<br/>{!ord.account.shippingcountry}<br/>&nbsp;</span><br/>
                </span><br/>        </td><td >
    <span style="font-size: 15px;text-align: right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   <b> Bill To : </b></span><br/>
<span style="font-size: 15px;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {!ord.account.billingStreet}<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb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nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   {!ord.account.billingcountry}<br/>&nbsp;</span><br/>                </td>
        </tr>
        </tbody>
</table>
         
      <br/> <table  style="width:100%" border="1" cellspacing="0">
   <tr>
        <td  style="background-color:#D3D3D3; font-size: 14px;" align="center" width="10%"><b>Account Number</b><br/></td>
        <td  style="background-color:#D3D3D3; font-size: 14px;" align="center" width="10%"><b>Supplier Number</b><br/></td>
        <td  style="background-color:#D3D3D3; font-size: 14px;" align="center" width="10%"><b>Payment Terms</b></td>
         <td  style="background-color:#D3D3D3; font-size: 14px;" align="center" width="10%"><b>Currency</b><br/></td>
         <td  style="background-color:#D3D3D3; font-size: 14px;" align="center" width="10%"><b>Inncoterms 2010 named place</b><br/></td>
         <td  style="background-color:#D3D3D3; font-size: 14px;" align="center" width="10%"><b>Ship via</b><br/></td>
        <td  style="background-color:#D3D3D3; font-size: 14px;" align="center" width="10%"><b>Port of Arrival</b></td>
        </tr>
          <apex:repeat value="{!Order}" var="ort">
            <tr>
               
                <td style="font-size: 12px;" align="left" >{!ort.account.name} </td>
                <td style="font-size: 12px;" align="left">{!ort.Supplier_Number__c} </td>
               <td style="font-size: 12px;" align="left">{!ort.Payment_Terms__c} </td>
               <td style="font-size: 12px;" align="left">{!ort.CurrencyIsoCode} </td>
                <td style="font-size: 12px;" align="left" >{!ort.Incoterms_2010_named_place__c} </td>
                <td style="font-size: 12px;" align="left" >{!ort.Ship_Via__c} </td>
                <td style="font-size: 12px;" align="left">{!ort.Port_of_Arrival__c} </td>
             </tr>
              
              </apex:repeat>
          </table>
     <br/> <table style="width:100%" border="1">
     <td style="background-color:#D3D3D3; font-size: 14px;" align="left" width="10%"><b>Confirm To: {!ord.BillToContact.FirstName}{!ord.BillToContact.LastName}</b><br/> </td> 
    <td style="background-color:#D3D3D3; font-size: 14px;" align="left" width="10%"><b>Email: {!ord.BillToContact.Email}</b><br/> </td>
   <td style="background-color:#D3D3D3; font-size: 14px;" align="left" width="10%"><b>Phone: {!ord.BillToContact.Phone}</b><br/> </td>
     </table>
     
     <br/> <table  style="width:100%" border="1" cellspacing="0">
   <tr>
        
         <td  style="background-color:#D3D3D3; font-size: 14px;" align="center" width="10%"><b>Product</b><br/></td>
         <td  style="background-color:#D3D3D3; font-size: 14px;" align="center" width="10%"><b>Delivery Date</b></td>
         <td  style="background-color:#D3D3D3; font-size: 14px;" align="center" width="10%"><b>Qunatity</b><br/></td>
         <td  style="background-color:#D3D3D3; font-size: 14px;" align="center" width="10%"><b>UOM</b><br/></td>
         <td  style="background-color:#D3D3D3; font-size: 14px;" align="center" width="10%"><b>CAS No</b><br/></td>
         <td  style="background-color:#D3D3D3; font-size: 14px;" align="center" width="10%"><b>HSN Code</b></td>
         <td  style="background-color:#D3D3D3; font-size: 14px;" align="center" width="10%"><b>Unit Price</b></td>
         <td  style="background-color:#D3D3D3; font-size: 14px;" align="center" width="10%"><b>Amount</b></td>
         <td  style="background-color:#D3D3D3; font-size: 14px;" align="center" width="30%"><b>Product Description</b><br/></td>

</tr>
          <apex:repeat value="{!ord.orderItems}" var="o">
            <tr>
                
                <td style="font-size: 12px;" align="left" >{!o.Product2.Name} </td>
               <td style="font-size: 12px;" align="left">
                <apex:outputText value="{0,date,dd'-'MM'-'yyyy}">
                  <apex:param value="{!o.Delivery_Date__c}" /> 
                  </apex:outputText></td>
                 <td style="font-size: 12px;" align="left"><apex:outputText value="{0, number, ###,###}">
                          <apex:param value="{!o.Quantity}" />
                          </apex:outputText><br/></td>
                <td style="font-size: 12px;" align="left" >{!o.UOM__c} </td>
                <td style="font-size: 12px;" align="left" >{!o.CAS_No__c} </td>
                <td style="font-size: 12px;" align="left">{!o.HSN_Code__c} </td>
               <td style="font-size: 12px;" align="left">{!o.UnitPrice} </td>
               <td style="font-size: 12px;" align="left">{!o.Total_Price_Incl_GST__c} </td>
                <td style="font-size: 12px;" align="left">{!o.Product2.Description} </td>
</tr>
              </apex:repeat>
              <tr>
   <td style="font-size: 14px;" colspan="7" align="Right">
            <b>Grand Total</b>
            </td>
            <td style="font-size: 12px;" align="left">{!ord.TotalAmount}
            </td>
     <td style="font-size: 12px;" align="left">
            </td><td style="font-size: 12px;" align="left">
            </td>
      </tr>
          </table>
          <table style="width:100%" border="0" cellspacing="0" >
          </table>  
</apex:page>
Any idea how to avoid this? Even that field was in query.

Thanks,
Kezia
Hi all,
I would like to make a query through a lightning component.
This component should have some input parameters like fields to choose/insert (SELECT), object selection/input (FROM), and maybe a where condition.

Then, I would like to display the query result in another page.

I don't know how to insert parameters in a lightning component, pass them to a controller and make a query.

Is that possible? Could you give me some advise?

Thank you very much, any help would be very appreciated.

Raul

 
Hi,
How can we use different test class method for the corresponding apex class method?
I am 2010 graduate (Bachelor of computer application) and now i want to start my career in salesforce developer, Is this a good decision and after long gap my profile accpet by company as a Salesforce Developer.
What is the best for me to start as a Salesforce Admin OR Salesforce Developer.

Thanks,
Suraj Singh
I need to create a calendar in a custom object to show the current month in a grid view and then perform some actions related to the custom object.
I have a custo object  Business. and i have a field  'Amount' on this object. On Account i want to display average of this  'Amount' field. I have created a Roll Up on Account but it was giving only Count , SUM,MIN,MAX. Then How to calculate Average? for this
  • November 22, 2013
  • Like
  • 1
We have a public site and we want to get the site logo from the document. The associated Document record is not returned on querying by a guest user with user license "Guest User". But it returns a row if internal SF user queries for the same. Can you please suggest a solution for the same?
Hi Team,

I have an object called Leave Tracker, where users enter the leave date, reason, and number of hours, user can create more than one record in a day with different hours, ex: 1 entry with 2 hours and another entry with 4 hours. but my request is that we should not allow a user to create/update a leave tracker record if the leave hours are more than 8 in a single day per user?

any help is appreciated.

Thanks,
Madhu