• anshul saini 7
  • NEWBIE
  • 69 Points
  • Member since 2018

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 7
    Replies
Hi All,
        Can Anyone Provide me the Apex codes for the above winter 19 pd1 maintainces badge exam.......

Thanks in advance.....................
  • January 21, 2019
  • Like
  • 0
Looking for anyone encountering the same behaviour:
  • Via SFDX I created an Unlocked Package containing a few Flows and Processes
  • After installing the Package into a Partial Copy Sandbox for deployment testing, I cannot access the respective Flows and Processes any more.
  • When I click on them in the Flow or Process Builder, I receive the following error messages:
  • On a Process: "Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details. Error ID: 1099551912-258214 (2076307982)"
  • On a Flow: The Flow User-added imageIt reads: This page has an errir. You might just need to refresh it. [sourceElementContainer is not defined. It must be defined.] Failing descriptor:{markup//builder_platform_interaction:canvas]
  • Actions that trigger the flows or processes cause the respective flows to fail.
I have absolutely no idea what could cause this issue and hope for any pointers you guys can give me.

The packages were created using sfdx-cli/7.33.2-045d48473e win32-x64 node-v10.15.3 and "sourceApiVersion": "47.0"

Thanks!

Marvin
I currently have apex class in lightning component that is getting a specific Queue Id to assign as owner of the record the component is launched from.

This is the current  way I'm getting the id, but I'm guessing there is a better way to do this, any ideas?
Group marketingQueue = [SELECT id,Name FROM Group WHERE Type = 'Queue' and DeveloperNAME = 'MarketingProspectLeads'];
         	ID marketingQueueId = marketingQueue.id;
            //l.OwnerId = UserInfo.getUserId();
            system.debug('marketingQueue');
            l.OwnerId = marketingQueueId;

I just need to make sure this can't break so I'm assuming I should add some error checking or be doing this a different way.  Thanks in advance.  
Hi, how can i assign a candidate to particular recruiter on region basis. Like X is a recruiter of East region and if any candidate who is also from  East region is apply for a job  will assign to recruiter X.

Please help.

Thanks
Hi, I currently have the professional edition. I have two regional managers and they each have a team of salesmen, those salesmen have assigned accounts/opportunities, I want the regional managers to see their salesmen accounts ONLY. Is that possible without assigning them those accounts/opps?
Hi All,
        Can Anyone Provide me the Apex codes for the above winter 19 pd1 maintainces badge exam.......

Thanks in advance.....................
  • January 21, 2019
  • Like
  • 0
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?