Posts

Assign a claim to queue using apex code in salesforce and (Test class) code

 Assign a claim to queue using apex code in salesforce  and (Test class) code How to Assign a record to queue in salesforce using apex code List<QueueSobject> newClaimQueueList = [SELECT CreatedById,Id,QueueId,Queue.Name,SobjectType,SystemModstamp FROM QueueSobject where SobjectType = 'Acc_Claims__c']; List<String> stringset=new List<String>(); Group g=[SELECT Id FROM Group WHERE Type = 'Queue' and Name IN :stringset limit 1]; claim__c.OwnerId=g.id; insert claim__c test class : Group testGroup1 = new Group(Name='Claims  team', Type='Queue');         insert testGroup1; System . runAs ( new User(Id=UserInfo.getUserId()) )  { QueueSObject q1 = new QueueSObject(QueueID = testGroup1.id, SobjectType = 'claim__c');  insert q1; }

apex list empty check , List null check in salesforce

 apex list empty check , in salesforce if (records!= null && !records.isEmpty()) Here "records" are list of records.

How to get record type id with recordtype name in apex

 How to get record type id with recordtype name in apex  String recordTypeId=Schema.SObjectType.Case.getRecordTypeInfosByName().get('Support').getRecordTypeId();

Missing '' at 'if' error in apex in salesforce

  you cant have code outside your class , your class ends at line  where it show error. if you remove that extra curly brace then error will go-away. Missing '<EOF>' at 'if' error in apex salesforce.

How to Enable Documents tab in salesforce

 In lightning we are not able to see Documents tab. if you go to classic view then we are able to see  Documents tab. How to Find a Document tab In Lightning view in salesforce.