• Rodrigo RESENDIZ
  • NEWBIE
  • 40 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 6
    Replies
Hi,

I am making an apex rest callout and I am getting a list of objects
 
if (response.getStatusCode() == 200) {
            List<Object> results = (List<Object>) JSON.deserializeUntyped(response.getBody());
            // Cast the values in the 'equipements' key as a list
            List<Object> equipements = (List<Object>) results;
            System.debug('Received the following equipements:');
            for (Object equipement : equipements) {
                System.debug(equipement.get('cost'));

and I am getting an error "Method does not exist or incorrect signature: [Object].get(String)" when I try to access an ojbect field.

Here is an exemple of an object :
 
{_id=55d66226726b611100aaf741, cost=5000, lifespan=120, maintenanceperiod=365, name=Generator 1000 kW, quantity=5, replacement=false, sku=100003}
What is the right way to do it ?

Thanks a lot.

 
There was an unhandled exception. Please reference ID: RSWYBWWF. Error: Faraday::ClientError. Message: BAD_REQUEST: Specify a valid value for the source parameter. Lightning Experience Experience Super badge Stpep 7
I Designed this trigger to send emails to those who register in object="Bill__c" with custom template="Billa"
I cant see any thing wrong with it, But it isnt working...

trigger MailT on Bill__c (after insert) {
   Bill__c inquery = trigger.new[0]; 
  String[] toAddresses = new String[] {inquery.Email_Id__c}; 
  Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();

  mail.setTargetObjectId(inquery.Id);
  mail.setSenderDisplayName('Salesforce Support');
  mail.setUseSignature(false);
  mail.setBccSender(false);
  mail.setSaveAsActivity(false);

 if (Trigger.isInsert) { 
 
          EmailTemplate et=[Select id from EmailTemplate where DeveloperName=:'Billa'];
          mail.setTemplateId(et.id);
          Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});   
     
   }
}
Hi,

I am making an apex rest callout and I am getting a list of objects
 
if (response.getStatusCode() == 200) {
            List<Object> results = (List<Object>) JSON.deserializeUntyped(response.getBody());
            // Cast the values in the 'equipements' key as a list
            List<Object> equipements = (List<Object>) results;
            System.debug('Received the following equipements:');
            for (Object equipement : equipements) {
                System.debug(equipement.get('cost'));

and I am getting an error "Method does not exist or incorrect signature: [Object].get(String)" when I try to access an ojbect field.

Here is an exemple of an object :
 
{_id=55d66226726b611100aaf741, cost=5000, lifespan=120, maintenanceperiod=365, name=Generator 1000 kW, quantity=5, replacement=false, sku=100003}
What is the right way to do it ?

Thanks a lot.

 
Hi All,

I am not able to complete the challenge "Mark Item as Packed" getting error message  The campingListItem JavaScript controller isn't setting the 'Packed' value correctly.

Below is the code, please help


<aura:component >

    <aura:attribute name="item" type="Camping_Item__c" required="true"/>
    <aura:attribute name="buttonDisabled" type="String" default="false"/>

    <p>Price:
        <ui:outputCurrency value="{!v.item.Price__c}"/>
    </p>
    <p>Name:
        <ui:outputText  value="{!v.item.Name}"/>
    </p>
    <p>Quantity:
        <ui:outputNumber value="{!v.item.Quantity__c}"/>
    </p>
    <p>Packed?:
        <ui:outputCheckbox value="{!v.item.Packed__c}"/>
    </p>
    
    <ui:button label="Packed!" press="{!c.packItem}" disabled="{! v.buttonDisabled}" />
    
</aura:component>

({
    packItem : function(component, event, helper) {
        component.set("v.item", { 'sobjectType': 'Camping_Item__c','Packed__c': true });
        component.set("v.buttonDisabled", "true");  
    }
})