• Babar Hussain 4
  • NEWBIE
  • 40 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 22
    Questions
  • 21
    Replies

Hi Friends,
I'm creating a new user in the production, But I'm getting error like

Error: This Federation ID is already in use. Use a different Federation ID.

My question is how to find duplicate Federation ID using SOQL query 

Can anyone help on this and share the SOQL query to me.

Requirement;
***This logic apply to only T&E Record Type.****
As per current logic, creating tasks and assign to Buy Desk when the amount is under 250K.
As per new logic, Create below list of Tasks and route approval to GSM LCM irrespective of Project Type and remove 250k price condition.
Data Privacy Review
Insurance Review
Supplier Diversity Review
Buy Desk Review
Technical Solution:
Update logic in below Apex class
CaseTriggerProcurementHandler
CaseTriggerProcurementHandlerTest

Can anyone please modify my apex code as per the requirement this is immediate deliver change, and the help won't be forgettable.
*****************************************************************************
********************************************************************************

@isTest
public class CaseTriggerProcurementHandlerTest {
    
    //Create test data, available for every test
    @testSetup 
    public static void testClassData() 
    {    
        
    }
    
    
    @isTest
    public static void testBuyDeskTask()
    {
        Id rtId = Schema.SObjectType.Case.getRecordTypeInfosByDeveloperName().get('Procurement_Professional_Services').getRecordTypeId();
        //Create Case
        case cse = New Case(
            RecordTypeId = rtId,
            Total_Expected_Cost_for_Duration__c = 20000,
            Region__c = 'APAC',
            Procurement_System__c = 'Non-Ariba'
        );
        insert cse;
        
        List<Task> tsklist = [Select Id FROM Task  WHERE WhatId = :cse.id];
        system.assertNotEquals(tsklist.size() , 0);
    }
    
        @isTest
    public static void testITBuyDeskTask()
    {
        Id rtId = Schema.SObjectType.Case.getRecordTypeInfosByDeveloperName().get('Procurement_Professional_Services').getRecordTypeId();
        //Create Case
        case cse = New Case(
            RecordTypeId = rtId,
            Total_Expected_Cost_for_Duration__c = 20000,
            Region__c = 'APAC',
            BRM_Listing__c ='scott.strong@sbdinc.com',
            BRM_Email_Address__c='scott.strong@sbdinc.com'
        );
        insert cse;
        
        List<Task> tsklist = [Select Id FROM Task  WHERE WhatId = :cse.id];
        system.assertNotEquals(tsklist.size() , 0);
    }
    
    @isTest
    public static void testLCMTask()
    {
        Id rtId = Schema.SObjectType.Case.getRecordTypeInfosByDeveloperName().get('Procurement_Professional_Services').getRecordTypeId();
        //Create Case
        case cse = New Case(
            RecordTypeId = rtId,
            Total_Expected_Cost_for_Duration__c = 260000,
            Region__c = 'APAC'
        );
        insert cse;
        
        List<Task> tsklist = [Select Id FROM Task  WHERE WhatId = :cse.id];
        system.assertNotEquals(tsklist.size() , 0);
    }
    
    @isTest
    public static void testITLCMTask()
    {
        Profile p = [SELECT Id FROM Profile WHERE Name='System Administrator'];
        Blob b = Crypto.GenerateAESKey(128);
        String h = EncodingUtil.ConvertTohex(b);
        String uid = h.SubString(0,8);
        User u = new User(Alias = uid, Email= uid + '@myorg.com', 
                          EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
                          LocaleSidKey='en_US', ProfileId = p.Id, 
                          TimeZoneSidKey='America/New_York', UserName= uid +'mvkrish@myorg.com');
        insert u;
        Id rtId = Schema.SObjectType.Case.getRecordTypeInfosByDeveloperName().get('Procurement_Professional_Services').getRecordTypeId();
        //Create Case
        case cse = New Case(
            RecordTypeId = rtId,
            Total_Expected_Cost_for_Duration__c = 260000,
            Region__c = 'APAC',
            BRM_Listing__c ='scott.strong@sbdinc.com',
            Requestor_Email__c = 'testproc2@proc2.com',
            BRM_Email_Address__c='scott.strong@sbdinc.com'
        );
        insert cse;
        //KSAINI: June 14 2022
        List<Task> tsklist = [Select Id FROM Task  WHERE WhatId = :cse.id];
        system.assertNotEquals(tsklist.size() , 0);
        List<Task> updatelist = new List<Task>();
        for(Task t : tsklist)
        {
            t.Status = 'Completed';
            updatelist.add(t);
        }
        
        update updatelist;
        List<Case> listOfCases = [Select Id, Status from Case Where Id =:cse.Id];
        listOfCases[0].OwnerId = u.Id;
        //listOfCases[0].BRM_Email_Address__c ='test@test.com';
        update listOfCases;
        List<Case> listOfupdatedCase = [Select Id, Status from Case Where Id =:cse.Id];
        listOfupdatedCase[0].Status = 'Closed';
        update listOfupdatedCase;
        
    }
    
    @isTest
    public static void testTradeComplianceTask() //Covers Trade Compliance, risk and diversity
    {
        Id rtId = Schema.SObjectType.Case.getRecordTypeInfosByDeveloperName().get('Procurement_Professional_Services').getRecordTypeId();
        //Create Case
        case cse = New Case(
            RecordTypeId = rtId,
            Total_Expected_Cost_for_Duration__c = 260000,
            Region__c = 'APAC',
            Project_Type__c = 'New Contract'
        );
        insert cse;
        
        List<Task> tsklist = [Select Id FROM Task  WHERE WhatId = :cse.id];
        system.assertNotEquals(tsklist.size() , 0);
    }
    
    @isTest
    public static void testSourcingCouncilTask() //Covers Trade Compliance, risk and diversity
    {
        Id rtId = Schema.SObjectType.Case.getRecordTypeInfosByDeveloperName().get('Procurement_Professional_Services').getRecordTypeId();
        //Create Case
        case cse = New Case(
            RecordTypeId = rtId,
            Total_Expected_Cost_for_Duration__c = 600000
        );
        insert cse;
        
        List<Task> tsklist = [Select Id FROM Task  WHERE WhatId = :cse.id];
        system.assertNotEquals(tsklist.size() , 0);
    }
}

Hi Everyone,
Can Anyone suggest this case how to approach:
When I choose On Hold in Path the case Object Status(picklist) value should be updated as On Hold. How can I achieve
User-added image

Can anyone help me , what is the condition do I need to set in decision element to match due date equals to today's date and send an email
For your reference I attached screenshots below.

User-added imageUser-added imageUser-added image
Requirement : As a: Salesforce.com Task owner, I want to receive an email notification when a Task end date equals today’s date.
Note : using flows only.
Can anyone please tell me how to do that I'm bit confued how to do that.
Thanks,
babar

I'm getting error in get records screen, Anyone know why. Actually I'm trying to create email alert for events if due date is todayMy Requirement is :

As a: Salesforce.com Event owner, I want to receive an email notification when an Event end date equals today’s date.

Note: Using flows I need to do, No workflows & no process builder

how to write query for event object where it storing record in backend in dev console?
Can anyone share the query how we check in developer console