Using .KeySet() on a map, we will get a list of all the keys returned.
Map<Id, Master_Obj__c> masterMap = new Map<Id, Master_Obj__c>([SELECT Id, Name FROM Master_Obj__c]);
List<Detail_Obj__c> objDetailList = [Select Id, Name FROM Detail_Obj__c WHERE Master_Obj__c IN :masterMap.KeySet()]
We can use apex:commandLink to redirect a visualforce page in a new Tab URL using PageReference in apex class.
Sample Code:
VF Page:
<apex:page controller="SampleleRedirect">
<apex:form >
<apex:pageblock >
<apex:commandlink action="{!redirect}" target="_blank">
<apex:commandButton value="Open in New Tab"/>
</apex:commandLink>
</apex:pageblock>
</apex:form>
</apex:page>
Apex Controller:
public class SampleleRedirect {
public SampleleRedirect() {
}
public pageReference redirect() {
PageReference pageRef = new PageReference('http://www.biswajeetsamal.com');
pageRef.setRedirect(true);
return pageRef;
}
}
Synchronous:
In Synchronous process the thread waits for the task to be completed and then moves to the next task Sequentially. All the tasks are completed in a single thread.
Asynchronous:
In Asynchronous call, the thread will not wait until it completes its tasks before proceeding to next. In a Asynchronous call, the tasks are run in different threads all together.