• Ajay K Dubedi
  • PRO
  • 3722 Points
  • Member since 2015
  • Ajay Dubedi


  • Chatter
    Feed
  • 116
    Best Answers
  • 0
    Likes Received
  • 5
    Likes Given
  • 1
    Questions
  • 909
    Replies
Please help me. I am not sure what's the issue with this class its not updating.
 
public class MyFirstClass {
    public static void method(){
    List<Account> accLst = new List<Account>([select id,name,description from Account where name like 'United%']);
    system.debug('The account lists are:' + accLst);
    List<Account> accupdLst = new List<Account>();
    for(Account acc: accupdLst ){
        acc.Description = 'Updated from Apex Class';
        accupdLst.add(acc);
    }
    if(accupdLst != null && accupdLst.size()>0){
    update accupdLst;
        
    }
    system.debug('The updated account lists are:' + accupdLst);
}
}

Please help me!<

 
Hi Friends,
Could anyone please help on this. I want to put validation rule for zipcode to prevent the special character. And this validation rule should work only for one country(market). I used the below logic but its not working.

IF( ISPICKVAL(ZTS_EU_Market__c, Brazil)NOT(REGEX( ZTS_EU_Zip_Postal_Code__c,"^[a-z  A-Z]*$")))
Please help me on this.
 
  • September 05, 2018
  • Like
  • 0
String sch1 = '0 0/10 * 1/1 * ? *';
System.schedule('Scheduled Job 3', sch1, new myScheduleClass());

I generated the cron expression using tool cronmaker.

ERROR:System.StringException: Seconds and minutes must be specified as integers: 0 0/10 * 1/1 * ? *
Hi All,

I would like to create a validation rule that prevents a user from choosing particular values from a picklist, based on a checkbox value.  Both fields are on the Account object.

So, the picklist values are:

New ICP
BDR Working
Cold
Revisit

If the checkbox field 'Allocated Account?' = True, I only want the user to be able to proceed if they choose either New ICP, BDR Working, or Revisit. E.g. 'Cold' is not an option if the Allocated Account box is ticked.

To complicate matters, I also want to restrict the picklist choices if 'Allocated Account?' = False, so in that scenario, there would be an error if they tried to select 'Revisit'.  Would I need 2 validation rules, or can this all be accomplished with one?

Hope that all makes sense? Thanks so much in advance for your help!  (Yes, I know I need the API field names, I'm being lazy....will add them in when I actually build it! :-) )

Emma
Hi all,
I have a validation rule I need to run where 3 things need to be true for it to fire. A needs to = True, B=True and C OR D = True.
I can't figure out the syntax for this.  I thought maybe:
AND(A=True, B=True, OR(C=True,D=True)  But that didn't work.  Any ideas?
User-added image

User-added image

Its throwing this error without showing me a Map or change option in the left panel. So how should I map the custom field here? Any help ?
I have 2 custom objects: Student and Registration.They have a same field class. Registration has a lookup to Student. I need to update all related registration records's class field when the class of student is updated using triggers. (A student can have multiple registrations)
Thanks in advance.
Hi All,

I need a trigger to update Contact Description and Contact related Case object Description whenever Account Description is updated.
Below trigger working fine for updating Contact Description when Account Description is updated. But I need to update Case records of Contact as well.

Here Account is ---> Parent,
Contact is ---> Child,
Case is ---> grand child

trigger ContactDescriptionUpdate on Account (after update) {
    Map < Id,  Account > mapAccount = new Map < Id, Account >();
    List<Contact> listContact = new List<Contact>();
    
    for(Account acct : trigger.new)
        mapAccount.put(acct.Id, acct);
    
    listContact = [ SELECT Description, AccountId FROM Contact WHERE AccountId IN : mapAccount.keySet() ];
    
    if ( listContact.size() > 0 ) {
        for ( Contact con : listContact ) {
            con.Description = mapAccount.get(con.AccountId).Description;
        }
        update listContact;
    }
}

Thanks in advance.
I can see this has been asked a lot, but the answers given aren't helping me change my code to work, so I am really hoping someone can do it for me?

Code below, I just need the background being white. Thanks you!
 
<apex:page standardController="Group_Relationship__c" >
<head>
<style>

tr {
    display: block;
    border-bottom: 1px solid #e6e6e6;
}
td {
    padding-left: 40px;
}
table{
    min-width: 1350px;
    }
</style>
</head>


<apex:form >
<table width="100%"> 
  <tr>
    <td style="width:10%"><apex:image id="ManheimRemarketingBuyer" value="{!If(Group_Relationship__c.Group_Name__r.Group_Buyer_RMA_Count_Form__c >0, $Resource.Remarketing_Buyer_Colour, $Resource.Remarketing_Buyer_BW)}" width="200" height="80"/></td>
    <td style="width:10%"><apex:image url="https://c.eu10.visual.force.com/resource/1513853142000/VolumeBoughtYTDPrevYear2" width="175" height="70"/></td>
    <td style="width:20%"><apex:outputLabel style="vertical-align:top; text-align:center;font-family:calibri;font-size:35px;color:{!IF(Group_Relationship__c.Group_Name__r.Group_Buyer_RMA_Count_Form__c >0, '#004489', '#d9d9d9')};"><apex:outputField label="AccNAme" value="{!Group_Relationship__c.Group_Name__r.Remarketing_Buyer_Volume_Group_Join__c}" /></apex:outputLabel></td>
    
    <td style="width:10%"><apex:image id="DealerAuction" value="{!If(Group_Relationship__c.Group_Name__r.Dealer_Auction_Volume_Group_Form__c >0, $Resource.DealerAuctionImage, $Resource.DealerAuctionImageBW)}" width="200" height="80"/></td>
    <td style="width:10%"><apex:image url="https://c.eu10.visual.force.com/resource/1513853196000/VolumeSoldYTDPrevYear" width="175" height="70"/></td>
    <td style="width:20%"><apex:outputLabel style="vertical-align:top; text-align:center;font-family:calibri;font-size:35px;color:{!IF(Group_Relationship__c.Group_Name__r.Dealer_Auction_Volume_Group_Form__c >0, '#25488e', '#d9d9d9')};"><apex:outputField label="AccNAme" value="{!Group_Relationship__c.Group_Name__r.Dealer_Auction_Volume_Group_Form__c}" /></apex:outputLabel></td>
  </tr>
  <tr>
    <td style="width:10%"><apex:image id="ManheimRemarketingVendor" value="{!If(Group_Relationship__c.Group_Name__r.Group_Vendor_RMA_Count_Form__c >0, $Resource.Remarketing_Vendor_Colour, $Resource.Remarketing_Vendor_BW)}" width="200" height="80"/></td>
    <td style="width:10%"><apex:image url="https://c.eu10.visual.force.com/resource/1513853196000/VolumeSoldYTDPrevYear2" width="175" height="70"/></td>
    <td style="width:20%"><apex:outputLabel style="vertical-align:top; text-align:center;font-family:calibri;font-size:35px;color:{!IF(Group_Relationship__c.Group_Name__r.Group_Vendor_RMA_Count_Form__c >0, '#004489', '#d9d9d9')};"><apex:outputField label="AccNAme" value="{!Group_Relationship__c.Group_Name__r.Remarketing_Vendor_Volume_Group_Join__c}" /></apex:outputLabel></td>
    
    <td style="width:10%"><apex:image id="Motors" value="{!If(Group_Relationship__c.Group_Name__r.Motors_co_uk_Accounts_Group_Form__c >0, $Resource.MotorsImage, $Resource.MotorsImageBW)}" width="200" height="80"/></td>
    <td style="width:10%"><apex:image url="https://c.eu10.visual.force.com/resource/1513853893000/RevenueRolling12" width="175" height="70"/></td>
    <td style="width:20%"><apex:outputLabel style="vertical-align:top; text-align:center;font-family:calibri;font-size:35px;color:{!IF(Group_Relationship__c.Group_Name__r.Motors_co_uk_Accounts_Group_Form__c >0, '#3BB97C', '#d9d9d9')};"><apex:outputField label="AccNAme" value="{!Group_Relationship__c.Group_Name__r.Motors_co_uk_Revenue_Group_Form__c}" /></apex:outputLabel></td>
  </tr>
  <tr>
    <td style="width:10%"><apex:image id="Modix" value="{!If(Group_Relationship__c.Group_Name__r.Modix_Accounts_Group_Form__c >0, $Resource.ModixImage, $Resource.ModixImageBW)}" width="200" height="80"/></td>
    <td style="width:10%"><apex:image url="https://c.eu10.visual.force.com/resource/1513853893000/RevenueRolling12" width="175" height="70"/></td>
    <td style="width:20%"><apex:outputLabel style="vertical-align:top; text-align:center;font-family:calibri;font-size:35px;color:{!IF(Group_Relationship__c.Group_Name__r.Modix_Accounts_Group_Form__c >0, '#FD4F00 ', '#d9d9d9')};"><apex:outputField label="AccNAme" value="{!Group_Relationship__c.Group_Name__r.Modix_Revenue_Group_Form__c}" /></apex:outputLabel></td>
    
    <td style="width:10%"><apex:image id="NextGear" value="{!If(Group_Relationship__c.Group_Name__r.Next_Gear_Accounts_Group_Form__c = 'Live', $Resource.NextGearImage, $Resource.NextGearImageBW)}" width="200" height="80"/></td>
    <td style="width:10%"><apex:image url="https://c.eu10.visual.force.com/resource/1513853383000/StatusPaint" width="175" height="70"/></td>
    <td style="width:20%"><apex:outputLabel style="vertical-align:top; text-align:center;font-family:calibri;font-size:35px;color:{!IF(Group_Relationship__c.Group_Name__r.Next_Gear_Accounts_Group_Form__c = 'Live', '#25488e', '#d9d9d9')};"><apex:outputField label="AccNAme" value="{!Group_Relationship__c.Group_Name__r.Next_Gear_Accounts_Group_Form__c}" /></apex:outputLabel></td>
  </tr>
  <tr>
    <td style="width:10%"><apex:image id="Closit" value="{!If(Group_Relationship__c.Group_Name__r.Lead_Management_Accounts_Group_Form__c >0, $Resource.IncadeaSalesColour, $Resource.IncadeaSalesBW)}" width="200" height="80"/></td>
    <td style="width:10%"><apex:image url="https://c.eu10.visual.force.com/resource/1513853893000/RevenueRolling12" width="175" height="70"/></td>
    <td style="width:20%"><apex:outputLabel style="vertical-align:top; text-align:center;font-family:calibri;font-size:35px;color:{!IF(Group_Relationship__c.Group_Name__r.Lead_Management_Accounts_Group_Form__c >0, '#FFA000', '#d9d9d9')};"><apex:outputField label="AccNAme" value="{!Group_Relationship__c.Group_Name__r.Lead_Management_Revenue_Group_Form__c}" /></apex:outputLabel></td>
    
    <td style="width:10%"><apex:image id="RMS" value="{!If(Group_Relationship__c.Group_Name__r.RMS_Accounts_Group_Form__c = 'Live', $Resource.RMSImage, $Resource.RMSImageBW)}" width="200" height="80"/></td>
    <td style="width:10%"><apex:image url="https://c.eu10.visual.force.com/resource/1513853196000/VolumeSoldYTDPrevYear2" width="175" height="70"/></td>
    <td style="width:20%"><apex:outputLabel style="vertical-align:top; text-align:center;font-family:calibri;font-size:35px;color:{!IF(Group_Relationship__c.Group_Name__r.RMS_Accounts_Group_Form__c = 'Live', '#205EAA', '#d9d9d9')};"><apex:outputField label="AccNAme" value="{!Group_Relationship__c.Group_Name__r.RMS_Volume_Sold_Group_Join__c}" /></apex:outputLabel></td>
  </tr>
  <tr>
    <td style="width:10%"><apex:image id="Xtime" value="{!If(Group_Relationship__c.Group_Name__r.XTime_Accounts_Group_Form__c >0, $Resource.IncadeaServiceColour, $Resource.IncadeaServiceBW)}" width="200" height="80"/></td>
    <td style="width:10%"><apex:image url="https://c.eu10.visual.force.com/resource/1513853893000/RevenueRolling12" width="175" height="70"/></td>
    <td style="width:20%"><apex:outputLabel style="vertical-align:top; text-align:center;font-family:calibri;font-size:35px;color:{!IF(Group_Relationship__c.Group_Name__r.XTime_Accounts_Group_Form__c >0, '#FFA000', '#d9d9d9')};"><apex:outputField label="AccNAme" value="{!Group_Relationship__c.Group_Name__r.XTime_Revenue_Group_Form__c}" /></apex:outputLabel></td>
    
    <td style="width:10%"><apex:image id="Movex" value="{!If(Group_Relationship__c.Group_Name__r.Movex_Accounts_Group_Form__c = 'Live', $Resource.Movex_Colour, $Resource.Movex_BW)}" width="200" height="80"/></td>
    <td style="width:10%"><apex:image url="https://c.eu10.visual.force.com/resource/1513853383000/StatusPaint" width="175" height="70"/></td>
    <td style="width:20%"><apex:outputLabel style="vertical-align:top; text-align:center;font-family:calibri;font-size:35px;color:{!IF(Group_Relationship__c.Group_Name__r.Movex_Accounts_Group_Form__c = 'Live', '#0076A6', '#d9d9d9')};"><apex:outputField label="AccNAme" value="{!Group_Relationship__c.Group_Name__r.Movex_Accounts_Group_Form__c}" /></apex:outputLabel></td>
  </tr>
</table>






</apex:form>
</apex:page>

 
Hi

I am having trouble with my apex trigger. I have written SOQL inside FOR loop which causes Exception : "System.LimitException: Too many SOQL queries: 101". Can someone help me 'bulkify' this trigger as I can't seem to do so. Many Thanks, Triger below: 
 
trigger MnCopyPrimaryContact on Opportunity (before update) {
   for (Opportunity o : Trigger.new) {
       OpportunityContactRole[] contactRoleArray =
       [select ContactID, isPrimary from OpportunityContactRole where OpportunityId = :o.id ORDER BY isPrimary DESC, createdDate];
       if (contactRoleArray.size() > 0) {
           o.Opportunity_contact__c = contactRoleArray[0].ContactID;           
       }else{
           o.Opportunity_contact__c = null;
       }
   }
 }

 
hello All

 I am new to salesforce 1. I have business requirement can please guide me 

1. How to ebanle salesforce mobile app for users ?
2. How to have ip restriction for salesforce mobile app users
3. How to make some users to have salesfroce mobile app access and others should not

Regards
 
In toast message its showing long text message without breaking the line and its showing same line.
just i need to break the message and show in toast meessage.
Hi all,
i want to make a visualforce page on account standard controller which shows All the converted and non converted leads related to the Acccount
in a VFP pageblock table, so in order to related i used a field on lead Referral_Source_lkid__c which relate the lead to Account id.
so i query required field on lead releted to Account record.
how to make a VFP on it? 
how to do it?
Any suggestions? 
<apex:page standardController="Account" recordSetVar="accounts"

              tabStyle="Account"

    sidebar="false">

    <apex:form >

        
 <apex:pageBlockSection title ="Leads">

 

            <apex:pageBlockTable value="{!account.Leads}" var="leadObj" id="leadObj_table">

                <apex:column value="{!leadObj.name}"/>

                <apex:column headerValue="Company">

                    <apex:inputField value="{!leadObj.Company}"/>
                </apex:column>

                <apex:column headerValue="Phone">

                    <apex:inputField value="{!leadObj.Phone}"/>

                </apex:column>
                <apex:column headerValue="Email">

                    <apex:inputField value="{!leadObj.Email}"/>

                </apex:column>
                <apex:column headerValue="CreatedDate">

                    <apex:inputField value="{!leadObj.phone}"/>

                </apex:column>
                <apex:column headerValue="OwnerAlias">

                    <apex:inputField value="{!leadObj.phone}"/>

                </apex:column>
                <apex:column headerValue="Juradiction">

                    <apex:inputField value="{!leadObj.phone}"/>

                </apex:column>
                <apex:column headerValue="Converted">

                    <apex:inputField value="{!leadObj.phone}"/>

                </apex:column>

            </apex:pageBlockTable>

        </apex:pageBlockSection>

    </apex:form>

</apex:page>
 User-added image i want a list of leads which is converted and non converted on Account record like above pic.
I have a custom object named OppContactRoles with the following fields: contact,  primary, opportunity, role, dateadded.  Can someone help with a trigger to copy these fields from Opportunity Contact Roles to the OppContactRoles object?
Hello, I would like to have a "Save" button and a "Cancel" button on my visual force page.
The current ones I have dont work because im not using a standard controller, I am using a custom controller instead so that I can pull two different objects. 

What im wondering is can I import the standard controllers save/cancel function into my custom controller or do I have to create my own save & cancel function. If so how? 

Thank You. 

Visual Force Page I would like to add the Save & Cancel buttons to:-
<apex:page lightningStyleSheets="true" Controller="myController" title="Apprentice Documentation">
    <apex:form >
    <!--myController refers to the Apex class I created called myController.apxc this is so I can use two object types in one form in place of a Standard controller
        For refrence ApprenticeObj = new Apprentice__c and ComponentsObj = new Apprenticeship_Component__c-->
        
    <!--Style-->
        <style>
        body{
        font-family: Arial,Helvetica,sans-serif;
        color: #000000;
        Padding:25px;
        }
        </style>
    <!--End of Style-->
        
        <apex:pageBlock >
            <apex:pageBlockSection columns="3">
                <apex:inputField value="{! ApprenticeObj.Name}"/>
            </apex:pageBlockSection>
         </apex:pageBlock>
        
     <!--Apprentice Details Section-->
        <apex:pageBlock title="Apprentice Details">
            <apex:pageBlockSection columns="2">
                <apex:inputField value="{! ApprenticeObj.Apprentice_name__c}"/>
                <apex:inputField value="{! ApprenticeObj.Curriculum_Verified__c}"/>
                <apex:inputField value="{! ApprenticeObj.ULN__c}"/>
                <apex:inputField value="{! ApprenticeObj.Employer__c}"/>
                <apex:inputField value="{! ApprenticeObj.Programme_Area__c}"/>
                <apex:inputField value="{! ApprenticeObj.Vacancy__c}"/>
                <apex:inputField value="{! ApprenticeObj.Learning_Start_Date__c}"/>
                <apex:inputField value="{! ApprenticeObj.Levy_Status__c}"/>
                <apex:inputField value="{! ApprenticeObj.Learner_Reference_Number__c}"/> <!-- Set Programme Agreed with employer -->
                <apex:inputField value="{! ApprenticeObj.Existing_Employee__c}"/>
            </apex:pageBlockSection>
         </apex:pageBlock>
        <!--End of Apprentice Details Section-->
        
        <!--Line Manager Details Section-->
         <apex:pageBlock title="Line Manager Details">
            <apex:pageBlockSection columns="2">
               <apex:inputField value="{! ApprenticeObj.Line_Manager__c}"/>
               <apex:inputField value="{! ApprenticeObj.Line_Manager_Phone__c}"/>
               <apex:inputField value="{! ApprenticeObj.Line_Manager_Email__c}"/>
               <apex:inputField value="{! ApprenticeObj.Line_Manager_Mobile__c}"/>
            </apex:pageBlockSection>
         </apex:pageBlock>
     <!--End ofLine Manager Details Section-->
        
     <!--Previous Education & Diagnostics-->
       <apex:pageBlock title="Previous Education & Diagnostics">
            <apex:pageBlockSection columns="2">
                <apex:inputField value="{! ApprenticeObj.English_IA_Result__c}"/> <!-- Set To English Assessment in Live -->
                <apex:inputField value="{! ApprenticeObj.Date_of_Birth__c}"/>
                <apex:inputField value="{! ApprenticeObj.Maths_IA_Result__c}"/> <!-- Set To Maths Assessment in Live -->
                <apex:inputField value="{! ApprenticeObj.Funding_Line__c}"/>
                <apex:inputField value="{! ApprenticeObj.Highest_Previous_Attainment__c}"/>
                <apex:inputField value="{! ApprenticeObj.Highest_ICT_Achievement__c}"/>
                <apex:inputField value="{! ApprenticeObj.Highest_English_Qual__c}"/>
                <apex:inputField value="{! ApprenticeObj.Prior_Learning_Record_Attached__c}"/>
                <apex:inputField value="{! ApprenticeObj.Highest_Maths_Qual__c}"/>
                <apex:inputField value="{! ApprenticeObj.Learning_Difficulties__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Education & Diagnostics-->
        
        <!--Apprenticeship Programme-->
        
        <apex:pageBlock title="Apprenticeship Programme">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! ApprenticeObj.Apprenticeship_Title__c}"/>
                <apex:inputField value="{! ApprenticeObj.Highest_Maths_Qual__c}"/> <!--Set to Minimum Duration-->
                <apex:inputField value="{! ApprenticeObj.Highest_Maths_Qual__c}"/> <!--Set to Apprenticeship Pathway-->
                <apex:inputField value="{! ApprenticeObj.Highest_Maths_Qual__c}"/> <!--Set to Prefered Duration (Months)-->
                <apex:inputField value="{! ApprenticeObj.Highest_Maths_Qual__c}"/> <!--Set to Apprenticeship Level-->
                <apex:inputField value="{! ApprenticeObj.Development_Coach__c}"/> <!-- May need changing -->
                <apex:inputField value="{! ApprenticeObj.Highest_Maths_Qual__c}"/> <!--Set to Apprenticeship Type-->
                <apex:inputField value="{! ApprenticeObj.Usual_College_Day__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
        
      <!--End of Apprenticeship Programme-->
        
      <!--Functional Skills-->
        <apex:pageBlock title="Functional Skills">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! ApprenticeObj.Functional_Maths__c}"/>
                <apex:inputField value="{! ApprenticeObj.Maths_Status__c}"/>
                <apex:inputField value="{! ApprenticeObj.Functional_English__c}"/>
                <apex:inputField value="{! ApprenticeObj.English_Status__c}"/> 
                <apex:inputField value="{! ApprenticeObj.Functional_ICT__c}"/> 
                <apex:inputField value="{! ApprenticeObj.ICT_Status__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Functional Skills-->
        
        <!--Existing Employer Details-->
        <apex:pageBlock title="Existing Employer Details">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! ApprenticeObj.Functional_Maths__c}"/> <!--Set to Original Start Date-->
                <apex:inputField value="{! ApprenticeObj.Maths_Status__c}"/> <!--Set to Aditional skill/Check if its the same field as below-->
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Existing Employer Details-->
        
        <!--End Point Assessment (EPA)-->
        <apex:pageBlock title="End Point Assessment (EPA)">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! ApprenticeObj.Functional_Maths__c}"/>
                <apex:inputField value="{! ApprenticeObj.Maths_Status__c}"/>
                <apex:inputField value="{! ComponentsObj.Qual_Aim_Text__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of End Point Assessment (EPA)-->
        
      <!--Apprenticeship Components-->
        
        <apex:pageBlock title="Apprenticeship Components">
            <apex:pageBlockSection columns="1" >
                <apex:inputField value="{! ComponentsObj.Course_Name__c}"/> 
                <apex:inputField value="{! ComponentsObj.Course_Name__c}"/> <!--Set to Learning Aim Code-->
                <apex:inputField value="{! ComponentsObj.Course_Name__c}"/> <!--Set to Awarding Organisation-->
                <apex:inputField value="{! ComponentsObj.Course_Name__c}"/> <!--Set to Delivery Location-->
                <apex:inputField value="{! ComponentsObj.Start_Date__c}"/>
                <apex:inputField value="{! ComponentsObj.Planned_End_date__c}"/>
                <apex:inputField value="{! ComponentsObj.Course_Name__c}"/> <!--Set to Percentage of aim to be delivered-->
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Apprenticeship Components-->
        
      <!--Save/Cancel-->
       
        <apex:pageBlock >
        <apex:commandButton action="{!save }" value="Save" />
        <apex:commandButton action="{!cancel }" value="Cancel" />
        </apex:pageBlock>
        
      <!--End of Save/Cancel-->
            

    </apex:form>
</apex:page>
My Apex Controller Class :- 
public class myController{
public Apprentice__c ApprenticeObj{get;set;}
public Apprenticeship_Component__c ComponentsObj{get;set;}
public Programme_Area__c ProgramArea {get;set;}
public myController(){
         ApprenticeObj = new Apprentice__c();
         ComponentsObj = new Apprenticeship_Component__c();
         ProgramArea = new Programme_Area__c ();
    }
    public void saveObjects(){
         ProgramArea.PA_Code__c = 'P12';
         insert ProgramArea;
         ApprenticeObj.Programme_area__c = ProgramArea.Id;
         ApprenticeObj.ULN__c = '56464646';         
         insert ApprenticeObj;
         ComponentsObj.Apprentice__c = ApprenticeObj.Id;
         insert ComponentsObj;
    }
}

When save is clicked the error I get :-

The Save and Cancel buttonError I get
We need to create a storage location for a userguide(in any format pdf,excel etc) in salesforce and for that we have to give read only permissions to all users and Editable access to admin and selected users.

We have tried these two ways but couldn't find exact solution:

1- We have tried it using by creating a Folder in documents and giving readable access to all users and to give editable access to admin or some selected users we have created a permission set in which under System Permissions we just ticked the Manage public Documents checkbox.So by this all the users which are assigned in the permission set are able to manage all the folders but we want to manage only a particular folder.

2- We have also tried using content libraries.In that we created a library and added the content file in it.Gave permissions of viewing,editing to particular users but in this we are not able to add Chatter Only users so this solutions got breaked,adding to it some more profiles are asked to generate a case to salesforce support to get Salesforce CRM Content User License by this license only they can view or edit content.

Solutions for this is highly appreciable.And if any one can suggest how to modify any of above two ways to get required solution this will be a great help. I have also posted this question on salesforce community and Stack Exchage.

Thanks
I tried with Playground org ,still getting same error :(
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id:EAGFPORA.... Help
Hi, 

How should I get a createdDate for the custom field using Apex? 
Please help me. I am not sure what's the issue with this class its not updating.
 
public class MyFirstClass {
    public static void method(){
    List<Account> accLst = new List<Account>([select id,name,description from Account where name like 'United%']);
    system.debug('The account lists are:' + accLst);
    List<Account> accupdLst = new List<Account>();
    for(Account acc: accupdLst ){
        acc.Description = 'Updated from Apex Class';
        accupdLst.add(acc);
    }
    if(accupdLst != null && accupdLst.size()>0){
    update accupdLst;
        
    }
    system.debug('The updated account lists are:' + accupdLst);
}
}

Please help me!<

 
Hi all,

I have a contact 'C' that has an account-contact relationship with two accounts 'A1' and 'A2'.

An event created by contact 'C' is visible in the Activity tab of both the accounts 'A1' and 'A2'.

My doubts are as follows:
1. Is it a standard Salesforce functionality or is there a possibility that it might be a bug?
2. If it's standard, is it like the event is visible on both accounts because it was created from contact? I mean is there any way by which it will be visible only on one account that is present as related account in the event?
3. If it's a bug, what could be the reason of this?

Thanks for the clarification in advance!

Regards,
Abid
Hi,

I am stuck at the step 2 of the App Customization Specialist superbadge. I have the following error:
"Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: SRPJZOQK"

I created a brand new TP org to complete this challenge. I tried to logout and login, clear the cache but I still have this error.

What should I do?
Hi Team,

I have a doubt on Database.update .
Database.update(oppToUpdate,false); In this statement what is the use of ' false' , is it mandatory ? ( passing list obj).
Database.update(mapToUpdate.values()); In this statement we need to put ' false' or not necessary. (passing map).

Please let me know.

Thanks,
Nandu.
Hello guys, I am new to Salesforce, I just wanted to know in how many ways can I update contact phone number with account phone number whenever the contact is created.
Date.monthsBetween method returns one day less. Is it how date method working?
eg.
date fDate = date.newInstance(2018, 09, 01);
date sDate = date.newInstance(2018, 09, 30);
system.debug(fDate.monthsBetween(sDate));

Thanks.
Myat
I have this code in workflow rule which aims to remove / , . , - , and stores in a proper format (xxx) xxx-xxxx US phone no. But i am facing difficulty in removing / sign by a blank space.

IF(
 LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE( Phone , ".", ''),"/", ""),"-",""),"+",""))= 11,
 "("&
 MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE( Phone , ".", ''),"/", ""),"-",""),"+",""),2,3)&
 ") "&
 MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE( Phone , ".", ''),"/", ""),"-",""),"+",""),5,3)&
 "-"&
 MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE( Phone , ".", ''),"/", ""),"-",""),"+",""),8,4),
 "("&
 MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE( Phone , ".", ''),"/", ""),"-",""),"+",""),1,3)&
 ") "&
 MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE( Phone , ".", ''),"/", ""),"-",""),"+",""),4,3)&
 "-"&
 MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE( Phone , ".", ''),"/", ""),"-",""),"+",""),7,4)
)
Is there  away to overwrite the "standard" list of Opportunity Products (line items) with a Visual Force page.  I know the opportunity objects are somewhat special - could not find a way to achieve that.  Thanks.
public class Program1 
{
    public void print()
    {
         integer i, j;
            for (i = 1; i <= 5; i++)
            {
                for (j = 1; j <= i; j++)
                {
                    system.debug(i);
                }
                 
            }
    }
}

i am getting output but not in this shape User-added image
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5 
 
Hi All,

  I have requirement to upload CSV file into Salesforce using lightning component then this record will insert in Sobject records.Please guide me on this scenario.

Thanks,
Santhanam

Hi, On Quote Line Items related list I have created a custom button. This custom button will create a visualforce page which will be rendered as pdf.

My issue is that if on the Quote Line Item related list I select more than one Quote Line Item, then all the selected Quote Line Items must be included in the pdf. I am a beginner as developer. So any help to get this done will be highly appreciated.

Also I followed few steps mentioned in this post - https://developer.salesforce.com/forums/?id=906F000000091nOIAQ, however I do not know how to return the selected ids back to vf page and how to make use of them in the vf page.

Please can someone help me with this.

Thank you in advance.

Regards,

Shalini.

Hi All,
I have two objects Account and Custom Object.Account is the parent and Custom object is child.Account has the picklist field called country and it has some  values like Ind,US,UK,Europe,..etc.And Custom object also has one more picklist called Transport,it has some values like By Road,By Air,By Sea..etc.
while the user selects the value in Account picklist field as "Ind",the value in child object picklist field as "By Road".If the value in Account has Other than "Ind",the value in child object picklist field as "By Air".I did this with ProcessBuilder and created seperate process for two conditions.
I include these two conditions with Process at the time of update record actions using formulas it won't work.which formula used in this??
How to write the trigger for this updating records.can any one provide sample code or any ideas.
thanks in advance.
 
Hi Expert,

I am new to the programming world. I have a custom controller which insert a contact created on VF page. Now I am not able to write test class for this. I could only cover 56% code.
 
public class TestPopup {
    
    public list<Account> acc{get;set;} 
    public Account acc1 {get;set;} 
    public Contact contact {get;set;}
    public List<Contact> conlist;
    public Boolean displayPopup {get;set;}
    public String accid {get;set;}
       

    public TestPopup(){
        acc = [select ID, Name, AccountNumber,Type from Account];
	    acc1 = new Account();
        conlist = new List<Contact>();
        contact = new Contact();
        	
    }
   
    public list<Account> getacc(){
        return acc;
    }
    
    public void showPopup()
    { 
    	displayPopup = true;
        acc1 = [SELECT Id, Name, Phone, (SELECT lastName FROM Contacts) FROM Account WHERE Id = :accid];
    }
       
    public void closePopup() {
        displayPopup = false;
        
    }

    public PageReference save(){
        contact.AccountId= acc1.Id;
        insert contact;
        ID contactId = contact.Id;
        PageReference pr = new PageReference('/' + contactId);
   		return pr;
    }  
        
}
 
@isTest
public class TestCustomController {
     static testMethod void testMethod1() 
     {
         Account testAccount = new Account();
         testAccount.Name='Test Account';
         insert testAccount;
         
         Contact cont = new Contact();
         cont.LastName = 'Test';
         cont.FirstName = 'Contact';
         cont.AccountId = testAccount.Id;
          // insert cont;
         
         Account testAccount1 = new Account();
         testAccount1 = [SELECT Id, Name, Phone, (SELECT lastName FROM Contacts) FROM Account WHERE Id = :testAccount.Id];
       
         
         
         Test.StartTest(); 
         PageReference pageRef = Page.All_Account; // Add your VF page Name here
         pageRef.getParameters().put('id', String.valueOf(testAccount.Id));
         Test.setCurrentPage(pageRef);
         
         TestPopup testAccPlan = new TestPopup();  
         testAccPlan.getacc();
        // testAccPlan.showPopup(); 
         testAccPlan.closePopup();
         
         Test.StopTest();
         
     } 
}

 
Hi Expert,

I am new to the programming world. I have a custom controller which insert a contact created on VF page. Now I am not able to write test class for this. I could only cover 56% code.
 
public class TestPopup {
    
    public list<Account> acc{get;set;} 
    public Account acc1 {get;set;} 
    public Contact contact {get;set;}
    public List<Contact> conlist;
    public Boolean displayPopup {get;set;}
    public String accid {get;set;}
       

    public TestPopup(){
        acc = [select ID, Name, AccountNumber,Type from Account];
	    acc1 = new Account();
        conlist = new List<Contact>();
        contact = new Contact();
        	
    }
   
    public list<Account> getacc(){
        return acc;
    }
    
    public void showPopup()
    { 
    	displayPopup = true;
        acc1 = [SELECT Id, Name, Phone, (SELECT lastName FROM Contacts) FROM Account WHERE Id = :accid];
    }
       
    public void closePopup() {
        displayPopup = false;
        
    }

    public PageReference save(){
        contact.AccountId= acc1.Id;
        insert contact;
        ID contactId = contact.Id;
        PageReference pr = new PageReference('/' + contactId);
   		return pr;
    }  
        
}
 
@isTest
public class TestCustomController {
     static testMethod void testMethod1() 
     {
         Account testAccount = new Account();
         testAccount.Name='Test Account';
         insert testAccount;
         
         Contact cont = new Contact();
         cont.LastName = 'Test';
         cont.FirstName = 'Contact';
         cont.AccountId = testAccount.Id;
          // insert cont;
         
         Account testAccount1 = new Account();
         testAccount1 = [SELECT Id, Name, Phone, (SELECT lastName FROM Contacts) FROM Account WHERE Id = :testAccount.Id];
       
         
         
         Test.StartTest(); 
         PageReference pageRef = Page.All_Account; // Add your VF page Name here
         pageRef.getParameters().put('id', String.valueOf(testAccount.Id));
         Test.setCurrentPage(pageRef);
         
         TestPopup testAccPlan = new TestPopup();  
         testAccPlan.getacc();
        // testAccPlan.showPopup(); 
         testAccPlan.closePopup();
         
         Test.StopTest();
         
     } 
}

 
Hi,

Cannot save the Controller, please help.

https://trailhead.salesforce.com/projects/quickstart-lightning-components/steps/quickstart-lightning-components4
Ok, been directed here by support so hoping someone can help.

Basically noticed that our case milestones were violating outside our set business hours.  After a lot of head scratching the only conclusion was that our timezone on the business hours in use by the entitlement processes were set to GMT.  I have changed this to BST (British Summer Time) to prevent more out of hours violations.

I have asked support if having it set to BST would mean that come Autumn salesforce will automatically revert back an hour in line with daylight savings.  They have said this does not occur and you have to manually change the timezone each time daylight savings occurs.

Can anyone confirm if this is true?  Seems like something so basic that I can't believe its not in the system. 
  • April 21, 2016
  • Like
  • 3

Hi, 

This Monday I tried to do the exam but I had technical issues with camera. Kryterion support tried to help me but we couldn't solve the problem. They rescheduled my exam multiple times but they can not do it to a different day.

Please, I have opened cases and called to certification support phone without getting any answer. Could you help me?

Best regards
I want to send emails in user's language dynamically. Two approaches:
1. Use visualforce email template, create labels and use them in the template. Set language attribute in the template and provide translations for the labels using translation workbench.
2. Create multiple versions of each template, each in a separate language and choose the template dynamically.

Advantage of first approach is that no additional efforts are required if a new language is to be supported but creating so many custom labels is cumbersome. 2nd approach is good in that respect but a template needs to be added everytime a new language is supported. 
Is there any other approach? If not, which one of the above should be chosen?