You need to sign in to do that
Don't have an account?
Javier Maldonado
Trying to display Account.Name dynamically instead Id
I created a visualforce page that use account (standard object) as a realated field, in to the custom object Customer_s_Price_List__c, so that I want to do is dynamically show the name of the company in to the section header instead to show the ID (18 digits)...
Can somebody help me???
My visualforce code below...
THANKS in advance...
Can somebody help me???
My visualforce code below...
<apex:page cache="true" expires="600" standardController="Customer_s_Price_List__c" extensions="Plasma_controller_SFDC1" showHeader="false" tabStyle="account"> <apex:sectionheader title="Customer Price -" subtitle="{!Customer_s_Price_List__c.Account__c}"/> <chatter:feedwithfollowers entityId="{!Customer_s_Price_List__c.Id}"/> <apex:form >
THANKS in advance...
At first you need create new property in your extension
After that you need add code to constructor, or if constructor not created, create it. your constructor must have name Plasma_controller_SFDC1
and after this use {!acctName} insted of {!Customer_s_Price_List__c.Account__r.name}
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks,
Alex
All Answers
Use this: Let me know, if you need any other help.
Thanks,
Neetu
You need use Customer_s_Price_List__c.Account__r.Name.
Please, see code below
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks,
Alex
Thanks,
Pramodh
Thanks for your quick response... I made the changes in my code, but is not working neither, now is not showing even the ID... THANKS for your help...
You need put Customer_s_Price_List__c record id to url(it's because u use standart controller). Please put id param to url for needed Customer_s_Price_List__c record, and Account Name automatic retrieved.
Or you can add logic to constructor if your extension
and use this acctName on your page
Thanks,
Alex
Updation in Alexandar code:
If you go with extension record, you need to query like this: Let me know, if you need any other help.
Thanks,
Neetu
I tried to make this works, but I don't know how to do it... Can you please help me, getting more information about what to do??? THANKS...
I can do this for you, if it is possible for you to share the salesforce org login credentials. You can contact me either on my gmail id: neetu.bansal.5@gmail.com or Skype id: neetu.bansal.5
Thanks,
Neetu
At first you need create new property in your extension
After that you need add code to constructor, or if constructor not created, create it. your constructor must have name Plasma_controller_SFDC1
and after this use {!acctName} insted of {!Customer_s_Price_List__c.Account__r.name}
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks,
Alex
By the way, is there anything that I can do to avoid this message:
"List has no rows for assignment to SObject
An unexpected error has occurred. Your development organization has been notified.",
that happen when the visualforce page is running out of the account page, without account id???
Please, see code below, i try to query accounts in to list, if nothing return i put error message to visualforce page
and you need add to your page apex tag for show error messages
<apex:pageMessages />
Thanks,
Alex
Sorry bother you, but I have not found the way this code works, I still getting the same error... please see What I did, and if you could let me know your suggestion... THANKS