• Ganta Suresh
  • NEWBIE
  • 70 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 23
    Replies
/* 
Batch Class
Class Name :- NucleusTwocoveringMD
Functionality : - This Class is build for MDcomp record displaying it on MD Object. 
*/
public class NucleusTwocoveringMD implements Database.Batchable<sObject>{       
    public map<string,Covering_MD_Responsibility__c> FTEMap = new map<string,Covering_MD_Responsibility__c>();
    //public map<string,Medical_Director_Two__c> MDMap = new map<string,Medical_Director_Two__c>();
    public list<Medical_Director_Two__c> MDList = new list<Medical_Director_Two__c>();
    public list<Covering_MD_Responsibility__c> FCCList = new list<Covering_MD_Responsibility__c>();
    public Set<String> MDCompId = new Set<String>(); 
    public list<Medical_Director_Two__c> MDList2 = new list<Medical_Director_Two__c>();
        
    public Database.QueryLocator start(Database.BatchableContext BC){
        
        System.debug('in Start');
        return Database.getQueryLocator([select id,Name,Covering_MD__c,Compensation_End__c,Compensation_Start__c from Hist_MD_Comp_Valuation_Support__c where Compensation_Start__c <=: date.today() AND Compensation_End__c >=: date.today()]);
    
    }    
    public void execute(Database.BatchableContext BC, List<Hist_MD_Comp_Valuation_Support__c> scope){
        System.debug('in execute');
        MDList = [select id,Name,Physician_Name__c from Medical_Director_Two__c];  
        map<id,Medical_Director_Two__c> abc = new  map<id,Medical_Director_Two__c>();
        for(Hist_MD_Comp_Valuation_Support__c MDL : scope){
            //MDMap.put(MDL.Physician_Name__c, MDL);
            // Medical_Director_Two__c.add(MDL.Physician_Name__c);
            MDCompId.add(MDL.Covering_MD__c);
        }
        
        System.debug('MDCompId = '+MDCompId);
        
        List<Medical_Director_Two__c> NuMD = [select id,Name,Physician_Name__c from Medical_Director_Two__c where Physician_Name__c IN : MDCompId];       
        System.debug('NuMD = '+NuMD);
        
        for(Medical_Director_Two__c NM : NuMD){
            abc.put(NM.Physician_Name__c, NM);
        }     
        System.debug('abc = '+abc);        
        for(Hist_MD_Comp_Valuation_Support__c MD : scope){
           
            System.debug('abc.get(MD.Covering_MD__c) = '+abc.get(MD.Covering_MD__c));
            
            if(abc.get(MD.Covering_MD__c) != null){
                System.debug('IN check Map');
                Covering_MD_Responsibility__c CMD = new Covering_MD_Responsibility__c();
                System.debug('check Map');
                CMD.Nucleus_MD__c = abc.get(MD.Covering_MD__c).id;
                CMD.MD_Compensation__c = MD.id;
                FCCList.add(CMD);
            }
        } 
        System.debug('FCCList = '+FCCList);       
        if(!FCCList.isEmpty()){
            insert FCCList;
        }              
        System.debug('FCCList = '+FCCList);       
    }        
    public void finish(Database.BatchableContext BC){
        
    }
}
Hello All ..! Can anyone help me or guide me on this -
how to throw a custom error in a flow inside a approval process ?

let me know if possible example if Yes.

Can anyone help me with this -I want you to do full R&D on flows that if we can use flows on the approval process and we can through custom error ?.

Could you please explain this statement like any full R&D?

I have a requirement like this, can anyone let me know about the same R&D ? Please

Eagle Status Update on Agreement object
ERROR:- System.NullPointerException: Attempt to de-reference a null object System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Account__c]: [Account__c]

Testclass:-

@isTest
public class FacilityTriggerTest {

    @isTest
    public static void updateagreementTest() {
        Apttus__APTS_Agreement__c agreement = new Apttus__APTS_Agreement__c();
        agreement.Name = 'Test Agreement';
        insert agreement;

        Facility__c facility = new Facility__c();
        //facility.Name = 'Test Facility';
        facility.Agreement__c = agreement.Id;
        //facility.Davita_legal_entity__c = 'Test Legal Entity';
        //facility.Facility_Division__c = 'Test Division';
        //facility.Facility_Group__c = 'Test Group';
        //.Davita_legal_Entity_Name__c = 'Test Legal Entity Name';
        //facility.Facility_Name__c = 'Test Facility Name';
        //facility.Facility_Number__c = '123456';
        insert facility;

        List<Facility__c> facilityList = new List<Facility__c>();
        facilityList.add(facility);

        Test.startTest();
        FacilityHandler.updateagreement(facilityList);
        Test.stopTest();

        Apttus__APTS_Agreement__c updatedAgreement = [SELECT Id, Facility_Name_for_Template__c, Facility_Number_for_Template__c, Division_Name__c, Palmer_Group__c, Davita_Legal_Entity_2__c
                                                      FROM Apttus__APTS_Agreement__c
                                                      WHERE Id = :agreement.Id];

        System.assertEquals(facility.Davita_legal_entity__c, updatedAgreement.Davita_Legal_Entity_2__c);
        //Changed as Divisin__c to Division_Name__c on 28/06/2023
        System.assertEquals(facility.Facility_Division__c, updatedAgreement.Division_Name__c);
        System.assertEquals(facility.Facility_Group__c, updatedAgreement.Palmer_Group__c);
        System.assertEquals(facility.Davita_legal_Entity_Name__c, updatedAgreement.Davita_Legal_Entity_2__c);
        System.assertEquals(facility.Facility_Name__c, updatedAgreement.Facility_Name_for_Template__c);
        System.assertEquals(facility.Facility_Number__c, updatedAgreement.Facility_Number_for_Template__c);
    }

    @isTest
    public static void facilityMethodTest() {
        Apttus__APTS_Agreement__c agreement = new Apttus__APTS_Agreement__c();
        agreement.Name = 'Test Agreement';
        insert agreement;

        Facility__c facility = new Facility__c();
        //facility.Name = 'Test Facility';
        facility.Agreement__c = agreement.Id;
        facility.Account__r.Name = 'Test Account';
        insert facility;

        List<Facility__c> newFacilityList = new List<Facility__c>();
        newFacilityList.add(facility);

        List<Facility__c> oldFacilityList = new List<Facility__c>();

        Test.startTest();
        FacilityHandler.facilityMethod(newFacilityList, oldFacilityList, true, false);
        Test.stopTest();

        Apttus__APTS_Agreement__c updatedAgreement = [SELECT Id, Facility_Name__c
                                                      FROM Apttus__APTS_Agreement__c
                                                      WHERE Id = :agreement.Id];

        System.assertEquals(facility.Account__r.Name, updatedAgreement.Facility_Name__c);
    }
}

APEXclass:-
trigger FacilityTrigger on Facility__c(after insert, after update, after delete) {

    if (trigger.isAfter && (trigger.IsInsert || trigger.IsUpdate)) {
        FacilityHandler.updateagreement(trigger.New);
    }
    if (trigger.isAfter && (trigger.IsInsert || trigger.IsUpdate || trigger.IsDelete)) {
        FacilityHandler.facilityMethod(trigger.new, trigger.old, trigger.IsInsert, trigger.IsUpdate);
    }
}
Testcalss:-
public class createMDAAgreementForAcute { public static Map < String, Eagle_Facility__c > facval = new Map < String, Eagle_Facility__c > (); public static List < Eagle_Modality__c > eagleList2; public static list < Eagle_Modality__c > AcuteMod = new list < Eagle_Modality__c > (); public static map < string, decimal > acutemodmap = new map < string, decimal > (); public static map < string, List < Eagle_Modality__c >> MapOfMod = new map < string, List < Eagle_Modality__c >> (); public static Map < Id, Eagle_Physician_Information__c > preApp = new Map < Id, Eagle_Physician_Information__c > (); public static set < string > mod = new set < string > (); Public static list < Apttus__APTS_Agreement__c > Updatelist; public static Set < String > eagleId; public static Map < Id, Eagle_MDA_MD_Comp__c > mdaComplst; public static Map < Id, Eagle_Modality__c > modalitylst; public static Set < string > conset = new Set < string > (); public static Map < Id, Contact > conmap = new Map < Id, Contact > (); public static set < id > eagleset = new set < id > (); public static list < EAGLE_Arrangement__c > EagleList = new list < EAGLE_Arrangement__c > (); public static List < MDA_Facility__c > allmdafac = new List < MDA_Facility__c > (); public static list < MDA_Medical_Director__c > allmdadc = new List < MDA_Medical_Director__c > (); public static list < MDA_Medical_Director__c > mdapre = new List < MDA_Medical_Director__c > (); public static map < string, string > ALLMD = new map < string, string > (); public static list < GroupUserMapping__c > Queueid = [select id, Group_Name__c, Related_Queue_for_MDA__c from GroupUserMapping__c where agreement_type__c = 'Medical Director Agreement (MDA)']; public static map < String, Eagle_Modality__c > eagmod = new map < String, Eagle_Modality__c > (); public static Set < String > physicianids = new Set < String > (); public static Apttus__APTS_Agreement__c Agg; public static Set < String > mdacompId; public static boolean AcuteModality = false; public static boolean ACUCHR = false; public static string acutephy; public static string acutehosp; public static String fieldNames = ''; public static String query; public static string chk; Public static MDA_Medical_Director__c md; public static ID AGG_RT = Schema.SObjectType.Apttus__APTS_Agreement__c.getRecordTypeInfosByName().get('Medical Director Agreement (MDA)').getRecordTypeID(); public static ID ARR_RT = Schema.SObjectType.EAGLE_Arrangement__c.getRecordTypeInfosByName().get('MDA').getRecordTypeID(); //****************************************FUNCTION 1 *************************************** @invocablemethod Public static void createAgreementforAcute(List < id > eg) { system.debug('List from PB' + eg); list < EAGLE_Arrangement__c > eagnewlist = new list < EAGLE_Arrangement__c > (); Map < String, Schema.SObjectField > fieldMap = Schema.SObjectType.EAGLE_Arrangement__c.fields.getMap(); for (String s: fieldMap.keySet()) { //if(!s.contains('CSA_Reviewed_value__c')) //{ fieldNames = s + ',' + fieldNames; //} } fieldNames = fieldNames.removeEnd(','); fieldNames = fieldNames + ',' + 'Division_Name__r.name'; query = 'select ' + fieldNames + ' from EAGLE_Arrangement__c where id in:eg'; eagnewlist = Database.query(query); Updatelist = new list < Apttus__APTS_Agreement__c > (); eagleId = new Set < String > (); mdaComplst = new Map < Id, Eagle_MDA_MD_Comp__c > (); modalitylst = new Map < Id, Eagle_Modality__c > (); mdacompId = new Set < String > (); //Adding Arrangement Id's for (EAGLE_Arrangement__c eag: eagnewlist) { eagleId.add(eag.Id); } for (EAGLE_Arrangement__c agg: [select DVP__c, ROD__c, Paralegal2__c, Attorney__c from EAGLE_Arrangement__c where id in: eagleId]) { if (agg.ROD__c != null) { conset.add(agg.ROD__c); } if (agg.Paralegal2__c != null) { conset.add(agg.Paralegal2__c); } if (agg.Attorney__c != null) { conset.add(agg.Attorney__c); } } if (!conset.isEmpty()) { conmap = new Map < Id, Contact > ([select id, name, User_Record__c, User_ID__c from contact where id in: conset]); } mdaComplst = new Map < Id, Eagle_MDA_MD_Comp__c > ([Select Id from Eagle_MDA_MD_Comp__c where Agreement_Number__c IN: eagleId]); //Adding MDAComp Id's for (Eagle_MDA_MD_Comp__c mdacomp: [Select Id from Eagle_MDA_MD_Comp__c where Agreement_Number__c IN: eagleId]) { mdacompId.add(mdacomp.Id); } // creating Agreement as per the arrangement for (EAGLE_Arrangement__c eag1: eagnewlist) { if ((eag1.Status__c == 'In-Process' || eag1.Status__c == 'Pending MD Comp Review' || eag1.Status__c == 'Pending Business Rationale/Partner Selection' || eag1.Status__c == 'Drafting Agreement') && (eag1.Agreement_Action__c == 'DeNovo' || eag1.Agreement_Action__c == 'New – Replacement' || eag1.Agreement_Action__c == 'New – Renewal') && eag1.RecordTypeId == ARR_RT && eag1.JARVIS_ID__c == null) { System.debug('HI'); if (eag1.Agreement_Sub_Type__c != 'Chronic & Acute') { ACUCHR = true; } Agg = new Apttus__APTS_Agreement__c(); // Agg.APTSPS_Increase_compensation__c='Yes'; Agg.RecordTypeId = AGG_RT; agg.Reference_Name__c = eag1.Reference_Name__c; chk = 'false'; // Agg.Eagle_ARR_ID__c=eag1.id; // Changed on 02-06-2023- Physician_Group_Name__c into Apttus__Account__c // Agg.Physician_Group_Name__c = eag1.Physician_Group__c; Agg.Arrangement__c = eag1.Id; Agg.Palmer_Group__c = eag1.Palmer_Group__c; Agg.Division__c = eag1.Division_Name__r.name; // agg.Originate_from_Eagle__c= true; agg.Agreement_Action_Type__c = eag1.Agreement_Action__c; //changed as Physician_Group_If_not_in_list__c to Non_DaVita_Entity_Name__c 12/06/2023 Agg.Non_DaVita_Entity_Name__c = eag1.Non_DaVita_Entity_Name__c; Agg.Davita_Legal_Entity_MDA__c = eag1.DaVita_Entity_Name_if_not_in_list__c; //we dont need to use this line 01/06/2023 // Agg.Apttus__Subtype__c = eag1.Agreement_Sub_Type__c; Agg.Apttus__Status__c = 'In-Process'; // Changed on 02-06-2023- Physician_Group_Name__c into Apttus__Account__c // Agg.Physician_Group_Name__c = eag1.Physician_Group__c; Agg.Term_Years__c = string.valueOf(eag1.Term_in_Months__c); if (eag1.Auto_Renewal__c == 'Yes') { Agg.Apttus__Auto_Renewal__c = true; Agg.Number_of_Renewals__c = 'Until Cancelled'; } else if (eag1.Auto_Renewal__c == 'No') { Agg.Apttus__Auto_Renewal__c = False; } if (eag1.DVP__c != Null) { Agg.Divisional_Vice_President_DVP_Name__c = eag1.DVP__c; } if (eag1.ROD__c != null) { Agg.Regional_Operations_Director_ROD__c = conmap.get(eag1.ROD__c).User_ID__c; } if (eag1.Attorney__c != null) { Agg.Group_General_Counsel_GGC__c = conmap.get(eag1.Attorney__c).User_ID__c; } if (eag1.Paralegal2__c != null) { Agg.Paralegal__c = conmap.get(eag1.Paralegal2__c).User_ID__c; } Updatelist.add(Agg); } } if (!updatelist.isEmpty()) { try { insert Updatelist; upddowner(); } catch (Exception e) { JarvisApexLogger.log('createMDAAgreementForAcute', e.getMessage()); JarvisApexLogger.commitLogs(); } } for (EAGLE_Arrangement__c mj: eagnewlist) { eagleset.add(mj.id); } for (EAGLE_Arrangement__c olis: [SELECT Id, JARVIS_ID__c FROM EAGLE_Arrangement__c WHERE Id =: eagleset]) { if (olis.JARVIS_ID__c == null) { for (Apttus__APTS_Agreement__c agg2: Updatelist) { olis.JARVIS_ID__c = agg2.id; EagleList.add(olis); } } } if (!eaglelist.isEmpty()) { try { update EagleList; } catch (Exception e) { JarvisApexLogger.log('createMDAAgreementForAcute', e.getMessage()); JarvisApexLogger.commitLogs(); } } if (ACUCHR) { createModality(); } } //****************************************FUNCTION 2 *************************************** public static void createModality() { Set < String > mdacompids = new Set < String > (); Apttus__APTS_Agreement__c agg1 = [select id, name, Palmer_Group__c from Apttus__APTS_Agreement__c where id =: Updatelist LIMIT 1]; for (Eagle_MDA_MD_Comp__c mdacomp: [Select Id from Eagle_MDA_MD_Comp__c where Agreement_Number__c IN: eagleList]) { mdacompids.add(mdacomp.Id); } for (Eagle_Facility__c f: [Select Name, Facility_Name_Lookup__c, Facility_Name__c, Facility_Number__c from Eagle_Facility__c where MD_selection_MD_Comp_ID__c IN: mdacompids]) { for (Eagle_Modality__c mod: [select id, Hospital_Name__c, Hospital_Name_If_not_in_list__c, Physician_Name__c, Facility__r.name, Modality_Required_FMV__c, Hospital_Name__r.id, Facility__r.Facility_Name_Lookup__r.id, Facility__r.Facility_Name_Lookup__r.name, Facility__r.Facility_Name_Lookup__c, Physician_ID__r.Medical_Director_Name__r.id, Proposed_Compensation__c from Eagle_Modality__c where MD_Selection_MD_Compensation__c IN: mdacompids]) { acutephy = mod.Physician_ID__r.Medical_Director_Name__r.id; acutehosp = mod.Hospital_Name__r.id; if (f.Name == mod.Facility__r.name && mod.Modality_Required_FMV__c == 'Acute') { physicianids.add(f.Name + ',' + acutephy + ',' + acutehosp); eagmod.put(f.Name + ',' + acutephy + ',' + acutehosp, mod); } } MDA_Facility__c mdafac = new MDA_Facility__c(); mdafac.Agreement__c = agg1.Id; mdafac.Eagle_Facility_Number__c = f.Name; mdafac.Facility_Name__c = f.Facility_Name_Lookup__c; mdafac.Facility_Name_Not_Listed__c = f.Facility_Name__c; mdafac.Facility_Number_Not_Listed__c = f.Facility_Number__c; mdafac.Applicable_Modalities__c = 'Acute'; allmdafac.add(mdafac); } if (!allmdafac.isEmpty()) { try { insert allmdafac; //upddowner(); } catch (Exception e) { JarvisApexLogger.log('createMDAAgreementForAcute', e.getMessage()); JarvisApexLogger.commitLogs(); } } for (MDA_Facility__c fac1: allmdafac) { string facilityname = fac1.Eagle_Facility_Number__c; for (String s1: physicianids) { String fname = s1.substring(0, s1.indexOf(',')); if (facilityname == fname) { Eagle_Modality__c eag = eagmod.get(s1); md = new MDA_Medical_Director__c(); md.Acute_MDA_Annual_Compensation__c = eag.Proposed_Compensation__c; md.Hospital_Name_MDA_Acute__c = eag.Hospital_Name__c; md.Agreement__c = agg1.Id; md.MDA_Facility__c = fac1.Id; md.Medical_Director_Name__c = eag.Physician_ID__r.Medical_Director_Name__r.id; md.Hospital_Name_MDA_Acute_if_not_in_list__c = eag.Hospital_Name_If_not_in_list__c; md.Type__c = 'Medical Director & Pre-Approved'; md.Modality__c = 'Acute'; mod.add(eag.Physician_ID__r.Medical_Director_Name__r.id); allmdadc.add(md); } } } if (!allmdadc.isEmpty()) { try { insert allmdadc; } catch (Exception e) { JarvisApexLogger.log('createMDAAgreementForAcute', e.getMessage()); JarvisApexLogger.commitLogs(); } } if (!allmdafac.isEmpty()) { for (MDA_Facility__c fc: allmdafac) { for (Eagle_Physician_Information__c egapp: [select id, Medical_Director_Name__c, Medical_Director_Name__r.name from Eagle_Physician_Information__c where MD_selection_MD_Comp_ID__c in: mdacompId]) { if (!mod.contains(egapp.Medical_Director_Name__c)) { MDA_Medical_Director__c ma = new MDA_Medical_Director__c(); ma.Modality__c = 'Acute'; ma.Type__c = 'Pre-Approved'; ma.Medical_Director_Name__c = egapp.Medical_Director_Name__c; ma.MDA_Facility__c = fc.Id; mdapre.add(ma); } } } } if (!mdapre.isEmpty()) { try { insert mdapre; } catch (Exception e) { JarvisApexLogger.log('createMDAAgreementForAcute', e.getMessage()); JarvisApexLogger.commitLogs(); } } } Public static void upddowner() {//Changed as Group__c to Palmer_Group__c 12/06/2023 Apttus__APTS_Agreement__c agg2 = [select id, name, Palmer_Group__c from Apttus__APTS_Agreement__c where id =: Updatelist LIMIT 1]; for (GroupUserMapping__c gm: Queueid) { if (agg2.Palmer_Group__c == gm.Group_Name__c) { //system.debug('I am IN'); Agg2.OwnerId = gm.Related_Queue_for_MDA__c; } } try { Update agg2; } catch (Exception e) { JarvisApexLogger.log('createMDAAgreementForAcute', e.getMessage()); JarvisApexLogger.commitLogs(); } } }
TESTCLASS:-
@isTest public class createMDAAgreementForAcuteTest { public static testMethod void agrCreation() { list < string > Earr = new list < string > (); ID ARR_RT = Schema.SObjectType.EAGLE_Arrangement__c.getRecordTypeInfosByName().get('MDA').getRecordTypeID(); ID MDAJoinderRecTypeId = Schema.SObjectType.MDA_Facility__c.getRecordTypeInfosByName().get('MDA Joinder').getRecordTypeID(); ID ACC_RT = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Dialysis Centers').getRecordTypeID(); ID C_RT = Schema.SObjectType.contact.getRecordTypeInfosByName().get('Other Contact').getRecordTypeID(); ID mdaRecTypeId = Schema.SObjectType.Apttus__APTS_Agreement__c.getRecordTypeInfosByName().get('Medical Director Agreement (MDA)').getRecordTypeID(); Profile p = [SELECT Id FROM Profile WHERE Name = 'System Administrator']; User u = new User(Alias = 'standt', Email = 'standarduser@testorg.com', EmailEncodingKey = 'UTF-8', LastName = 'Testing', LanguageLocaleKey = 'en_US', LocaleSidKey = 'en_US', ProfileId = p.Id, TimeZoneSidKey = 'America/Los_Angeles', UserName = 'standarduser@testorg.com'); List < Id > eagleids = new List < Id > (); Test.startTest(); Account ac = new Account(); ac.Name = 'test'; ac.RecordTypeId = ACC_RT; ac.Type = 'Denovo'; ac.BillingPostalCode = '41011'; ac.BillingCity = 'covington'; ac.BillingState = 'KY'; ac.BillingCountry = 'USA'; ac.BillingStreet = '1500 JAMES SIMPSON JR WAY, STE 1100'; //Changed as Group__c to Palmer_Group__c 12/06/2023 -account doesn't have this field. //ac.Palmer_Group__c = 'Apex'; insert ac; createMDAAgreement.chk = 'True'; contact c = new contact(); c.AccountId = ac.id; c.RecordTypeId = c_RT; c.LastName = 'test1'; c.FirstName = 'sumati'; c.User_Record__c = u.id; insert c; Eagle_Arrangement__c eag = new Eagle_Arrangement__c(); eag.RecordTypeId = ARR_RT; eag.Reference_Name__c = 'Testing'; eag.ROD__c = c.id; eag.DVP__c = c.id; eag.Agreement_Action__c = 'New – Replacement'; eag.Anticipated_Execution_Date__c = date.today(); eag.If_Amended_Describe_Change__c = 'Testing'; eag.Status__c = 'Drafting Agreement'; eag.Physician_Group__c = ac.Id; eag.Palmer_Group__c = 'Avanti'; eag.Non_DaVita_Entity_Name__c = 'Test Physician'; eag.DaVita_Entity_Name_if_not_in_list__c = 'Test Davita Entity Name'; eag.Auto_renew_term__c = '18'; eag.Term_in_Months__c = 5; eag.Auto_Renewal__c = 'Yes'; insert eag; eagleids.add(eag.Id); createMDAAgreementForAcute.createAgreementforAcute(eagleids); Test.stopTest(); Eagle_Arrangement__c eag1 = [Select Id, Auto_renew_term__c, JARVIS_ID__c, Reference_Name__c, Physician_Group__c, Palmer_Group__c, Agreement_Action__c, Non_DaVita_Entity_Name__c, DaVita_Entity_Name_if_not_in_list__c, Agreement_Sub_Type__c, Term_in_Months__c, Auto_Renewal__c, DVP__c, ROD__c from Eagle_Arrangement__c where Id =: eag.Id]; Apttus__APTS_Agreement__c agr = [Select Id, Reference_Name__c, Apttus__Account__c, Arrangement__c, Palmer_Group__c, Division__c, Agreement_Action_Type__c, Non_DaVita_Entity_Name__c, Davita_Legal_Entity_MDA__c, Renewal_Term__c, APTSPS_Agreement_Type_del__c, Term_Years__c, Apttus__Auto_Renewal__c, Number_of_Renewals__c, Divisional_Vice_President_DVP_Name__c, Regional_Operations_Director_ROD__c from Apttus__APTS_Agreement__c where Id =: eag1.JARVIS_ID__c]; Integer rtyears = integer.valueOf(eag1.Auto_renew_term__c); String termyears = string.valueOf(eag1.Term_in_Months__c); System.assertEquals(agr.Reference_Name__c, eag1.Reference_Name__c); //Changed on 02-06-2023- Physician_Group_Name__c into Apttus__Account__c //System.assertEquals(agr.Physician_Group_Name__c, eag.Physician_Group__c); System.assertEquals(agr.Arrangement__c, eag1.Id); System.assertEquals(agr.Palmer_Group__c, eag1.Palmer_Group__c); System.assertEquals(agr.Agreement_Action_Type__c, eag1.Agreement_Action__c); //changed as Physician_Group_If_not_in_list__c to Non_DaVita_Entity_Name__c 12/06/2023 System.assertEquals(agr.Non_DaVita_Entity_Name__c, eag1.Non_DaVita_Entity_Name__c); System.assertEquals(agr.Davita_Legal_Entity_MDA__c, eag1.DaVita_Entity_Name_if_not_in_list__c); System.assertEquals(agr.Term_Years__c, termyears); System.assertEquals(agr.Apttus__Auto_Renewal__c, TRUE); System.assertEquals(agr.Number_of_Renewals__c, 'Until Cancelled'); System.assertEquals(agr.Divisional_Vice_President_DVP_Name__c, eag1.DVP__c); System.assertEquals(agr.Regional_Operations_Director_ROD__c, c.User_ID__c); } public static testmethod void createMod() { ID ARR_RT = Schema.SObjectType.EAGLE_Arrangement__c.getRecordTypeInfosByName().get('MDA').getRecordTypeID(); ID C_RT = Schema.SObjectType.contact.getRecordTypeInfosByName().get('Other Contact').getRecordTypeID(); ID ACC_RT = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Dialysis Centers').getRecordTypeID(); List < Id > eagleids = new List < Id > (); List < Eagle_Modality__c > modlst = new List < Eagle_Modality__c > (); List < Eagle_Physician_Information__c > preapplst = new List < Eagle_Physician_Information__c > (); Test.startTest(); Account ac = new Account(); ac.Name = 'test'; ac.RecordTypeId = ACC_RT; ac.Type = 'Denovo'; ac.BillingPostalCode = '41011'; ac.BillingCity = 'covington'; ac.BillingState = 'KY'; ac.BillingCountry = 'USA'; ac.BillingStreet = '1500 JAMES SIMPSON JR WAY, STE 1100'; //Changed as Group__c to Palmer_Group__c 12/06/2023 -account doesn;t have this field. //ac.Palmer_Group__c = 'Apex'; insert ac; contact c = new contact(); c.AccountId = ac.id; c.RecordTypeId = c_RT; c.LastName = 'test1'; c.FirstName = 'sumati'; insert c; contact c1 = new contact(); c1.AccountId = ac.id; c1.RecordTypeId = c_RT; c1.LastName = 'test1'; c1.FirstName = 'Contact'; insert c1; Eagle_Arrangement__c eag = new Eagle_Arrangement__c(); eag.RecordTypeId = ARR_RT; eag.Reference_Name__c = 'Testing'; eag.ROD__c = c.id; eag.DVP__c = c.id; eag.Attorney__c=c1.Id; eag.Paralegal2__c=c1.Id; eag.Agreement_Action__c = 'New – Replacement'; eag.Anticipated_Execution_Date__c = date.today(); eag.If_Amended_Describe_Change__c = 'Testing'; eag.Status__c = 'In-Process'; eag.Physician_Group__c = ac.Id; eag.Palmer_Group__c = 'Avanti'; //changed as Physician_Group_If_not_in_list__c to Non_DaVita_Entity_Name__c 12/06/2023 eag.Non_DaVita_Entity_Name__c = 'Test Physician'; eag.DaVita_Entity_Name_if_not_in_list__c = 'Test Davita Entity Name'; eag.Auto_renew_term__c = '18'; eag.Term_in_Months__c = 5; eag.Auto_Renewal__c = 'Yes'; insert eag; eagleids.add(eag.Id); Eagle_MDA_MD_Comp__c mdacomp = new Eagle_MDA_MD_Comp__c(); mdacomp.Agreement_Number__c = eag.Id; insert mdacomp; Eagle_Physician_Information__c phy1 = new Eagle_Physician_Information__c(); phy1.Medical_Director_Name__c = c1.Id; phy1.MD_selection_MD_Comp_ID__c = mdacomp.Id; //Eagle_Physician_Information__c phy2 = new Eagle_Physician_Information__c(); //phy2.Medical_Director_Name__c = c.Id; //phy2.MD_selection_MD_Comp_ID__c = mdacomp.Id; preapplst.add(phy1); //preapplst.add(phy2); insert preapplst; Test.stopTest(); Eagle_Facility__c fac1 = new Eagle_Facility__c(); fac1.MD_selection_MD_Comp_ID__c = mdacomp.Id; fac1.Facility_Name_Lookup__c = ac.Id; fac1.facility_name__c = 'Test Facility Name'; fac1.Facility_Number__c = 'Test'; insert fac1; Eagle_Modality__c mod1 = new Eagle_Modality__c(); mod1.Facility__c = fac1.id; mod1.MD_Selection_MD_Compensation__c = mdacomp.id; mod1.Physician_ID__c = phy1.id; mod1.Modality_Required_FMV__c = 'Acute'; insert mod1; createMDAAgreementForAcute.createAgreementforAcute(eagleids); } }
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, AcuteFacilityTrigger: execution of AfterInsert

caused by: System.DmlException: Update failed. First exception on row 0 with id a3vD70000011WczIAE; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, Palmer Group: bad value for restricted picklist field: Test Group: [Palmer_Group__c]

Class.AcuteFacilityHandler.updateAgreement: line 22, column 1
Trigger.AcuteFacilityTrigger: line 3, column 1: []

Testcalss:-
@isTest
public class AcuteFacilityTriggerTest {

    public static testmethod void AcuteFacilityTest() {
        Id agrRecordType = Schema.SObjectType.Apttus__APTS_Agreement__c.getRecordTypeInfosByName().get('Medical Director Agreement (MDA)').getRecordTypeID();
        ID ACC_RT = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Dialysis Centers').getRecordTypeID();

        Test.startTest();

        Legal_Entity__c le = new Legal_Entity__c();
        le.State__c = 'Alaska';
        le.Name = 'Test Legal Entity';
        insert le;

        Account ac = new Account();
        ac.Name = 'test Account';
        ac.RecordTypeId = ACC_RT;
        ac.Type = 'Denovo';
        ac.BillingPostalCode = '41011';
        ac.BillingCity = 'covington';
        ac.BillingState = 'KY';
        ac.BillingCountry = 'USA';
        ac.BillingStreet = '1500 JAMES SIMPSON JR WAY, STE 1100';
        //Changed as Group__c to Palmer_Group__c 12/06/2023
        //ac.Group__c = 'Apex';
        ac.DVA_Facility_Number__c = 555;
        ac.Legal_Entity2__c = le.Id;
        ac.MDM_Group__c = 'Test Group';
        ac.MDM_Division_Mapped__c = 'Test Division';
        insert ac;

        Apttus__APTS_Agreement__c agg = new Apttus__APTS_Agreement__c();
        agg.RecordTypeId = agrRecordType;
        insert agg;

        Acute_Facility__c acc = new Acute_Facility__c();
        acc.Agreement__c = agg.Id;
        acc.Facility_Name__c = ac.Id;
        insert acc;

        Apttus__APTS_Agreement__c agr = [Select Davita_Legal_Entity_2__c, Division__c, Palmer_Group__c, Facility_Name_for_Template__c, Facility_Number_for_Template__c from Apttus__APTS_Agreement__c where Id =: agg.Id];
        Acute_Facility__c af = [Select MDA_Fac_Davita_legal_Entity__c, Facility_Division__c, Facility_Group__c, Facility_Number__c, Facility_Name_Acute__c from Acute_Facility__c where Id =: acc.Id];
        System.assertEquals(agr.Davita_Legal_Entity_2__c, af.MDA_Fac_Davita_legal_Entity__c);
        System.assertEquals(agr.Division__c, af.Facility_Division__c);
        System.assertEquals(agr.Palmer_Group__c, af.Facility_Group__c);
        System.assertEquals(agr.Facility_Name_for_Template__c, af.Facility_Name_Acute__c);
        System.assertEquals(agr.Facility_Number_for_Template__c, af.Facility_Number__c);

        Test.stopTest();
    }


}

Class:-

trigger AcuteFacilityTrigger on Acute_Facility__c(after insert, after update) {

    AcuteFacilityHandler.updateAgreement(trigger.New);
}
public class AksChecklist 
{
   // public Eagle_Arrangement__c agr{get;set;}
    public Internal_Risk_Rating_Detail__c irr{get;set;}
    public AKS_Checklist_AGR__c aksrec{set;get;}
    public integer i=0;
   // public Id agreementid{get;set;}
    public Id internalid{get;set;}
    
    Id recordTypeId = [Select Id,Name from RecordType where Name='Consulting Arrangement' and SOBjectType='Eagle_Arrangement__c'].Id;
   // public id recordtype{set;get;}
    public AksChecklist(apexpages.StandardController cont)
        
    {
      aksrec=(AKS_Checklist_AGR__c)cont.getRecord();
        system.debug('aksid'+aksrec);
        internalid=ApexPages.currentPage().getParameters().get('irrid');
        if(aksrec!=null && aksrec.id!=null){
           
            aksrec=[select id,name,Createddate__c ,LastModifiedDate__c,LastModifiedBy.name,CreatedBy.name,Internal_Risk_Details__c,Internal_Risk_Details__r.Arrangement__c,Internal_Risk_Details__r.Arrangement__r.recordtype.name,Respond_to_Question_1__c,Internal_Risk_Details__r.Arrangement__r.Agreement_Sub_Type__c ,
                    Respond_to_Question_2__c,Respond_to_Question_3__c,Respond_to_Question_4__c,Respond_to_Question_5__c,Respond_to_Question_6__c,Respond_to_Question_7__c,Respond_to_Question_8__c,Respond_to_Question_9__c,Respond_to_Question_10__c,Respond_to_Question_11__c from AKS_Checklist_AGR__c where id=:aksrec.id]; 
            internalid=aksrec.Internal_Risk_Details__c;
        }
        irr=[select id,name,legal_AKS_confirmation__c,Arrangement__c,Arrangement__r.name,Arrangement__r.Agreement_Sub_Type__c,Arrangement__r.Recordtype.name,Arrangement__r.ROD__c,Arrangement__r.DVP__c,Arrangement__r.Status__c,Arrangement__r.Next_Approver__c from Internal_Risk_Rating_Detail__c where id=:internalid];
       // system.debug(irr.Arrangement__r.Recordtype.name);
         
      // this.agreementid=ApexPages.currentPage().getParameters().get('agrid');
          // agr=[Select Id,ROD__c,DVP__c ,Status__c, Next_Approver__c,recordtype.name from Eagle_Arrangement__c where id=:agreementid];
  
    }
    public pagereference divert(){
        PageReference pr=new PageReference('/apex/akschecklistredirection');//other developer page url here
       if(irr.Arrangement__r.recordtype.name=='RS Lease' || irr.Arrangement__r.recordtype.name=='Settlement' || irr.Arrangement__r.recordtype.name=='other'|| irr.Arrangement__r.recordtype.name=='Consulting Arrangement' || irr.Arrangement__r.recordtype.name=='Hospital Services Arrangement' || irr.Arrangement__r.recordtype.name=='SNF HHD Coordination Agreement' || irr.Arrangement__r.recordtype.name=='MDA' || irr.Arrangement__r.recordtype.name=='Sublease Remediation' || irr.Arrangement__r.recordtype.name=='Patient Pathways' ){//add othe record types here 
            pr=null;
        }
        return pr;
    }
    public pagereference divert1(){
        PageReference pr=new PageReference('/apex/akschecklistredirectionview');//other developer page url here
       if(irr.Arrangement__r.recordtype.name=='RS Lease' || irr.Arrangement__r.recordtype.name=='Settlement' || irr.Arrangement__r.recordtype.name=='other'|| irr.Arrangement__r.recordtype.name=='Consulting Arrangement' || irr.Arrangement__r.recordtype.name=='Hospital Services Arrangement' || irr.Arrangement__r.recordtype.name=='SNF HHD Coordination Agreement' || irr.Arrangement__r.recordtype.name=='MDA' || irr.Arrangement__r.recordtype.name=='Sublease Remediation' || irr.Arrangement__r.recordtype.name=='Patient Pathways'){//add othe record types here 
           pr=null;
        }
        return pr;
    }
     public pagereference divert2(){
        PageReference pr=new PageReference('/apex/akschecklistredirectionedit');//other developer page url here
       if(irr.Arrangement__r.recordtype.name=='RS Lease' || irr.Arrangement__r.recordtype.name=='Settlement' || irr.Arrangement__r.recordtype.name=='other'|| irr.Arrangement__r.recordtype.name=='Consulting Arrangement' || irr.Arrangement__r.recordtype.name=='Hospital Services Arrangement' || irr.Arrangement__r.recordtype.name=='SNF HHD Coordination Agreement' || irr.Arrangement__r.recordtype.name=='MDA' || irr.Arrangement__r.recordtype.name=='Sublease Remediation' || irr.Arrangement__r.recordtype.name=='Patient Pathways'){//add othe record types here 
            pr=null;
        }
        return pr;
    }
   /* public pagereference akspagego()
    {
      PageReference pr=new PageReference('/apex/AksChecklist');
          pr.getParameters().put('varArrangementId',agr.Id);
              pr.getParameters().put('varRecordType',recordTypeId);
              
        pr.getParameters().put('irrid',aksrec.id);
        pr.getParameters().put('retURL',agr.id);
            return pr ;
    }*/
    
        
   
    
    public pagereference save(){
        aksrec.Internal_Risk_Details__c=irr.id;
        if(aksrec.id!=null){
         
                update aksrec;
            //list<AKS_Checklist_AGR__c> akss=[select id,name,Internal_Risk_Details__c,Respond_to_Question_1__c,Respond_to_Question_2__c,Respond_to_Question_3__c,Respond_to_Question_4__c,Respond_to_Question_5__c,Respond_to_Question_6__c,Respond_to_Question_7__c,Respond_to_Question_8__c,Respond_to_Question_9__c,Respond_to_Question_10__c,Respond_to_Question_11__c from AKS_Checklist_AGR__c where Internal_Risk_Details__c=:irr.id];
            //for(AKS_Checklist_AGR__c aksrec1:akss){
            if((aksrec.Respond_to_Question_1__c=='Yes' && aksrec.Respond_to_Question_2__c=='Yes' && aksrec.Respond_to_Question_3__c=='Yes' && aksrec.Respond_to_Question_4__c=='Yes'  && aksrec.Respond_to_Question_5__c=='Yes' && aksrec.Respond_to_Question_6__c=='Yes' && aksrec.Respond_to_Question_7__c=='Yes'  && aksrec.Respond_to_Question_8__c=='Yes'  && aksrec.Respond_to_Question_9__c=='Yes') || (aksrec.Respond_to_Question_10__c=='Yes'  && aksrec.Respond_to_Question_11__c=='Yes'))
            {
                //i++;
                //}
            //}if(akss.size()==i){
            irr.legal_AKS_confirmation__c='Complete';
                  }
            else{
                    irr.legal_AKS_confirmation__c='Not All Affirmative';   
                  }
            update irr;
        }else{
           
            insert aksrec;
 //list<AKS_Checklist_AGR__c> akss=[select id,name,Internal_Risk_Details__c,Respond_to_Question_1__c,Respond_to_Question_2__c,Respond_to_Question_3__c,Respond_to_Question_4__c,Respond_to_Question_5__c,Respond_to_Question_6__c,Respond_to_Question_7__c,Respond_to_Question_8__c,Respond_to_Question_9__c,Respond_to_Question_10__c,Respond_to_Question_11__c from AKS_Checklist_AGR__c where Internal_Risk_Details__c=:irr.id];
            //for(AKS_Checklist_AGR__c aksrec1:akss){
            if((aksrec.Respond_to_Question_1__c=='Yes' && aksrec.Respond_to_Question_2__c=='Yes' && aksrec.Respond_to_Question_3__c=='Yes' && aksrec.Respond_to_Question_4__c=='Yes'  && aksrec.Respond_to_Question_5__c=='Yes' && aksrec.Respond_to_Question_6__c=='Yes' && aksrec.Respond_to_Question_7__c=='Yes'  && aksrec.Respond_to_Question_8__c=='Yes'  && aksrec.Respond_to_Question_9__c=='Yes') || (aksrec.Respond_to_Question_10__c=='Yes'  && aksrec.Respond_to_Question_11__c=='Yes'))
            {
               // i++;
                //}
            //}if(akss.size()==i){
            irr.legal_AKS_confirmation__c='Complete';
                  }
            else{
                    irr.legal_AKS_confirmation__c='Not All Affirmative';   
                  }
            update irr;       
        }
        PageReference pr =new PageReference('/'+irr.id);
       // PageReference pr =new PageReference('/apex/AKSChecklistview?id=aksrec.id');
        
        return pr;
    }

   /* public pagereference aksflow()
    {
      PageReference pr=new PageReference('/flow/AKSChecklist_flow');
          pr.getParameters().put('varArrangementId',agr.Id);
              pr.getParameters().put('varRecordType',recordTypeId);
              
        pr.getParameters().put('irrid',irr.id);
        pr.getParameters().put('retURL',agr.id);
            return pr ;
    }*/
    
    public pagereference closepage()
    {
        pagereference pr1=new pagereference('/'+irr.id);
        return pr1;
    }
     
}
@isTest
public class Transaction_TDSaveTest
{
  static testmethod void upload()
  {
     RecordType rt=[Select Id,Name from RecordType where Name='TD Attestation' and SObjectType='ROD_Attestation__c'];
     
     ROD_Attestation__c rd=new ROD_Attestation__c();
     rd.TD1_Terms_Not_based_on_Ref__c='Yes';
     rd.TD2_Pmts_based_on_Pro_Rata__c='Yes';
     rd.TD3_Mgmt_Fee_Less_than_7_percent__c='Yes';
     rd.TD4_Outside_Agreements_Vetted__c='Yes';
     rd.RecordTypeId=rt.Id;
     insert rd;
     
     ApexPages.StandardController std=new ApexPages.StandardController(rd);
     Transaction_TDSave td=new Transaction_TDSave(std);
     td.upload();
  }
}
User-added imageHello Everyone, I want to create a FLOW for the above requirement  IF work order/change order/Amendment is created  agreement hierarchy should be maintained d

 
Write a trigger - If an agreement is canceled, it should auto-delete after 5 days of canceling. and a Warning sign will be displayed on the screen after an agreement is canceled.

Please help me..!

Write a trigger - when an agreement will auto-expire when the expiration date is met an alert will be sent 3 months before the expiration date.

Hello All ..! Can anyone help me or guide me on this -
how to throw a custom error in a flow inside a approval process ?

let me know if possible example if Yes.

Can anyone help me with this -I want you to do full R&D on flows that if we can use flows on the approval process and we can through custom error ?.

Could you please explain this statement like any full R&D?

I have a requirement like this, can anyone let me know about the same R&D ? Please

ERROR:- System.NullPointerException: Attempt to de-reference a null object System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Account__c]: [Account__c]

Testclass:-

@isTest
public class FacilityTriggerTest {

    @isTest
    public static void updateagreementTest() {
        Apttus__APTS_Agreement__c agreement = new Apttus__APTS_Agreement__c();
        agreement.Name = 'Test Agreement';
        insert agreement;

        Facility__c facility = new Facility__c();
        //facility.Name = 'Test Facility';
        facility.Agreement__c = agreement.Id;
        //facility.Davita_legal_entity__c = 'Test Legal Entity';
        //facility.Facility_Division__c = 'Test Division';
        //facility.Facility_Group__c = 'Test Group';
        //.Davita_legal_Entity_Name__c = 'Test Legal Entity Name';
        //facility.Facility_Name__c = 'Test Facility Name';
        //facility.Facility_Number__c = '123456';
        insert facility;

        List<Facility__c> facilityList = new List<Facility__c>();
        facilityList.add(facility);

        Test.startTest();
        FacilityHandler.updateagreement(facilityList);
        Test.stopTest();

        Apttus__APTS_Agreement__c updatedAgreement = [SELECT Id, Facility_Name_for_Template__c, Facility_Number_for_Template__c, Division_Name__c, Palmer_Group__c, Davita_Legal_Entity_2__c
                                                      FROM Apttus__APTS_Agreement__c
                                                      WHERE Id = :agreement.Id];

        System.assertEquals(facility.Davita_legal_entity__c, updatedAgreement.Davita_Legal_Entity_2__c);
        //Changed as Divisin__c to Division_Name__c on 28/06/2023
        System.assertEquals(facility.Facility_Division__c, updatedAgreement.Division_Name__c);
        System.assertEquals(facility.Facility_Group__c, updatedAgreement.Palmer_Group__c);
        System.assertEquals(facility.Davita_legal_Entity_Name__c, updatedAgreement.Davita_Legal_Entity_2__c);
        System.assertEquals(facility.Facility_Name__c, updatedAgreement.Facility_Name_for_Template__c);
        System.assertEquals(facility.Facility_Number__c, updatedAgreement.Facility_Number_for_Template__c);
    }

    @isTest
    public static void facilityMethodTest() {
        Apttus__APTS_Agreement__c agreement = new Apttus__APTS_Agreement__c();
        agreement.Name = 'Test Agreement';
        insert agreement;

        Facility__c facility = new Facility__c();
        //facility.Name = 'Test Facility';
        facility.Agreement__c = agreement.Id;
        facility.Account__r.Name = 'Test Account';
        insert facility;

        List<Facility__c> newFacilityList = new List<Facility__c>();
        newFacilityList.add(facility);

        List<Facility__c> oldFacilityList = new List<Facility__c>();

        Test.startTest();
        FacilityHandler.facilityMethod(newFacilityList, oldFacilityList, true, false);
        Test.stopTest();

        Apttus__APTS_Agreement__c updatedAgreement = [SELECT Id, Facility_Name__c
                                                      FROM Apttus__APTS_Agreement__c
                                                      WHERE Id = :agreement.Id];

        System.assertEquals(facility.Account__r.Name, updatedAgreement.Facility_Name__c);
    }
}

APEXclass:-
trigger FacilityTrigger on Facility__c(after insert, after update, after delete) {

    if (trigger.isAfter && (trigger.IsInsert || trigger.IsUpdate)) {
        FacilityHandler.updateagreement(trigger.New);
    }
    if (trigger.isAfter && (trigger.IsInsert || trigger.IsUpdate || trigger.IsDelete)) {
        FacilityHandler.facilityMethod(trigger.new, trigger.old, trigger.IsInsert, trigger.IsUpdate);
    }
}
@isTest
public class Transaction_TDSaveTest
{
  static testmethod void upload()
  {
     RecordType rt=[Select Id,Name from RecordType where Name='TD Attestation' and SObjectType='ROD_Attestation__c'];
     
     ROD_Attestation__c rd=new ROD_Attestation__c();
     rd.TD1_Terms_Not_based_on_Ref__c='Yes';
     rd.TD2_Pmts_based_on_Pro_Rata__c='Yes';
     rd.TD3_Mgmt_Fee_Less_than_7_percent__c='Yes';
     rd.TD4_Outside_Agreements_Vetted__c='Yes';
     rd.RecordTypeId=rt.Id;
     insert rd;
     
     ApexPages.StandardController std=new ApexPages.StandardController(rd);
     Transaction_TDSave td=new Transaction_TDSave(std);
     td.upload();
  }
}
Write a trigger - If an agreement is canceled, it should auto-delete after 5 days of canceling. and a Warning sign will be displayed on the screen after an agreement is canceled.

Please help me..!

Write a trigger - when an agreement will auto-expire when the expiration date is met an alert will be sent 3 months before the expiration date.