You need to sign in to do that
Don't have an account?
Sam Alex
Contact object fields returns NULL
Hi All,
I Have a trigger for Contact Object. It sends a HTTP request to external Host. For this request I want to get the, First Name, Last Name and Account Name of that Contact.
In the Contact Object
1. User Name is a combination of PREFIX, FIRST NAME and LAST NAME.
2. Contact is added under an Account and I want to get the Name of the Account (which was selected when the Contact creation)
This is my Trigger,
Contact[] cont = Trigger.new; for (Contact c :cont){ myRequestSendingClass.sendRequest(c.Account.Name, c.Name); }I tryied to access the Account name by
c.Account.NameAnd I tried to accress the Contact name (combination) by
c.Name
But both of them returns NULL.
How can I get these values from the Contact object?
Please Help Me. Thankyou in advance.
2. use the SOQL and Try
Thanks
Shaijan
What type is your trigger?
Before insert or update?
I think the same thing as Shaijan, try to get the account and the contact Name in quring them with a SOQL query, it will be easiest.
Let me know if this response help you.
Aurélien