• Smita Hodiggeri (Admin)
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 1
    Replies
Hi Community,

I am looking to automate the following seeking ideas I would prefer non code way but also open to code with more guidance. 

when a user is unassigned with permission set Inbox with Einstein Activity Capture or Inbox without Einstein Activity Capture then automatically permission set license assignments list should have it removed.
 
Looking to build a solution that will auto clear  Text Field Text(255) on Account records when user clicks into it.
I understand that this can be achived only through code.(Would love to know if there are any non code ways)
Can I get some ideas thrown at me for achiveing this? 

Many thanks,
Smita Hodiggeri
Hi Community,

I have requirement where in there is an object (Engagement) which can multiple project tasks. I need to come with a validation rule which will fire on Engagement record when any of the project tasks created doesnt have a particular field (pratice field populated) in addition checking that Engagement record needs to be of particular practice.
I am thinking will having a lookup between relationship between Engagement and project task help me in coming up with a validation rule that would check if there ANY one of the project tasks exists with NO Practice field populated and it will fire up the validation rule.

Any thoughts on how this can be resolved would be appreciated.

Many thanks,
Smita 
Hi Community,

Can someone help me resolve this issue?

My formula field throws error Error: Syntax error. Extra ',' for the following
IF(ISBLANK(ffpsai__BillingEvent__r.Company_ABN__c),'2414235y',ffpsai__BillingEvent__r.Company_ABN__c),IF(NOT(ISBLANK(ABN_Override__c)),ABN_Override__c,'123324')
Tried few parathsis things.  ABN override is a text field
My Class

public class EngagementSharepointFolderCreation {
    @InvocableMethod(label='Setup Engagements Folder structure in Sharepoint' description='Creates accounts with children of Opportunities and Deliverables')
    public static void CreateEngagementsFolder (List<String> engagementId){
        CreateEngagementsFolderHierarchy(engagementId);
    }
    @future(callout=true)
    public static void CreateEngagementsFolderHierarchy(List<String> lstOfEngagementIds){ 
        try{
            // get the Engagement
            List<pse__Proj__c> lstOfEngagementRecs = [Select Id,pse__Account__r.Account_Opt_DFIR_Eng_Folder_ID__c,pse__Account__r.Account_Sharepoint_Folder_Name__c,Engagement_SharePoint_Folder_Name__c, AccountEngagementSharePointFolderIdOnEng__c,pse__Account__c, pse__Account__r.Name, pse__Account__r.Account_Engagement_SharePoint_Folder_Id__c, pse__Opportunity__r.Name,pse__Account__r.Opportunity_Sharepoint_Folder_Id__c, pse__Proj__c.Engagement_Sharepoint_Folder_Id__c from pse__Proj__c where Id = :lstOfEngagementIds];
            
            List<Account> lstOfAccountsToPSEFolderIds = new List<Account>();
            List<Account> lstOfAccountsToPSEFolderIdsDFIR = new List<Account>();
            
            List<Opportunity> lstOfOppPSEFolderIds = new List<Opportunity>();
            List<Opportunity> lstOfOppPSEFolderIdsDFIR = new List<Opportunity>();
            
            //get auth info from the Settings MDT
            fileforcem1__Sharepoint_Settings__mdt orgSettings = [SELECT fileforcem1__Named_Credential__c,fileforcem1__Document_Library_Id__c,fileforcem1__Site_Id__c FROM fileforcem1__Sharepoint_Settings__mdt WHERE Developername = 'Default' limit 1];
            
            //Initialize the client object
            fileforcem1.ClientApi apiClient = new fileforcem1.ClientApi();
            apiClient.namedCredentialName = orgSettings.fileforcem1__Named_Credential__c;
            
            
            //get the root folder id for the Engagement -- Need to check whats this?
            fileforcem1__SharePoint_Object_Settings__mdt objectSettings = [SELECT fileforcem1__Root_Folder_Id__c,fileforcem1__Site_Id__c,fileforcem1__Document_Library_Id__c,fileforcem1__Initial_Folder_Structure__c FROM fileforcem1__Sharepoint_Object_Settings__mdt WHERE MasterLabel ='pse__Proj__c' LIMIT 1 ];
            
            apiClient.sharepointSiteId = objectSettings.fileforcem1__Site_Id__c;
            apiClient.documentLibraryId = objectSettings.fileforcem1__Document_Library_Id__c;
            for(pse__Proj__c  engagement : lstOfEngagementRecs){
                String accFolderId;
                fileforcem1.SharepointFileInfo accFolder1;
                if (String.isBlank(engagement.pse__Account__r.Account_Opt_DFIR_Eng_Folder_ID__c))
                {
                    //Create the Customer Account folder and record the ID
                    
                    if (!Test.isRunningTest()) {
                        accFolder1 = apiClient.createFolder(Label.PSA_DFIR, engagement.pse__Account__r.Account_Sharepoint_Folder_Name__c);
                        } else {accFolder1=new fileforcem1.SharepointFileInfo();}
                    accFolderId = accFolder1.Id;
                    lstOfAccountsToPSEFolderIdsDFIR.add(new Account(Id = engagement.pse__Account__c, Account_Opt_DFIR_Eng_Folder_ID__c = accFolder1.Id));        
                }else{ accFolderId = engagement.pse__Account__r.Account_Opt_DFIR_Eng_Folder_ID__c;
                }
                
                //Create the opportunity folder and record the ID
                fileforcem1.SharepointFileInfo oppFolder1;
                if (!Test.isRunningTest()) {
                    oppFolder1 = apiClient.createFolder(accFolderId, engagement.pse__Opportunity__r.Name);
                    
                } else{ oppFolder1 = new fileforcem1.SharepointFileInfo();}
                lstOfOppPSEFolderIdsDFIR.add(new Opportunity(Id = engagement.pse__Opportunity__c, Opportunity_DFIR_PSA_Sharepoint_FolderId__c = oppFolder1.Id));
                

                System.debug('Opp Folder created successfully'+oppFolder1.Id);
                
                //Create Engagement folder
                fileforcem1.SharepointFileInfo pseFolder1;
                if (!Test.isRunningTest()){
                pseFolder1 = apiClient.createFolder(oppFolder1.Id, engagement.Engagement_SharePoint_Folder_Name__c);
                }
                
                 else{ pseFolder1 = new fileforcem1.SharepointFileInfo();
                     }
                 engagement.sharepoint_folder_id__c = pseFolder1.Id;
                 engagement.DFIR_PSA_Folder_Id__c= pseFolder1.Id;

                
                
                //Create Deliverables Folder under opportunity
                fileforcem1.SharepointFileInfo Deliverable1Folder1;
                if (!Test.isRunningTest()) {
                    Deliverable1Folder1  = apiClient.createFolder(pseFolder1.Id, 'Deliverables');
                } 
                else {Deliverable1Folder1 = new fileforcem1.SharepointFileInfo(); }
                engagement.DFIR_Deliverable_Folder_Id__c = Deliverable1Folder1.Id;
                System.debug('Deliverable Folder created successfully'+Deliverable1Folder1.Id);
                
                
                
                fileforcem1.SharepointFileInfo accFolder;
                if (String.isBlank(engagement.pse__Account__r.Account_Engagement_SharePoint_Folder_Id__c))
                {
                    //Create the Customer Account folder and record the ID
                    
                    if (!Test.isRunningTest()) {
                        accFolder = apiClient.createFolder(Label.PSA_CCX_Account, engagement.pse__Account__r.Account_Sharepoint_Folder_Name__c);
                        } else {accFolder=new fileforcem1.SharepointFileInfo();}
                    accFolderId = accFolder.Id;
                    lstOfAccountsToPSEFolderIds.add(new Account(Id = engagement.pse__Account__c, Account_Engagement_SharePoint_Folder_Id__c = accFolder.Id));        
                }else{ accFolderId = engagement.pse__Account__r.Account_Engagement_SharePoint_Folder_Id__c;
                }
                
                //Create the opportunity folder and record the ID
                fileforcem1.SharepointFileInfo oppFolder;
                if (!Test.isRunningTest()) {
                    oppFolder = apiClient.createFolder(accFolderId, engagement.pse__Opportunity__r.Name);
                    
                } else{ oppFolder = new fileforcem1.SharepointFileInfo();}
                lstOfOppPSEFolderIds.add(new Opportunity(Id = engagement.pse__Opportunity__c, Opportunity_PSA_Sharepoint_Folder_Id__c = oppFolder.Id));
                

                System.debug('Opp Folder created successfully'+oppFolder.Id);
                
                //Create Engagement folder
                fileforcem1.SharepointFileInfo pseFolder;
                if (!Test.isRunningTest()){
                pseFolder = apiClient.createFolder(oppFolder.Id, engagement.Engagement_SharePoint_Folder_Name__c);
                }
                
                 else{ pseFolder = new fileforcem1.SharepointFileInfo();
                     }
                 engagement.sharepoint_folder_id__c = pseFolder.Id;
                 engagement.pse_folder_id__c= pseFolder.Id;

                
                
                //Create Deliverables Folder under opportunity
                fileforcem1.SharepointFileInfo Deliverable1Folder;
                if (!Test.isRunningTest()) {
                    Deliverable1Folder  = apiClient.createFolder(pseFolder.Id, 'Deliverables');
                } 
                else {Deliverable1Folder = new fileforcem1.SharepointFileInfo(); }
                engagement.Deliverable_Folder_Id__c= Deliverable1Folder.Id;
                
                
                
            }
            // update Account Engagement Folder Id 
            if(!lstOfAccountsToPSEFolderIds.isEmpty()){
                update lstOfAccountsToPSEFolderIds;
            }
            // update Opportunity Engagement Folder Id
            if(!lstOfOppPSEFolderIds.isEmpty()){
                update lstOfOppPSEFolderIds;
            }
            // update Account Engagement Folder Id 
            if(!lstOfAccountsToPSEFolderIdsDFIR.isEmpty()){
                update lstOfAccountsToPSEFolderIdsDFIR;
            }
            // update Opportunity Engagement Folder Id
            if(!lstOfOppPSEFolderIdsDFIR.isEmpty()){
                update lstOfOppPSEFolderIdsDFIR;
            }
            
            //update the opportunity to save the IDs
            update lstOfEngagementRecs;
        }
        
        catch(DmlException e) {
            System.debug('The following exception has occurred: ' + e.getMessage());
        }
    }
}

My Code to run this class in anon window so far
List<pse__Proj__c> lstOfEngagementRecs = [Select Id,pse__Account__r.Account_Opt_DFIR_Eng_Folder_ID__c,pse__Account__r.Account_Sharepoint_Folder_Name__c,Engagement_SharePoint_Folder_Name__c, AccountEngagementSharePointFolderIdOnEng__c,pse__Account__c, pse__Account__r.Name, pse__Account__r.Account_Engagement_SharePoint_Folder_Id__c, pse__Opportunity__r.Name,pse__Account__r.Opportunity_Sharepoint_Folder_Id__c, pse__Proj__c.Engagement_Sharepoint_Folder_Id__c from pse__Proj__c WHERE pse__Opportunity__c <> null AND AccountEngagementSharePointFolderIdOnEng__c = null];
   List<pse__Proj__c> lstEngIds = new List<pse__Proj__c>();
   lstEngIds.add(lstOfEngagementRecs);
    EngagementSharepointFolderCreation.CreateEngagementsFolderHierarchy(lstEngIds);

I know my code to invoke the class is wrong I am not sure about the syntax. begineer developer here. 
When an account gets created in Salesforce it first creates a Account folder structure in Customers_Preprod sharepoint site, the similar folder structure for the same Account will get created on Engagement_Preprod ONLY when an engagement gets created, so we need build logic to create this link to customer preprod to engagement preprod when there is an account folder structure created i:e check if account folder exists on Engagement preprod and if yes create a link in the Customer preprod for that particular account in the customer preprod. How can i acheive this using APEX Code?

I would like extended information on how to implement as I am beginner dev. 
Thanks,
Smita 
Hi Community,

I am a begineer developer, and I have requirement where in everytime a record is created automation needs to click on detail page button(Source Visualforce Page)  so that it can do its job on the record that was created newly and this should happen verytime a new reocrd is created.
I am uploading(creating) series of records from Data loader so I am thinking how do I do this? 
I would like detailed instructions if its code please.
Thank you,
Look forward to the learning
Hi Community,

Can someone help me resolve this issue?

My formula field throws error Error: Syntax error. Extra ',' for the following
IF(ISBLANK(ffpsai__BillingEvent__r.Company_ABN__c),'2414235y',ffpsai__BillingEvent__r.Company_ABN__c),IF(NOT(ISBLANK(ABN_Override__c)),ABN_Override__c,'123324')
Tried few parathsis things.  ABN override is a text field