• Alex Toba 19
  • NEWBIE
  • -1 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 7
    Replies

I am trying to pass an opportunity record collection from a flow into an Apex Action that will loop through the opportunity record collection (LIST), then create an opportunity team member record for each opportunity in that list, then return the new list as a new opportunity team member collection that will be an output variable accessable via the flow.  However, I keep getting the following errors that I cannot resolve.  I am new to Apex so I am guessing that my MAP setup is wrong.

 

Illegal assignment from List<Opportunity> to List<OpportunityService1.ReturnVariables>

Illegal assignment from OpportunityTeamMember to OpportunityService1.ReturnVariables

//invocable method to create OpportunityTeamMember records from a list of Opportunity Ids
    @InvocableMethod(label='Create OTM Records for OOO' description='Given a list of Opportunity IDs, create OTM records from these IDs.')
        public static List<ListReturnVariables> createOTMRecords(List<InputVariables> inputVariables) {

            //inputs
            List<Opportunity> opps = inputVariables.get(0).opportunities;
            String varUserId;
            

            //outputs       
            
            Map<Id, Opportunity> opp = new Map<Id, Opportunity>(opps);
            List<ReturnVariables> OTMOutputs =[SELECT Id FROM Opportunity WHERE Id IN: opp.keySet()];
            for(Opportunity o : opp.values()){
            ReturnVariables otm = new OpportunityTeamMember(OpportunityId = o.Id, UserId = varUserId, OpportunityAccessLevel = 'Edit',TeamMemberRole = 'Mortgage Banker');
                OTMOutputs.add(otm);
            }
            return OTMOutputs;
        }
        public class InputVariables {
            @InvocableVariable
            public List <Opportunity> opportunities;

            @InvocableVariable
            public String varUserId;
        }
        public class ReturnVariables {
            @InvocableVariable
            public List <OpportunityTeamMember> OTMOutputs;
        }
we did a migration and the 'Article Created By' field was populated by the name of the person who ran the migration script...

we did write the original creator to the 'Owner' field during the migration... However, the Owner field is not available for all Report Types... List Views... Filters... etc...

so now we do not have a way to accurately report on who created conent...

The best option would be to correct the name in the Article Created By field...  I've been told that we can not edit the 'Article Created By' field

I understand that it may be an 'audit' field and is not allowed to be edited by default...  

However, it seems that there must be a 'back end' way to modify that field even it needs to be done at a data level...  

I've also read that we could possibly create a 'custom field' with the data and insert it...  but then again we will need to customize all Report Types, List Views, Filters, etc...  and update all pages to show the Custom Field rather than the default 'Artilce Created By' field...

making future maintenance more challenging... 
Is there any way to bypass lookup filter validation for specific user ?
Team - I have a very simple requirement when the lead owner gets changed, the system should send out an email to New Lead Owner.
ISCHANGED(OwnerId)

Using the above formula in the Workflow & Flow, the emails get triggered whenever the system admin did the changes but whenever the Non-System admin does the same changes the email is not triggered.

Thanks,
VSK98
 
  • March 07, 2023
  • Like
  • 0

Hello, 

We have a process where we clone a case and files via apex and create a new case of a different record type. It all works fine, except now I have been asked to add select the multi-select picklist values of the previous case and populate the same field on the new case. 

It is mostly working, however it's not formatted correctly. I have the following:

            //Now grab the Message Types Impacted and copy the it over
            List<Case> messageTypesi=[SELECT Message_Types_Impacted__c FROM Case WHERE Id =:sourceCaseId];
            if(!messageTypesi.isEmpty()) {
                clonedCase.Message_Types_Impacted__c =  string.valueOf(messageTypesi[0]);
            }

It is grabbing the value however it looks like this:

Eligibility;Case:{Message_Types_Impacted__c=Renewals;RxTransfer, Id=50002000006wgGpAAI}

I just want to grab the values like:  Eligibility;Renewals;RxTransfer

I think I have to somehow loop through the query and split the string at the semicolon and then add it to an array? but I'm not sure how to do that.

Thanks!

 

 

I have a need to provide a way for people to select which uploaded/related files fulfill a specific purpose (essentially, which file s provide proof of authorization).  I was hoping to use the TagCsv field and when they select the file, update the tags to indicate which file(s) provide that authorization.

However, it appears that the TagCsv field is not available for files shared to an object record -- only files in a public library. It also appears that tagging is not supported in lightning.

Are there any recommended ways to implement something similar or some way to permit access to the TagCsv field on a contentversion uploaded to (shared with) a record?

My thoughts so far have been:
* Use the description field instead and add my tag at the beginning or end of it.
* Create a join object that implements tagging (RecordId, DocumentId, Tags (long text area)
* Embed a list of Ids in a custom field on the record of all the files selected for this purpose (yuck!)

How can we allow user to change the owner of the particular account records, owned by user who is above him in role hierarchy. 

If we provide 'Trannfer record' permission to him, then he can change the owner of all the account records those are above him in role hierarchy. But I need to allow to change the owner of the particular user, who is above him in role hierarchy.