• ismael GACHA
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies
I am trying to deploy the xml package for Customer_Interaction__b.object using the workbench for this unit. However I deploy and get success message in workbench but cannot see any big object.
  • I did see on the unit page it says that the examples are written for api unit 41.0 but my workbench doesnt allow me to go beyond 40. Does this matter?
  • My trailhead playground is on winter 18.
  • Does it matter what the file name for the object and permission set? (I do have the package.xml)
  • I have tried with and without having 'Single package' selected in workbench deploy
  • I have double checked the workbench is logged into the correct org
User-added image
User-added image




 
Hello,

I am trying to complete the challenge for the Use Org & Session Cache module on Salesforce Trailhead. Here are the instructions:

In this challenge, you’ll write an Apex class that writes and reads a bus schedule from the org cache. Your method for reading the cache has to handle cache misses.
  • Create a partition called BusSchedule with 0 MB for the size of org cache and session cache. The 0 MB allocation enables you to test cache misses.
  • Create a public Apex class called BusScheduleCache.
  • Add this variable to the class: private Cache.OrgPartition part;
  • In the constructor, create a new instance of Cache.OrgPartition by passing it the partition name (local.BusSchedule). Assign this object to the class variable (part).
  • Add two public methods. a. The first method, putSchedule(), returns void and takes these parameters: String busLine, Time[] schedule. b. The second method, getSchedule(), returns a bus schedule as a time array (Time[]) and takes this parameter: String busLine.
  • Implement the putSchedule() method so that it stores the passed-in values in the org cache by using the partition class variable (part).
  • Implement the getSchedule() method so that it returns the schedule for the specified bus line by using the partition class variable (part).
  • Add logic to the getSchedule() method to handle cache misses. If null is returned for the cached value, getSchedule() should return the following default schedule as a Time array with two Time objects: one Time object value of 8am and another of 5pm. Use the Apex Time.newInstance() method to create the Time objects.
Here is my current code:
 
public class BusScheduleCache {   
    // Get partition
    private Cache.OrgPartition part;
    String partitionName = 'local.BusSchedule';
    
    public BusScheduleCache(String partitionName) {
		Cache.OrgPartition newpart = Cache.Org.getPartition(partitionName);
        part = newpart;
    }
    
    public static void putSchedule(String busLine, Time[] schedule) {
        Cache.Org.put(busline, schedule);
    }
        
    public static Time[] getSchedule(String busLine) {
        Time[] schedule;
        
        // Get a cached value
		Object obj = Cache.Org.get(busLine);
		// Cast return value to a specific data type
		Time t2 = (Time)obj;
        if (t2 != null) {
        	schedule.add(t2);
        }
        else {
            Time t3 = Time.newInstance(8,0,0,0);
            schedule.add(t3);
            Time t4 = Time.newInstance(17,0,0,0);
            schedule.add(t4);
        }        
        return schedule;
    }  
      
}



Here is the error I am receiving:

Challenge Not yet complete... here's what's wrong: 
The Apex Class BusScheduleCache is not properly implemented. Please follow the requirements and ensure everything is setup correctly

Can someone please help?
<!--campingListItem.cmp-->
<aura:component >
	<aura:attribute name="item" type="Camping_Item__c" required="true"/>

	<ui:outputText value="{!v.item.Name}" />
	<ui:outputCheckbox value="{!v.item.Packed__c}" />
	<ui:outputCurrency value="{!v.item.Price__c}" />
	<ui:outputNumber value="{!v.item.Quantity__c}" />
	<ui:button label="Packed!" press="{!c.packItem}"/>
	
</aura:component>
<!--campingListController.js-->
({
	packItem : function(component, event, helper) {
		var button = event.getSource().get("v.disabled");
		component.set("v.item.Packed__c", "true");
		component.set(button, "true");
	}
})
What am I doing wrong?

 
Hi, I am having trouble with the "Attributes and Expressions" module from trailhead.

Here is the challenge:
Create a Lightning Component to display a single item for your packing list.
  • Create a component called campingListItem that displays the name (ui:outputText) and the three custom fields using the appropriate output components.
  • Add an attribute named 'item' for type Camping_Item__c.
I created an component named campingListItem and this is the code:
<aura:component >
    <aura:attribute name="item" type="<my_domain>__Camping_Item__c"/>
    
    <ui:outputText value="{!v.item.Name}"/>
    <ui:outputCheckbox value="{!v.item.<my_domain>__Packed__c}"/>
    <ui:outputCurrency  value="{!v.item.<my_domain>__Price__c}"/>
    <ui:outputNumber value="{!v.item.<my_domain>__Quantity__c}"/>
</aura:component>

The error that I am getting is: "Challenge Not yet complete... here's what's wrong: 
The packingListItem Lightning Component's attribute tag doesn't exist or its attributes are not set correctly."

With this, I tried to create another component, with the name "packingListItem", but It didn't work.

Can anyone help me?

Thanks,