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
vladislavvladislav 

Pull data and display it on SiteForce website

Hello. I'm new to SiteForce and *force services as general, so my question might have its answer somewhere, but I still can't find it. So, I've created a site, using SiteForce. The problem I'm having now is that on every page on this site I need to display some data, which comes from SalesForce and I don't know how to do that. The data is handled as follows: I look for all fields with certain name (these fields contain some numbers in them), get their values, make an aggregate on their values and show it in my site. For example: I've got this custom field "price", for different products, presented as custom objects, so one has a value of 10, another is 20 and another is 30. I need to pull this data, make a calculation as follows: (10+20+30) / 3 == 20 and I need to display this "20" on my SiteForce website. So is this possible and how? I might need to use APEX to pull the data, but don't know how to show the result on the page... If you can just give me some more information on what should I use to get this done. Any help will be appreciated. Thanks.
ccoffccoff

The Repeater/Repeater functionality allows you to pull data from your standard and custom objects in Salesforce.  There's also something called a Data Function, which has functions such Count, Maximum, Average, Minimum & Sum, but I haven't used this feature yet.  In either case, it connects Siteforce to your objects in Salesforce.  One note, make sure your guest profile has access to view the objects you want to pull from.  You can only get to it from Siteforce when you are in the process of creating the Repeater/Data Function.

 

Hope this helps.  Good luck.

vladislavvladislav
Thanks for your reply @ccoff. This is OK, but I've got some more tasks with some more complex calculations that I need to do over my data and display it on site... so is it possible to use APEX functionality, just to create a simple class that will pull the data I need, do my calculations and then just return the result. So is it possible to do it like this and use something to display this result on the site? You see, the data will be constantly changing in some period of time and it is chunked into pieces of information in different fields, so I need to collect it by combining these fields and do some calculations over them so to be able to get the real result... that's why I need some more flexible way to do this. I've read a little about VisualForce and how they get and display data in such way. So is it possible to somehow integrate APEX and VIsualForce functionality in my site, so I can just be more flexible with the calculations and displaying the results or if there is any other solution for this...? Thanks.
Ryan-GuestRyan-Guest

If you want full access to visualforce and Apex you might want to take a look at Force.com Sites.