• S M
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies
Hello,

We are building a process to make it easier for admins to create new users and change their License/Profile and Role. We are using Aura components and Flows for this.

On the screen, I need to display the selected user's current License Profile and Role and then allow them to be able to change it. Once they select a License from the dropdown, the Profiles need to be like a dependent picklist and show only the ones that can be assigned based on the selected License.

Can you guide me to a resource that can give me details on this please
  • December 19, 2019
  • Like
  • 0
Account have Opportunities. Opportunities have OpportunityTeamMembers
Accounts also have Territory(Custom Object API Name = Territory_Lookup__c). Territory Object has a field called Geo.

I need to write a SOQL query from OpportunityTeamMembers to lookup the Account -> Its Territory and the Geo on the Territory

Select Id, TaxEntity__c, OpportunityId.AccountId.Territory_Lookup__r.Geo__c From OpportunityTeamMmeber

The component - OpportunityId.AccountId.Territory_Lookup__r.Geo__c is incorrect. Can you please suggest how to get this 
  • July 16, 2019
  • Like
  • 0
public static void updateGeoTaxEntity(List<OpportunityTeamMember> newOpportunityTeamMembers){
		List<OpportunityTeamMember> otmsToUpdate = new List<OpportunityTeamMember>();
        Set<Id> opportunityIds = new Set<Id>();
        for(OpportunityTeamMember currentOTM : newOpportunityTeamMembers){
            opportunityIds.add(currentOTM.opportunityId); 
        }
               
        Map<Id,Opportunity> relatedOpps = new Map<Id,Opportunity>([SELECT Id, Terr_Geo__c, Tax_Entity__c FROM Opportunity WHERE Id IN:opportunityIds]);
        for(OpportunityTeamMember currentOTM : newOpportunityTeamMembers){
            if(relatedOpps.containsKey(currentOTM.OpportunityId)){
                Opportunity opp = relatedOpps.get(currentOTM.OpportunityId);
                currentOTM.Geo__c = opp.Terr_Geo__c;
                currentOTM.Tax_Entity__c = opp.Tax_Entity__c;
                otmsToUpdate.add(currentOTM);
            }
        } 
    }

This is my OpportunityTeamMemberHelper class that was called by my OpportunityTeamMemberTrigger.

I have a method updateGeoTaxEntity that gets a list of OpportunityTeamMember records that are being inserted. My intention is to update all OpportunityTeamMember records with the same value for Territory and Geo as is existing within the Opportunity.

The above code works.

But I need to remove the select query and replace it with a Selector Layer Query. All it means is that I cannot use that Select Query in my code. I use a Selector Utility code that gives me a list of Opportunity records for the ids found in opportunityIds.

I need to now get a map of Map<Id,Opportunity>

I can get the id from newOpportunityTeamMember.opportunityId but how do i link it to the opportunity record that I just queried?

Please can you help?


 
  • July 09, 2019
  • Like
  • 0
I need to have a select Query in my Apex method that has this line - 

AND Pending_Agreement_DateStamp__c <= LAST_N_DAYS:pendingDays

The pendingDays in an Integer value that is passed to this method
I tried using Sting.valueOf or Integer.valueOf but they dont seem to work. Please let me know what I should use there?
  • April 10, 2019
  • Like
  • 0
I need to have a select Query in my Apex method that has this line - 

AND Pending_Agreement_DateStamp__c <= LAST_N_DAYS:pendingDays

The pendingDays in an Integer value that is passed to this method
I tried using Sting.valueOf or Integer.valueOf but they dont seem to work. Please let me know what I should use there?
  • April 10, 2019
  • Like
  • 0