function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
developer_forcedeveloper_force 

Help with custom setting object

HI,

 

I need help in using the custom setting object in vf page and controller to generate reports.

 

I created a custom setting object called ReportConfig with some column names like Name , ReportID , QueryObjectName . The name has the Report name and ReportId has the id of the base report which was created and saved leaving filters as blank and QueryObjectName has the Name of the object which should be queried.

 

Like described above i have created four records for custom setting object.

Now a hyperlink formula field should be created on the object on which i will be quereying. So , when the user go to the particular record and click on the hyperlink of that formula field which should direct to the visualforce page called ReportParamBuilder then VF page loads the respective ReportConfig record with the Name


A Visualforce page should be created and it should accept the following parameters

config  -config name

id  -SFDC id of the record that the integration is being launched from

 

Using the parameters from the ReportConfig object and from the URL, the VF page constructs the  query and then the results are parsed and every returned record’s data will be added to a comma separated string an then 

 

 

1)T The Visualforce page will construct a report url like the following:

      /00OM0000000SNVS? pv0=<generated comma separated string>

The Visualforce page would redirect the user to this new page. which i s a reports page.

This is my requirement. any sample code is really appreciated.

 

Thanks

Ispita_NavatarIspita_Navatar

 Hi,

  Basically you want to query a setting object which stores information about a report.- basically report name ,reportid and the filter criteria for each report and  object name

It needs to be somewhat like the following example:-

if the a report called - Privilege Clients , id of report =IIERT676666AAAA,  has filter on field { amount__c = pv0 , interest =pv1 on object "client"} implying amount is 1st filter and field "interest " is 2nd filter on the given report.

So the setting object will have the following information:-

  • Report name ->  Privilege Clients
  • Report ID -> IIERT676666AAAA
  • Filter Criteria -> amount__c = pv0 , interest__c =pv1
  • Object Name -> client

Now as per your requirement the link should pass the following:-

  • SettingRecordid 
  • Originating Recordid

Now you want to create salesforce parametric custom report, then you have to pass the parameter required by the report in the URL and if the parameter is more than 1 then your link url should be generated as per the follwoing syntax. 

syntax:-    '/IIERT676666AAAA?pv0={!amount__c }&pv1={!interest __c }'

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.