• Mohammed Mohiddin
  • NEWBIE
  • 0 Points
  • Member since 2018

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

How do we set From Address while sending email using messaging.SingleEmailMessage. I have got a solution which uses setOrgWideEmailAddressId to set from address,
OrgWideEmailAddress[] owea = [select Id from OrgWideEmailAddress where Address = 'doNotReply@blahblah.com']; Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); if ( owea.size() > 0 ) { mail.setOrgWideEmailAddressId(owea.get(0).Id); }


But I want to query the record ( say the contact who logged in ) and set that as From Address.

Can Anyone help me out with this?
I created a custom object called Usage that has a lookup relationship to the standard Account object. I am trying to create a Visualforce page that will display all of the fields from a Usage record directly on the Account page if the two are linked via the lookup field.

I am new to VF, and I created a VF page with the following code:
<apex:page standardController="Account">

<apex:pageBlock title="Usage">
    <apex:pageBlockSection>
        <apex:outputField value="{! Account.Usage__c.Name }"/>
        <apex:outputField value="{! Account.Usage__c.Last_User_Login_Date__c }"/>
        <apex:outputField value="{! Account.Usage__c.Request_Manager_Enabled__c }"/>
        <apex:outputField value="{! Account.Usage__c.Users__c }"/>
    </apex:pageBlockSection>
</apex:pageBlock>
    
</apex:page>
However, I get the following error when trying to save: Could not resolve the entity from value binding '{Account.Usage__c.Name}' can only be used with SObjects, or objects that are Visualforce field component resolvable.

I looked into SObjects but am unclear what the issue is.
 
I am trying to write a query which will allow me to search for a user using their email and first name. I have it working mostly, however the issue I am facing is when a user has two or more words in their first name. 

For example - John Second Doe

Where they add John Second as their first name and Doe as their last name. 

I am using PHP to submit the request to Salesforce and then find the contact and assign their ID to our system. 

Select+Id+From+Contact+Where+Email='johndoe@lc.com'+AND+FirstName='John Second'

This is how the query looks so far, however this returns null. I assume this is because either its not supported or I am passing it in a wrong format. I have tried adding a + and %20, however niether work. I get an empty object.

I have confirmed that I have that user in my Salesforce system. (the name has been changed for the ticket).
Hi 

I am new in Salesforce Begineer

My Question is:

How to validate Phone field of Account Object with Use of Apex Class and the validation is ONly 10 Digit is input by user no sepcial character no characters Only digits and digit will be 10 
and if user input digit according the condition then the record will be save and user not input 10digit then error will be show on the Phone field "Please Provide Valid Number"  on Custom Visual force Page
Please help me ASAP


Thanks 
Neeraj Sharma
 
Hello Everyone,

How do we set From Address while sending email using messaging.SingleEmailMessage. I have got a solution which uses setOrgWideEmailAddressId to set from address,
OrgWideEmailAddress[] owea = [select Id from OrgWideEmailAddress where Address = 'doNotReply@blahblah.com']; Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); if ( owea.size() > 0 ) { mail.setOrgWideEmailAddressId(owea.get(0).Id); }


But I want to query the record ( say the contact who logged in ) and set that as From Address.

Can Anyone help me out with this?

Okay folks, I know this is a n00b question but I can't remember if or how to initialize a string with a set of arguments.

 

What I want to do is something like this

 

 

List<String> alphabet = { 'a' , 'b' , 'c' ...  };

 

How can I do this?

 

Hi,

 

I was wondering if it is possible to pass parameters to our controller method while in a VF page.

 

For example, normally, say we have a controller called "MyController" and inside it we have a method call "Method" which take a string parameter.

 

Is it possible to call this method and pass a value to it from our VF page? If so how?

 

Would this work?

 

<apex:commandButton action="{!Method('stringvalue'}"/>

 

Thanks in advance.

Hi 

I am new in Salesforce Begineer

My Question is:

How to validate Phone field of Account Object with Use of Apex Class and the validation is ONly 10 Digit is input by user no sepcial character no characters Only digits and digit will be 10 
and if user input digit according the condition then the record will be save and user not input 10digit then error will be show on the Phone field "Please Provide Valid Number"  on Custom Visual force Page
Please help me ASAP


Thanks 
Neeraj Sharma