+ Start a Discussion
Una ZUna Z 
We have some archived .json data as below, could we use Developper Console to create records in Salesforce?
Thank you!
{
"opp": {
"method": "POST",
"url": "/services/data/v37.0/sobjects/Opportunity",
"referenceId": "Opportunitiesopp_78537",
"body": {
"REMigrationData__c": "21",
"CampaignId": "7010G000000oVlTQAU",
"ReceiptStatus__c": "Do Not Receipt",
"Fund__c": "z-2100-z-Area of Greatest Need",
"HistoricalBatchNumber__c": "2007-86",
"HistoricalGiftID__c": "2007-63945",
"CloseDate": "2007-03-08T00:00:00",
"Close_Gift_Date__c": "2007-03-08T00:00:00",
"Name": " Donation 3/8/2007 12:00:00 AM",
"Amount": 44.6000,
"RecordTypeId": "012F0000001DAEg",
"AccountId": "0010G000028JUVGQA4",
"StageName": "Posted",
"npe01__Do_Not_Automatically_Create_Payment__c": true,
"GiftCode__c": "z-MIMF",
"GiftSubtype__c": "z-Donation (one-off)",
"Type": "Cash",
"npsp__Acknowledgment_Status__c": "To Be Acknowledged",
"TaxReceiptsNPSP__Receiptable_Amount__c": 44.6,
"TaxReceiptsNPSP__ReceiptQueue__c": "",
"Description": "\r\n",
"OppPayment_Payment_Method__c": "Cash",
"AuthorizationCode__c": null
}
Best Answer chosen by Una Z
Karan KeharKaran Kehar
You can do a rest callout from developer console to services/data/v37.0/sobjects/Opportunity and pass the data as body
Jay Choi 38Jay Choi 38 
Hi, I have error "Invalid field nme for SObject AggregateResult"
From VisualForce Page 

Here is my apex controller
public class BatchListController {
    public Id venue {get; set;}
    
    Public List<Batch__c> Batches = new List<Batch__c>();   
    Public AggregateResult[] agr {get{
        return [SELECT Name nme, count(Job__r.Id) cntid, count(Job__r.Name) cntnme, max(BatchDate__c) cntdt, count(VenueBatch__r.Name) cntvn FROM Batch__c GROUP BY Name];
        
        
    } set;}
    
    Public BatchListController() {
        system.debug('==>JobListController  is calling==>');
        Batches = [SELECT Name,Job__r.Id, Job__r.Name, BatchDate__c, VenueBatch__r.Name FROM Batch__c];
        
    }
    public List<Batch__c>getBatches(){
        
        return Batches;
    }
    public List<Batch__c>setBatches(List<Batch__c>temp){
        
        Batches = temp;
        return Batches;
    }
}

And here is my visualforce page 

<apex:page controller = "BatchListController">
    
    <apex:form>
    
    <apex:PageBlock title="Batch List" id="Jobs_List" >
        
        <apex:pageBlockTable value = "{!agr}" var = "a">
             
            <apex:column style="width:350px" headerValue="Batch" value="{!a['nme']}"/>
            <apex:column style="width:350px" headerValue="#of Jobs " value="{!a['cntid']}"/>
            <apex:column style="width:350px" headerValue = "# of Venue " value="{!a['cntvn']}"/>
            <apex:column style="width:350px" headerValue = "Batch Date" value="{!a['cntdt']}"/>
        </apex:pageBlockTable>
        
        </apex:PageBlock>
        
        <apex:pageBlock title = "Work Order" id = "Work_Order">
        
        
            
        </apex:pageBlock>
    
    </apex:form>
</apex:page>

I am dealing with this for an hour but I don't know where I am wrong. 
Thank you!!
Best Answer chosen by Jay Choi 38
Karan KeharKaran Kehar
Hi Jay,

You cannot use a['nme'] for aggregate result. You should use a.get('nme') in your apex assign it a propery and use in VF.

if this resolves your concern please mark this as best answer.!
Best Answer chosen by Priscilla Saram 1
AbhishekAbhishek (Salesforce Developers) 
No, it's not possible.

You can raise an Idea for it, Based on the Votes it can be implemented in the future.

I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.

Thanks.
Stephen VorisStephen Voris 
So, I'm trying to test out an app in our org's sandbox; I click 'get it now', it tells me I need to log in. Okay, makes sense, but then I get this: 
Screenshot of results after popup window reaches "login successful"

Closing the 'login successful' window punts the dialog box back to the 'please log in' screen.
This also happens in the production org, and with other apps; have pulled up the browser dev console and see two warnings (first one visible in the screenshot), but have not yet acted on them. 
Have successfully downloaded+installed apps from the AppExchange before, but not since July or so.
Am I doing something wrong here, will clearing the browser cache work, or is it something on Salesforce's end?
Best Answer chosen by Stephen Voris
ShirishaShirisha (Salesforce Developers) 
Hi Stephen,

Greetings!

I would suggest you to try it in the different browser as well as by clearing the browser cache in the current browser to test.

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
SN SFSN SF 
Hi ,

I am getting below exception when I click on SAVE& NEXT button on VF page . I have traced the logs for the user and all I could see is "/apex/Exception" in the logs and nothing else . There is no error captured and I am not sure what is the reason for throwing exception . Can someone help me on this?

User-added imageRegards,
SN
Best Answer chosen by SN SF
AbhishekAbhishek (Salesforce Developers) 
https://salesforce.stackexchange.com/questions/203914/see-full-vf-page-exception-vf-apex-exception

Your query is answered above and go through it.

I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.

Thanks.
ummeda vijayummeda vijay 
Hi All,

I  am getting below error can you help me what is the issue here ?


public class Emailsample 
{
     public static void sendMail(String address, String subject, String body) {
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {address};
        mail.setToAddresses(toAddresses);
        mail.setSubject(subject);
        mail.setPlainTextBody(body);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
    }
}

Passing values through Anonymous Window



String address ='vijayummeda35@gmail.com';
String subject ='Speaker confirmation for the session';
String body ='thank you for speaking at the conference really appericated';
EmailManager.sendMail(address, subject, body);
    
Best Answer chosen by ummeda vijay
SwethaSwetha (Salesforce Developers) 
HI Vijay,
Can you confirm the error you are seeing is "Variable does not exist: EmailManager" ?

If so, please change your apex class name from Emailsample to EmailManager

Your class should be 
public class EmailManager
{
     public Static void sendMail(String address, String subject, String body) {
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {address};
        mail.setToAddresses(toAddresses);
        mail.setSubject(subject);
        mail.setPlainTextBody(body);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
    }
}

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Prashant Kumar 438Prashant Kumar 438 
trigger InterviewTrigger on Interview__c (before insert, before Update, after update, after insert, after delete, after undelete, before delete) {
  if(Trigger.isAfter  && Trigger.isUpdate){
       InterviewSlotsTriggerHandler.sendColdFeetEmail(Trigger.oldMap, Trigger.newMap);
  }
}


// Handler class

public class InterviewSlotsTriggerHandler {

   public static void sendColdFeetEmail(Map<Id, Interview__c> oldIntMap, Map<Id, Interview__c> newIntMap){
        
        EmailTemplate emailTemp = [SELECT Id, Subject, Description, HtmlValue, DeveloperName, Body FROM EmailTemplate 
                                   WHERE Name = 'Cold Feet' LIMIT 1];   
        
        for(Interview__c inter : newIntMap.Values()){
            
            Interview__c oldInt = oldIntMap.get(inter.Id);
            if( (inter.Interviewee_didn_t_join__c == true) && (oldInt.Interviewee_didn_t_join__c == false) ){
                
                Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage(); 
                message.setTargetObjectId(inter.Application__r.Candidate__r.id);
                message.setUseSignature(false); 
                message.setBccSender(false); 
                message.setSaveAsActivity(false); 
                message.setWhatId(inter.Id);
                message.setTemplateID(emailTemp.Id);
                message.toAddresses = new String[] { inter.Candidate_Email__c};
                    System.debug('toAddresses '+message.toAddresses);
                Messaging.SingleEmailMessage[] messages = new List<Messaging.SingleEmailMessage> {message};
                    Messaging.SendEmailResult[] results = Messaging.sendEmail(messages);
                System.debug('results '+results);
                if (results[0].success) 
                {
                    System.debug('The email was sent successfully.');
                } else {
                    System.debug('The email failed to send: ' +  results[0].errors[0].message);
                }
            }
        } 
    } 



}

This Error I'm getting :    REQUIRED_FIELD_MISSING, Missing targetObjectId with template: []

Thanks in advance.
Best Answer chosen by Prashant Kumar 438
AnudeepAnudeep (Salesforce Developers) 
Hi Prashant - 

setTargetObjectId(targetObjectId) should only use the ID of the contact, lead, or user to which the email will be sent. Can you confirm if that id belongs to any of these three objects? Also, are you getting a valid value for inter.Application__r.Candidate__r.id?
Jay Choi 38Jay Choi 38 
Hi I am using Standard Controller with extension on it. 
But as soon as I add extension I got this error. 
"
Unknown property 'Job__cStandardController.PageNumber'
"
Here is my Apex Code

public class JobListController {
    public Id venue {get; set;}
    private final Job__c jobc; 
    
    public JobListController(ApexPages.StandardController stdController){
        
        this.jobc = (Job__c)stdController.getRecord();
    }
}

Here is my VisualForce Code 

<apex:page standardController="Job__c" extensions="JobListController">
    <apex:form >
        <apex:pageBlock title="Contacts List" id="Jobs_List" >
           
            
        <apex:pageBlockTable value="{! jobs}" var="jb">
            <apex:column style="width:350px" value="{!jb.JobId__c}"/>
            <apex:column style="width:350px" headerValue="Confirmation">
                <apex:inputField value="{!jb.Confirm__c}"/>
            </apex:column>
            <apex:column style="width:350px" headerValue="JobType">
                <apex:inputField value="{!jb.JobType__c}"/>
            </apex:column>
            <apex:column style="width:350px" headerValue="ServiceDate">
                <apex:inputField value="{!jb.ServiceDate__c}"/>
            </apex:column>
            <apex:column style="width:350px" headerValue="ServiceRep">
                <apex:inputField value="{!jb.ServiceRep__c}"/>
            </apex:column>
            <apex:column style="width:250px" headerValue="Campaign Name" value="{!jb.Opportunity__r.Name}"/>
            <apex:column style="width:250px" headerValue="Case Name" value="{!jb.Case__r.Reason}"/>
            <apex:column style="width:350px" headerValue="Venue">
                <apex:commandLink reRender="kiosk">
                            {!jb.Venue__r.Name}
                    <apex:param name="inputparam" value="{!jb.Venue__r.Id}" assignTo="{!venue}"/>
                </apex:commandLink>
                
                </apex:column>
            <apex:column style="width:350px" value="{!jb.ArtID__r.Name}"/>
        </apex:pageBlockTable>
            <!-- Pagination -->
        <table style="width: 100%"><tr>
            <td>
            <!-- Page X of Y -->
                Page: <apex:outputText
                value=" {!PageNumber} of {! CEILING(ResultSize / PageSize) }"/>
            </td>
            <td align="center">
            <!-- Previous page -->
            <!-- active -->
                <apex:commandLink action="{! Previous }" value="« Previous" rendered="{! HasPrevious }"/>
            <!-- inactive (no earlier pages) -->
                <apex:outputText style="color: #ccc;" value="« Previous" rendered="{! NOT(HasPrevious) }"/>
                &nbsp;&nbsp;
        <!-- Next page -->
        <!-- active -->
                <apex:commandLink action="{! Next }" value="Next »" rendered="{! HasNext }"/>
        <!-- inactive (no more pages) -->
                <apex:outputText style="color: #ccc;" value="Next »" rendered="{! NOT(HasNext) }"/>
                </td>
                <td align="right">
                    <!-- Records per page -->
                    Records per page:
            <apex:selectList value="{! PageSize }" size="1">
                <apex:selectOption itemValue="5" itemLabel="5"/>
                <apex:selectOption itemValue="20" itemLabel="20"/>
                <apex:actionSupport event="onchange" reRender="contacts_list"/>
            </apex:selectList>
    </td>
</tr></table>

        <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" /> 
 
        </apex:pageBlock>

        
          <apex:pageBlock >
                <apex:pageBlockTable Id="kiosk" value="{! Venue_Kiosks}" var="vk">
                    <apex:column value="{!vk.Name}"/>
                    <apex:column value="{!vk.Id}"/>
                 </apex:pageBlockTable>
            </apex:pageBlock>
        
        <apex:pageBlock >
        <apex:outputPanel id="kiosks"> 
     <apex:detail subject="{!$CurrentPage.parameters.cid}" relatedList="false" title="false"/>
 </apex:outputPanel> 
            </apex:pageBlock>
        </apex:form>
</apex:page>

I am dealing with error for 3 hours...but Can't figure out the reason. 
I really appreciate any help! Thank you
Best Answer chosen by Jay Choi 38
AnudeepAnudeep (Salesforce Developers) 
I believe it is because the property was not set in the controller. Please try adding pageNumber property in your apex class

I recommend taking a look at this answer
Michael MMichael M 
Is it possible to call a queueable apex class from a trigger? Asking because I need to pass my lead id in there... Can you please provide a simple example.. 
Best Answer chosen by Michael M
VinayVinay (Salesforce Developers) 
Hi Michael,

Below is a sample snippet
trigger testlead on Lead (after insert, after update) {
    Set<Id> leadIds = new Set<Id>();
    for(Lead l : Trigger.new) {
        if(test=123) {
            leadIds.add(l.Id);
        }
    }
    Test.Sendtest(leadIds);
}



@future (callout=true)  
public static void Sendtest(Set<Id> leadIds)

https://www.infallibletechie.com/2018/10/how-to-transfer-tasks-back-to-lead.html

Thanks,
Vinay Kumar
james feudojames feudo 
I want to include linkdin, twitter & facebook links with icon in email signatur in salesforce. is it possible?

Can anyone help me on this.
Best Answer chosen by james feudo
james feudojames feudo
I found my answer in this Link https://help.salesforce.com/articleView?id=000323965&type=1&mode=1