Activity Forums Salesforce® Discussions How can i get the owner Name of account object by DML and put at the outputfield of visualForce Page?

  • How can i get the owner Name of account object by DML and put at the outputfield of visualForce Page?

    Posted by saloni gupta on July 4, 2017 at 1:24 pm

    I am trying this apex code-

    public String owners{
    get{
    return [select owner.firstname from Account where ownerid=:this.account.ownerid][0].name;
    }
    private set;

    }
    <apex:outputField action="{!owner}"/>

    Sudhir replied 7 years, 5 months ago 2 Members · 5 Replies
  • 5 Replies
  • Sudhir

    Member
    July 5, 2017 at 9:33 am

    Your question title seems vague.

    So looking at your code snippet, it appears that the question is: to display Account Owner name on the VF page.

    Is this the question ?

  • saloni gupta

    Member
    July 5, 2017 at 10:40 am

    yes, i want to display the account owner name on the vf page

  • Sudhir

    Member
    July 5, 2017 at 10:58 am

    Check this one: ShowAccountOwnerName_page

    Examle:

    https://<salesforce_base_url>/apex/ShowAccountOwnerName_page?Id=<Account SFDC Id>

  • saloni gupta

    Member
    July 5, 2017 at 11:23 am

    hi Sudhir,

    I want to display the owner name by custom controller.

     

  • Sudhir

    Member
    July 5, 2017 at 12:24 pm

Log In to reply.

Popular Salesforce Blogs