How to find the code behind in Apex - salesforce

I'm new to Salesforce / Apex
There is this guy worked on our salesforce and he left me with many code. My questions, we have a little problem with some of the fields on one of the application form. How do I find where is the code behind this application? Thanks.

There are a few ways in which Apex can be added to perform custom logic in your salesforce application, there's no clear answer which is doing what and you'll need to dig in to discover that if nothing has been documented in your organization.
Check if any triggers exist
Verify if any apex jobs are scheduled, they can be performing apex batches executign logic
verify if your application page are default page layouts or whether they have inline Visualforce elements or are a full Visualforce page. Anything Visualforce is most likely backed up by apex controllers performing business logic.
Beyond Apex, have you checked if there are any configured workflows which are performing field updates ? These too can modify data.

Related

can we create a pick list in lead page layout getting data from external api

I am trying to call an external api from salesforce apex class which will get all the products.so next i want to show these products as picklist in salesforce lead creation or edit page.I am not sure its possible or not.Any solution or workaround on these is mostly appreciated.
I don't see a way to do this on a standard layout.
I personnaly could do this in a Visualforce page. Probably you probably can do this in a Lightning page as well.

Synchronous Call outs from Standard Pagelayout In Salesforce

There is a requirement to make synchronous call out from standard page lay outs of salesfore say for eg. standard case layout. As of my knowledge we can not make a synchronous call out in context to a standard page layout. As process builder or workflow or js button everything will work in an asynchronous context. Want to confirm that , please help with your views.
Erm... no?
Process Builder, Workflow Rule, Trigger - they all fire on event (insert, update). They're all synchronous (the whole operation waits for them to finish saving). Just viewing a record doesn't count as an event. I think you're confusing the "what triggers the action" and "what kind of action happens". Try to distinguish the two. It's like workflows - a workflow rule (condition to be met) is one thing and then what happens (field update, new task, email, outbound message) is completely different thing.
From "clicks not code" functionality Outbound Messages and emails are asynchronous - but as I said above - just viewing a record doesn't count as update, nothing will fire. Callouts done from apex (and you have several options discussed below) can be either synchronous or async. So it's whatever you want really.
You might look into:
a Visualforce page which you'll embed on the page layout (either directly or as a Chatter action for example). That page's apex controller could do the callout.
Or maybe you'd be able to do it in VF from JavaScript (without apex) - make a REST call to your url, process results... There are tons of code samples how to integrate Google Maps for example, this wouldn't be too different.
or (bit of future thinking) make a Lightning Component. You'll be able to embed it in the Lightning App Builder (the "better" page layouts) directly. in Classic SF you'd have to make it a Chatter Action or use "Lightning Out" to reuse a component in a VF page and embed that instead.
Bit more advanced (and paid extra) would be to use Salesforce Connect a.k.a Lightning Connect. Try to pass the Trailhead, easier than explaining it here. You could end up with related list of external records under the case and user wouldn't even realise this data is not hosted in SF. Connect requires OData compatible data source or a piece of Apex that acts as adapter and pretends to return valid format.
If it's about Cases - maybe you can do something fancy using the Service Cloud Console. You'd have to experiment a bit but maybe one of side panels could be a VF page or <iframe> to another system. Maybe you could make something happen with Macros...

How to interact Users(input form data) Using Salesforce Sites into the SalesForce Application(to Custom objects)

First of all I'm really sorry if i'm asking a Dumb Question. But unfortunately i can't find out a way to take inputs for my salesforce Application.
I am developing a simple CV Management app, but i can't figure out how to interact users(input data) to the App? I have created Candidate Custom object, and manually i can create the Candidates, but my requirement is to create records by Candidates themselves.
I followed SalesForce Tutorials and i found out a way to display data using VisualForce Custom Pages. But what i want to## Heading ## do is when i giving a link to the user, he can go to that link and there having form to fill with his personal data, and submit only. But i'm just confused how to user input data map with our Custom Candidate object fields.
when i'm searching i saw some FormAssembly and Custom VisualForce Pages. But Problem is I don't hope to use any 3rd party apps.
Tutorials says that;
In the past, to make Force.com data available to the general public, you had to set up a Web
server, create custom Web pages (JSP, PHP, or other), and use the API to integrate Force.com
apps with an external website. This is no longer the case, thanks to Sites!
Please if you can, help me Friends, Really Appreciate it & Thank you soo much..
You'll probably want to do something along these lines...
Create a Visualforce page with standard controller set to your custom object which is the "CV Entry" page (to send candidates to)
Create a Force.com site in your salesforce org to allow public or restricted access to the page
Setup page authentication/permissions as required

Salesforce - Hiding visualforce form items based on organization

I have a custom viusalforce page as part of a package that i'm developing. The package will be installed on a number of different Salesforce organizations. I require to hide certain parts of the visualforce page (input boxes) based on the organization using the package. What is the best way to accomplish this? I can hardcode it based on Organization ID but I'm not convinced this is the best way, as when clients refresh sandboxes the ID will change.
You should use rendered attribute on apex:input evaluating the org criterial:
<apex:input ... rendered="{!facility.Facility_Address_2__c!=''||render}" ...>
Where facility.Facility_Address_2__c could be the inline evaluation criteria of some org object.field value or render could be a flag set on controller evaluating a deeper criteria.

Prepopulate fields in Salesforce.com

I have a doubt, i've been working with salesforce for a while and now i have a requirement from a customer.
They need that some custom fields be populated with a value of parent object, making some research on stackoverflow, i found this post, but this isn't working for me because my project is a manage package and when this is installed on a another salesforce instance the id of custom field change.
if someone could help me, I will be grateful.
Thanks!.
I can't see any way of doing the same as that post without using the IDs, I was thinking you could route via a VF page and build up the URL in the controller but it doesn't seem as though you can get the IDs of fields, just their type etc..
I think the best you could do in this instance is to override the default new recordpage with a visualforce page. In the constructor of your controller you could then loop through the page parameters and pre-fill the corresponding fields on the new record before it's displayed on screen. Using fieldsets or just an <apex:Detail> component would keep the level of effort down and also maximise the flexibility of the page for the end users.

Resources