• Gaurav Sadhwani
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies
Hi, 
I am working on a scan application for the Salesforce1 mobile app. To switch between the apps (salesforce1 -> scan app and scan app -> salesforce1), we are leveraging deep link technique. On callback (scan app -> salesforce1), I am redirecting to VF page through "scan://scan?callback=domainName/apex/VFPageName?parameters". 
Its working fine for Andriod devices but in iOS, navigating from scan app -> salesforce1 is not working and is getting redirected to safari browser.
We did some research and found the iOS framework does not support "Deeplink" or "URI Scheme".
Anyone else faced this issue and have a workaround?

I have created a lightning component
I am displaying my data in a Lightning data table format
User-added imageNow, I want to create 3 tables to display these 3 records seperately.
i.e I want a table to show the details of Service Name A , And similary for Service Name B & C 
At the end of all the three tables I want to show the Sum of Total Cost & Effort.

How can I create 3 data table in a single component to display  3 records seperately

Apex Controller:

public with sharing class ASDcompanyapex
{
    @AuraEnabled
    public static List<Service_Line__c> getServiceLine(string recordId) 
    {
        List<Service_Line__c> ServiceLineList =[Select Name, Status__c, Line_Type__c, Total_Effort_Taken__c,Total_Line_Cost__c  from Service_Line__c where Service_Request__c =: recordId];
        system.debug(ServiceLineList);
            
            return ServiceLineList;
            
        
    }
}
Component:
<aura:component controller="ASDcompanyapex"  implements="force:appHostable,force:hasRecordId,flexipage:availableForAllPageTypes" access="global">
    
    <aura:attribute name="recordId" type="Id" />
    <aura:attribute type="Service_Line__c" name="ServiceLineList"/>
    <aura:attribute name="mycolumns" type="List"/>
    <aura:attribute name="data" type="List"/>
    
    <aura:handler name="init" value="{!this}" action="{!c.servicelist}"/>
    
    
    <lightning:datatable data="{! v.data }"
                         columns="{! v.mycolumns }"
                         keyField="id"
                         hideCheckboxColumn="true"/>

</aura:component>

Controller:
({
    servicelist : function(component, event, helper) {
        var rid = component.get("v.recordId");
        
        helper.fetchServiceLineHelper(component, event, helper);
    }
})

Helper:
({
    fetchServiceLineHelper : function(component, event, helper) {
        debugger;
        var action = component.get("c.getServiceLine");
        var rec = component.get("v.recordId");
        action.setParams({
            "recordId": rec
        });
        action.setCallback(this, function(response){
            debugger;
            var state = response.getState();
            
            debugger;
            if (state === "SUCCESS") {
                
                component.set('v.mycolumns', [
                    {label: 'Service Line Name', fieldName: 'Name'},
                    {label: 'Status', fieldName: 'Status__c'},
                    {label: 'Line Type', fieldName: 'Line_Type__c'},
                    {label: 'Total Effort', fieldName: 'Total_Effort_Taken__c', type: 'number', cellAttributes: { alignment: 'left' }},
                    {label: 'Total Line Cost', fieldName: 'Total_Line_Cost__c', type: 'currency'},
                    
                ]);
                    
                    debugger;
                    var res = response.getReturnValue();
                    component.set("v.data" , res);
                    debugger;
                    
                    
                    }
                    
                    
                    });
                    $A.enqueueAction(action);
                    }
                    })
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?
Hi Experts,
     I would like to know the exact difference between 15 and 18 digits record id. Most of us say, 15 digit(case sensitive) and 18 digit(case insensitive).

Let's consider a small example,
While if you query record from Developer Console you will get 18 digit record id. Consider the below retrieved 18 digit id,

001i000001AWbWuGTA(Retrieved from query)

If 18 digit case insensitive means,

001i000001AWbWugta (this id same to the above retrieved ID)? If yes, then if you queried record with this id means, you will get no result or no rows found..!

So if both 15 and 18 are unique means what is the real time use and difference between these two ID's.

Thanks in advance..!

I have a class, called from a trigger which fills a private static List variable declared at the class level. At the end of the class a @future method is called who'se only line is to insert the List. ApexJobs lists it as completed but in the debug logs i can't actually see the insert call and of course the records are not being inserted.

 

So is it even possible to call insert on a class level static List of records be inserted by a @future methods? I know an @future method can insert a List, but usually the list is created from within the @future method itself.

 

Thanks, 

Jesse