• Laraib_Jafri
  • NEWBIE
  • 30 Points
  • Member since 2015
  • Consultant
  • Rightpoint


  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 30
    Replies
Hi, Im new to triggers and apex and I need to update phone field (if blank) on contacts from the account field for existing records: 
Here is my try , but Im sure Im missing some elements. Any help is appreciated:

trigger updatephonefield on Contact (after update, after insert ) {
 for (Contact cp : Trigger.new) {
        if ( cp.Phone == null ) {
            cp.Phone == Account.Phone
            }
}
  • August 12, 2016
  • Like
  • 0
Hi
I have a trigger and its test class which runs perfectly fine in the sandbox and it also shows 76 % coverage. I also had some debug statements in both the test class and trigger and I was able to view the expected result. But when I deploy it to production, choosing run specific test classses only, it doesnt get deployed and the error is code coverage is 0. I opened the debug logs and it seems like the trigger is not getting called when test datat is inserted because I only see the debug ststaments from the test class but not from the trigger.
   Please help me to find out ehat might be the reason that it is not getting called.... It is very urgent.
 Thank you
For some reason when I click "contact support" I am re-directed to the help.salesforce.com page and I am not signed in, even though my username and password are correct?

I would like to have Person Account enabled in my developer org - but I can't reach support!
Hi Experts,

I have used one custom object "Application". Based on some conditions I have shared the record to particular community user. While sharing a record to community user I am facing the below issue. 

"System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []"

Currently, the community user having "read" and "edit" access to the object. Could you guys help me how to resolve this issue?

Thanks,
Vijay
SELECT Name, Payroll_Cd__c, Non_Payroll_Cd__c, Account_Status__c, Type, Non_Payroll_Eff_Dt__c, Non_Payroll_Exp_Dt__c  
FROM Account
WHERE   RecordType.Name = 'CORP_SALES' AND Account_Status__c = 'Active' AND (Type = 'Employer' OR Type ='Partner') AND Payroll_Cd__c  Like '%3253'

So here is the thing when i use " like" it works for all records and if i use the same query with "=" it  doesn't work for all records. But if i change the code to someother like Ex 3251 and put "=" it works i dont know whats wrong. Please if anyone faced the same issue your suggestions are much needed.

Thanks.
Hello,
I am working on a visualforce page that asks the viewer to enter an email adress they are searching for within the salesforce system. Upon clicking a button, I would like the viewer to see a list of user emails that direcly match/simliar to the one entered on the previous page. How do I launch a new visualforce page upon the click of a button? And how do I create the second page as described prior?

Here is what I have so far.
<apex:page standardController="User">
    
    <apex:form > 
        <apex:pageBlock title="User email search">
        
        Please enter the email address of the user you are looking for: <p/>
        
        <apex:inputField value="{!user.email}"/> <p/>
        <apex:commandButton action="{!save}" value="Submit"/>
        
        </apex:pageBlock>
    </apex:form>
</apex:page>

 
So I set up the devoploper account so I can do 1 of the training test it says you have to have an account so I set it up & get an email to verify it & when I click on verify it does nothing please help my boss wants me to get this training done asap


Sent from my iPad using Mail for 

Subject: Welcome to Salesforce: Verify your account

Thanks for signing up with Salesfor
Click below to verify your account.
 
Verify Account
 
To easily log in later, save this URL:
https://login.salesforce.com/
 
Username:
chris.hoffman@trailhead.com
 Subject: Welcome to Salesforce: Verify your account

Thanks for signing up with Salesforce!
 
Click below to verify your account.
 
Verify Account
 
To easily log in later, save this URL:
https://login.salesforce.com/
 
Username:
chris.hoff
 
Again
Hi, Im new to triggers and apex and I need to update phone field (if blank) on contacts from the account field for existing records: 
Here is my try , but Im sure Im missing some elements. Any help is appreciated:

trigger updatephonefield on Contact (after update, after insert ) {
 for (Contact cp : Trigger.new) {
        if ( cp.Phone == null ) {
            cp.Phone == Account.Phone
            }
}
  • August 12, 2016
  • Like
  • 0
Is there anything like where I can get the use cases for Apex and VF? Please let me know. Than you.
I need to update an object called Employee__c if the respective User object is updated. Let's suppouse that before any update, the employee__c object was already created at the time its respective User one was created and that Employee__c has a field that makes a look up over the User object keeping the id of the User that "triggered its creation". I need to do this using Process Builder. Any ideas?
I did a change set from the sandbox to production and got the test to work for everything but the apex trigger. I get a 60% coverage message for the error. I am having a really tough time figuring out why it isn't working. It seems like this is a pretty common problem, but I can't get an easy answer for why that would happen. Anyone experienced this before?
How can I be sure to cover the following lines of code in my apex test class?  It's basically a method which is called to populateData ()  
Could someone provide a code sample which would cover these lines? Many thanks!
         
            Account acc = listacc[0];
            samObj.Planning_Account__c= acc.ParentId;
            samObj.Customer_Group__c= acc.Customer_Group_Description__c;
            samObj.CABOT_Segment__c= acc.CABOT_Segment__c;
            samObj.Account_Manager__c= acc.OwnerId;
            samObj.Technical_Manager__c= acc.Technical_Service_Manager__c;
            samObj.Ship_To_Address_Line_1__c= acc.Address_Line_1__c;
            samObj.Ship_To_Address_Line_2__c= acc.Address_Line_2__c;
            samObj.Ship_To_Address_Line_3__c= acc.Address_Line_3__c;
            samObj.Ship_To_Address_Line_4__c= acc.Address_Line_4__c;
            samObj.Account_Region__c= acc.Sub_Region__c;
            samObj.Ship_To_Country__c= acc.Country__c;
            samObj.Ship_To_State__c= acc.State__c;
            samObj.Ship_To_City__c= acc.City__c;
            samObj.Ship_To_Postal_Code__c= acc.Postal_Code__c;
          
HI
    I would like to keep a field from activity in account object, is it possible? please advise me.
thanks
soma
I'm having an onboarding email triggered when a user is created - I want the subject to say: Hi, (First Name)!

I'm using the Merge field of {!User.FirstName}, but it shows as the first name of the user creating the record, not the user being created - doesn't make any sense to me.

Any ideas? Thank you!
Hello, I have an html/text template that I'm trying to change over to a visualforce template. This is my first time playing around with visualforce, so I've come across trouble converting my url.  I'm able to save it,but when I get the email it comes as markup language. I'm obviously doing something wrong, so if anyone could assist I would greatly appreciate it. Thanks!

The original text template I'm trying to convert to a visualforce template: (I purposely changed the beginning of the url, so I'm not exposing the actual survey url on the boards here.)
Dear {!Contact.Name},

At Undertone, we are constantly
focused on enhancing the level of service, performance and insights that we
deliver. One of the ways we do this is by gathering feedback from our clients
via a brief customer satisfaction survey.

This survey takes two to three
minutes to complete and is designed to gather your opinions on your recent
experience with Undertone. You can access the survey here:

http:/abc.com/abc/abc/go.jsp?iv=63czc8cvlqh2&q1={!Account.Id}&q2={!Contact.Id}&q3={!Opportunity.Id}&q4={!User.Id}&q5=US

Thank you in advance – your
opinions matter.


visualforce template attempt
<messaging:emailTemplate subject="Undertone Survey" recipientType="Contact" relatedToType="Opportunity">

<messaging:plainTextEmailBody >
Dear {!recipient.name},

At Undertone, we are constantly focused on enhancing the level of service, performance and insights that we deliver. 

One of the ways we do this is by gathering feedback from our clients via a brief customer satisfaction survey.

This survey takes two to three minutes to complete and is designed to gather your opinions on your recent experience with Undertone. 

You can access the survey here:
<a href="http://abc.com.com/abc/abc/go.jsp?iv=63czc8cvlqh2&q1={" target="_blank" rel="nofollow">http://survey.clicktools.com/app/survey/go.jsp?iv=63czc8cvlqh2q1={</a>!relatedto.Account.Id}<apex:outputText value="&"/>q2={!recipient.Id}<apex:outputText value="&"/>q3={!relatedto.Id}<apex:outputText value="&"/>q4={!relatedto.lastmodifiedbyid}<apex:outputText value="&"/>q4="US"

Thank you in advance – your
opinions matter.
</messaging:plainTextEmailBody>
</messaging:emailTemplate>

email
-----Original Message-----
From: noreply@salesforce.com [mailto:noreply@salesforce.com] On Behalf Of Brian Martinez
Sent: Thursday, August 04, 2016 5:37 PM
To: Brian Martinez | Undertone <bmartinez@tbd.com>
Subject: Undertone Survey

 
 
Dear Brian Martinez,
 
At Undertone, we are constantly focused on enhancing the level of service, performance and insights that we deliver.
 
One of the ways we do this is by gathering feedback from our clients via a brief customer satisfaction survey.
 
This survey takes two to three minutes to complete and is designed to gather your opinions on your recent experience with Undertone.
 
You can access the survey here:
<a href="http://abc.com.com/abc/abc/go.jsp?iv=63czc8cvlqh2&amp;q1={" rel="nofollow" target="_blank">http://abc.com.com/abc/abc/go.jsp?iv=63czc8cvlqh2q1={</a>!relatedto.Account.Id}&q2=0033000000ufQWMAA2&q3=0061300001AI0MQAA1&q4=00530000004UwpHAAS&q4="US"
 
Thank you in advance – your
opinions matter.
 
  • August 04, 2016
  • Like
  • 0
It seems no matter what size photo or resolution I use my photo on Trailhead profile looks like a blurry mess.  Anyone else have this problem?
I have defined the Opportunity Stages Picklist Values with the corresponding probability percentages as for our sales process, however, when the Opportunity is changed to a prior stage the probability percentage does not get updated. It keeps old values and does not change the probabilities automatically.

Has anyone experienced something similar?

Thanks,
Fernando
I have this trigger that basically works however the results provided in the field are an ID and not an actual pick list value. How can I amend this to get the same lookup value to populate the pick list field when the Lookup field is edited?

trigger EMRSystem on Lead (before insert, before update) {
    { 
        for (Lead a : Trigger.new) 
        { 
            a.EMR_System_1__c = a.EMR_System_Confirmed__c;
        }
    }
}