• SFC7
  • NEWBIE
  • -1 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 20
    Replies
I need to customize the edit layout of several objects in a similar way using a visual force page. So, instead of create a page of every object I need with all the fields added manually, I'm trying to develop a custom component that, using SObject metadata and field sets, creates the page dinamically. So, I have a custom page per SObject like this:


<apex:page standardController="MyCustomSObject">
    <c:Translate_SObject object="{!MyCustomSObject}"/>
</apex:page>

And this is my component, first the view:

<apex:component controller="Edit_Controller" allowDML="true">
<apex:attribute name="object" type="SObject" required="true" description="Id of the object to be translated" assignTo="{!record}"/>
...
<apex:form id="form">
<apex:pageBlock id="editBlock" rendered="{!showEditBlock}">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!cancel}" value="Cancel"/>
</apex:pageBlockButtons>
<apex:pageBlockSection id="fieldSection">
<apex:repeat value="{!fieldList}" var="f">
<apex:inputField value="{!record[f.fieldInfo]}"/>
</apex:repeat>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:component>

And now, the controller:

public with sharing class Edit_Controller
{
public SObject record{ get; set; }
public Edit_Controller(){ }
public PageReference save(){ ApexPages.StandardController sc = new ApexPages.StandardController(record); return sc.save(); } 
}

The page shows the fields of the SObject with their expected values. I can modify these values on the page but when I press the Save button the SObject saved doesn't have any of the changes. It seems that the SObject reference used by the page it's different that the SObject reference used by the controller.

Could anyone help me? Thanks in advance.
 
  • December 04, 2014
  • Like
  • 0
Customer wants to interact Salesforce with external database like SQL server to get the real time data into the Salesforce for the Sql server database when action performed.

Can anyone help out to achieve this.
  • March 25, 2014
  • Like
  • 0

Hey folks,

 

Here is the issue, 

Charts/Dashboards are using their own customizable colors and I would like to apply those colors to a datatable rows or want to add couple of columns to a pieChart legend whichever is appropriate, please let me know how to achive this.

 

Thanks in advance.

  • July 01, 2013
  • Like
  • 0

Based on the business requirement I have to make text as a link in trigger and then I wanna retrieve/print that value in a standard page.

 

eg. string link = '<a href=/'+ accId +'>'+accName+ '</a>'

 

Please share your thoughts.

  • April 22, 2013
  • Like
  • 0

Please let me know if anyone knows how to handle reports from apex class/pages.

 

Here is the query; generating standard reports are very limited conditions (no matter what kind of report it is). I would like to generate my report with three level conditions (column level) from Visualforce page or apex class, could you please tell me whether it is that possible or not? If positive, please guide me the way of doing that.

 

Thank you

  • August 29, 2012
  • Like
  • 0
I need to customize the edit layout of several objects in a similar way using a visual force page. So, instead of create a page of every object I need with all the fields added manually, I'm trying to develop a custom component that, using SObject metadata and field sets, creates the page dinamically. So, I have a custom page per SObject like this:


<apex:page standardController="MyCustomSObject">
    <c:Translate_SObject object="{!MyCustomSObject}"/>
</apex:page>

And this is my component, first the view:

<apex:component controller="Edit_Controller" allowDML="true">
<apex:attribute name="object" type="SObject" required="true" description="Id of the object to be translated" assignTo="{!record}"/>
...
<apex:form id="form">
<apex:pageBlock id="editBlock" rendered="{!showEditBlock}">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!cancel}" value="Cancel"/>
</apex:pageBlockButtons>
<apex:pageBlockSection id="fieldSection">
<apex:repeat value="{!fieldList}" var="f">
<apex:inputField value="{!record[f.fieldInfo]}"/>
</apex:repeat>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:component>

And now, the controller:

public with sharing class Edit_Controller
{
public SObject record{ get; set; }
public Edit_Controller(){ }
public PageReference save(){ ApexPages.StandardController sc = new ApexPages.StandardController(record); return sc.save(); } 
}

The page shows the fields of the SObject with their expected values. I can modify these values on the page but when I press the Save button the SObject saved doesn't have any of the changes. It seems that the SObject reference used by the page it's different that the SObject reference used by the controller.

Could anyone help me? Thanks in advance.
 
  • December 04, 2014
  • Like
  • 0
Customer wants to interact Salesforce with external database like SQL server to get the real time data into the Salesforce for the Sql server database when action performed.

Can anyone help out to achieve this.
  • March 25, 2014
  • Like
  • 0

Hey folks,

 

Here is the issue, 

Charts/Dashboards are using their own customizable colors and I would like to apply those colors to a datatable rows or want to add couple of columns to a pieChart legend whichever is appropriate, please let me know how to achive this.

 

Thanks in advance.

  • July 01, 2013
  • Like
  • 0

Based on the business requirement I have to make text as a link in trigger and then I wanna retrieve/print that value in a standard page.

 

eg. string link = '<a href=/'+ accId +'>'+accName+ '</a>'

 

Please share your thoughts.

  • April 22, 2013
  • Like
  • 0

Please let me know if anyone knows how to handle reports from apex class/pages.

 

Here is the query; generating standard reports are very limited conditions (no matter what kind of report it is). I would like to generate my report with three level conditions (column level) from Visualforce page or apex class, could you please tell me whether it is that possible or not? If positive, please guide me the way of doing that.

 

Thank you

  • August 29, 2012
  • Like
  • 0

Hi,

 

I have a ASP.NET application, currently its in the server. I have created a salesforce developer account, and built a visualsource page, I need to display some rows from a SQL server database, currently residing in a server.

Please, let me know, what are the steps I should take to achieve this goal.

 

Regards

 

Prithiraj Sengupta

Hi all,

We have a requirement in which we need to connect to the Oracle database from a Visualforce page and access the data in the tables.

Please provide us a solution for this, other than using the web services concept.

As this is bit urgent, it would be highly appreciated if you reply me immediately...

Thanks in advance... :)

I am on enterprise edition and am trying to investigate the ability of saleforce to access a SQL server database and run a query. I've searched everywhere to get a walkthrough or even a snippet on how to create a visualforce page that calls a query of a local database. Right now I am just trying to read data from a MSSQL database, but I wonder if this will lead to update, insert, or delete ability.

 

Can anyone help?

  • January 21, 2009
  • Like
  • 0