• Parag Bhatt 10
  • NEWBIE
  • 114 Points
  • Member since 2017

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 24
    Replies
I am unable to check the box Allow users to relate a contact to multiple accounts and don't seem to be able to complete the rest of the steps without doing this, can anyone please advise as this section is confusing me? I'm using Salesforce Classic. Thanks.
subodh chaturvedi 17 
how to update a parent field (checkbox) Based on child records field Values.
 i have checkbox field Visa__c In Account & i have a custom Object (Card program ) where i have two fields Cardtype __c & card_processor_status__c, so the requiremnt is when the  cardtype__c=Visa  & Card_processor_Status__c =Active then the Checkbox should get check in Visa__c in account & when the two fields value is other than visa & active the  checkbox should get unchecked.

let suppose we have 10 records in Cardprogram out of 10 if atleast 1 record have fullfill the criteria then also the checkbox should get checked .

Here is the criteria for when the “Visa” field should be TRUE:
There is a Card Program record related to the Account that has at least one single record that meets both the criteria below:
The “Card Type” field is “Visa”
The “Card Processor Status” field is “Active”
 
Hi All,

I have a Visualforce Page that show a report that I created in my org through the tag "analytics:reportChart". Every user that click on the report on my VF Page can redirect to the link of the report, how can I set the report as read only for every user?  

Thanks,

Antonino 
Populate the comma separated related Contact name on Account Description field which should work for insert, update and delete case.
Hi guys,
i recently completed 100% of the admin beginner trail, but salesforce still didn't add it up to my trail's count on my profile, what should i do? thank you
While we Run Test in Sandbox it covers 100% , but during the deployment to Production it throws an error that Code Coverage Failure. 
Also we are unable to find the status(failed or successed)


Thanks in advance

Regards
Rathod
Hi Gurus, 

I have a visualforce page that has four links to others VF pages via an apex code page. All three links works and redirects when clicked however when I add the fourth link, they all do not work. 

So I was wondering, is their a maxixmum amount of page reference that can be on one apex page? 

If so how can i overcome this issue has I need to have at least 10 page References.


Thanks very much!
 
Hi, I'm running into the famous SOQL Governor limit's when executing Apex batch. One of the reasons is that whenever a case record is updated ... the MileStoneTimeCalculator class is called/executed which has 4 SOQL queries.

Maybe anyone of you can simplify the code and lower the SOQL queries. All help is gratefully appreciated ...
 
Global class U4_Legacy_INC_MilestoneTimeCalculator implements Support.MilestoneTriggerTimeCalculator {

    //** Constructor for this class.
    global Integer calculateMilestoneTriggerTime(String caseId, String milestoneTypeId)
    {  
        Integer MilestoneValue;
        Product_Milestone_Times__c ProductMilestoneSet;
        Milestone_Times__c EntitlementMilestoneSet;

        //** Select values from case
        Case caseRec = [SELECT Id, EntitlementId, ProductId, Priority, Contractual_Type__c FROM Case WHERE Id=:caseId LIMIT 1];
        MilestoneType mtype = [SELECT Name FROM MilestoneType WHERE Id=:milestoneTypeId];

        // Retrieve Milestone definition from Entitlement
        EntitlementMilestoneSet = [SELECT Response_Time__c, Resolution_Time__c, Software_Resolution_Time__c FROM Milestone_Times__c WHERE Entitlement__c =: caseRec.EntitlementId AND Priority__c =: caseRec.Priority];

        // Retrieve Internal Milestone definition from Product
        ProductMilestoneSet = [SELECT Response_Time__c, Resolution_Time__c, Software_Resolution_Time__c FROM Product_Milestone_Times__c WHERE Product__c =: caseRec.ProductId AND Priority__c =: caseRec.Priority];

        if(mtype.Name == SEConstants.FIRSTRESPONSETIME){
            if(caseRec.Contractual_Type__c == SEConstants.INTERNAL_ONLY)
            {
                // Take First Response time from Product
                MilestoneValue = ProductMilestoneSet.Response_Time__c.intValue();
            }
            else
            {
                // Take First Response time from Entitlement
                MilestoneValue = EntitlementMilestoneSet.Response_Time__c.intValue();
            }
        } // Response Time
        
        if(mtype.Name == SEConstants.RESOLUTIONTIME){
            if(caseRec.Contractual_Type__c == SEConstants.INTERNAL_ONLY || caseRec.Contractual_Type__c == SEConstants.FIRST_RESPONSE_ONLY)
            {
                // Take Resolution time from Product
                MilestoneValue = ProductMilestoneSet.Resolution_Time__c.intValue();
            }
            else
            {
                // Take Resolution time from Entitlement
                MilestoneValue = EntitlementMilestoneSet.Resolution_Time__c.intValue();
            }
        } // Resolution Time
            
        if(mtype.Name == SEConstants.SOFTWARERESOLUTIONTIME){
           If(caseRec.Contractual_Type__c == SEConstants.INTERNAL_ONLY || caseRec.Contractual_Type__c == SEConstants.FIRST_RESPONSE_ONLY || caseRec.Contractual_Type__c == SEConstants.FIRST_RESPONSE_RESOLUTION_ONLY || (caseRec.Contractual_Type__c == SEConstants.FIRST_RESPONSE_RESOLUTION_P1_P2_SOFTWARE && (caseRec.Priority == SEConstants.PRIORITY_3 || caseRec.Priority == SEConstants.PRIORITY_4)))
            {
                // Take Software Resolution time from Product
                MilestoneValue = ProductMilestoneSet.Software_Resolution_Time__c.intValue();
            }
            Else
            {
                // Take Software Resolution time from Entitlement
                MilestoneValue = EntitlementMilestoneSet.Software_Resolution_Time__c.intValue();
            }
        } // Software Resolution Time       
        Return MilestoneValue;
    }
}

 
I am unable to check the box Allow users to relate a contact to multiple accounts and don't seem to be able to complete the rest of the steps without doing this, can anyone please advise as this section is confusing me? I'm using Salesforce Classic. Thanks.
Can you please provide some code
Hi All,
I have written a small trigger on opportunity.Which is updating field 'opportunity sales Leader' with the user in opportunity team member.Here is trigger.
trigger UpdateOpportunity on Opportunity (after insert) 
{
    Set<Id> setOfOppty = new Set<Id>();
    List<Opportunity> listOfOpptyToUpdate = new List<Opportunity>();
    for(Opportunity opp : Trigger.New){
        if(opp != null && (opp.RecordTypeId == Label.Oppty_Record_Type_ISV || opp.RecordTypeId == Label.Oppty_Record_Type_OEM || opp.RecordTypeId == Label.Oppty_Record_Type_Wholesale || opp.RecordTypeId == Label.Oppty_Record_Type_xSP)){
            setOfOppty.add(opp.Id);
        }
    }
    List<OpportunityTeamMember> listOTM = new List<OpportunityTeamMember>([SELECT Id, UserId, OpportunityId, User.Name FROM OpportunityTeamMember WHERE OpportunityId in :setOfOppty AND TeamMemberRole = :Label.Opportunity_Sales_Leader]);
    for(OpportunityTeamMember otmObj: listOTM){
        
        if(otmObj != null && otmObj.UserId!=null && otmObj.OpportunityId != null){
            Opportunity opp = new Opportunity(Id = otmObj.OpportunityId, Opportunity_Team_Member_Sales_Leader__c = otmObj.UserId);
            listOfOpptyToUpdate.add(opp);
        }
    }   
    if(!listOfOpptyToUpdate.IsEmpty()){
        Database.SaveResult[] saveResultList = Database.update(listOfOpptyToUpdate,false);
        for(Database.SaveResult svResult : saveResultList){
            if(!svResult.isSuccess()){                
                system.debug('Error::'+svResult);
                break;
            }
        }
    }
}

And Here Is Test clas.;
@Istest(SeeAllData=false)
Private class Test_opportunity 
{
     public static testmethod void testOpportunity()
     {   
         //ProId = [SELECT Id FROM Profile WHERE Name = 'Consumer Sales Ops'].Id;
         User user = new User();
        
        user.FirstName = 'Test';
        user.LastName = 'Name';
        user.CompanyName = 'IT Test Company';
        user.MobilePhone = '123-456-7890';
        
        user.Username = 'testUser-' + '@test.com';
        user.Email = 'testUser-' +'@test.com';
  user.Alias = 'test';
        user.CommunityNickname = 'test1';
        user.TimeZoneSidKey = 'America/New_York';
        user.LocaleSidKey = 'en_US';
        user.EmailEncodingKey = 'UTF-8';
        user.ProfileId = '00e1I000000Veel';
        user.LanguageLocaleKey = 'en_US';
        
        user.Street = '123 Test St';
        user.City = 'Testcity';
        user.State = 'va';
        user.PostalCode = '23223';
        user.Country = 'USA';
        
        insert user;
         Date myDate = Date.today();
         Opportunity opp=new opportunity();
         opp.RecordTypeId='0122F0000004ot9';
         opp.name='test opp';
         opp.AccountId='0012F00000EXcyQ';
         opp.CurrencyIsoCode='AED';
         opp.CloseDate= myDate;
         opp.StageName='Identification';
         opp.Opportunity_Team_Member_Sales_Leader__c=user.Id;
         insert opp;
         OpportunityTeamMember opptyteam=new OpportunityTeamMember();
         opptyteam.opportunityId=opp.Id;
         opptyteam.TeamMemberRole='Sales Leader';
         opptyteam.UserId=user.Id;
         insert opptyteam;
         opp.Opportunity_Team_Member_Sales_Leader__c = opptyteam.UserId;
         update opp;
         
     }
}

But its covering only 53 %
if(otmObj != null && otmObj.UserId!=null && otmObj.OpportunityId != null){
            Opportunity opp = new Opportunity(Id = otmObj.OpportunityId, Opportunity_Team_Member_Sales_Leader__c = otmObj.UserId);
            listOfOpptyToUpdate.add(opp);
        }

this if condition and also error statment is not been covered.any suggestion on this would be really help full
subodh chaturvedi 17 
how to update a parent field (checkbox) Based on child records field Values.
 i have checkbox field Visa__c In Account & i have a custom Object (Card program ) where i have two fields Cardtype __c & card_processor_status__c, so the requiremnt is when the  cardtype__c=Visa  & Card_processor_Status__c =Active then the Checkbox should get check in Visa__c in account & when the two fields value is other than visa & active the  checkbox should get unchecked.

let suppose we have 10 records in Cardprogram out of 10 if atleast 1 record have fullfill the criteria then also the checkbox should get checked .

Here is the criteria for when the “Visa” field should be TRUE:
There is a Card Program record related to the Account that has at least one single record that meets both the criteria below:
The “Card Type” field is “Visa”
The “Card Processor Status” field is “Active”
 
Hi All,

I have a Visualforce Page that show a report that I created in my org through the tag "analytics:reportChart". Every user that click on the report on my VF Page can redirect to the link of the report, how can I set the report as read only for every user?  

Thanks,

Antonino 
Hello.
Anyone, please provide me a legit guide to avail sample projects for practicing.
Populate the comma separated related Contact name on Account Description field which should work for insert, update and delete case.
The convertTimeZone() does not work properly between 12am to 1pm. It gives the output for the previous day. My user is in (GMT+10:00) Australian Eastern Standard Time (New South Wales) (Australia/Sydney) timezone and when the time in this timezone is between 12am to 1am, the SOQL query gives incorrect results:

SELECT Id FROM Activity__c WHERE DAY_ONLY(convertTimeZone(Activity_Closed_Date_Time__c)) =: Date.today()