61. How to round the double to two decimal places in Apex?
Decimal d = 100/3;
Double ans = d.setScale(2) ;
62.In Profile settings, what is difference between “Modify All Data” and “Modify All” ?
Ans: Modify All Data : Create, edit, and delete all organization data, regardless of sharing settings. Modify All : Give Read, Add, Delete permission to selected Object, Create permission is not included in Modify All permission.
I have searched a lot for any library available for the Gantt Chart however there are very few available on the web. Even i was not able to find out the chart in “Google API”.
In this article, i will delineate creating the “Gantt Chart” using JQuery and JSON. In previous article we have seen that how to generate JSON using Salesforce. So continuing the last article, i will use the same JSON reponse to create the “Gantt Chart”.
What is Gantt Chart?
A Gantt chart is a type of bar chart, developed by Henry Gantt, that illustrates a project schedule. Gantt charts illustrate the start and finish dates of the terminal elements and summary elements of a project.
However we know that the variable name “from” and “desc” are not valid in Apex because they are keyword. so as a workaround i am replacing the placeholders after the generation of JSON in previous article.
Lots of time i have seen the question on salesforce developer forum regarding the trigger on Attachment. As this is not a straightway, still we can have trigger on Attachment.
We cannot create trigger on Attachment from the standard salesforce UI however we will have to use the eclipse.
While creating the trigger, we have to keep some important points. We should be very careful while writing the trigger on Attachment, as it will be used by any standard or custom Object and therefore the criteria to run trigger for “particular object only” must be handled carefully.
Although this is very common approach and lots of articles are around on this topic, still I want to delineate the topic in other way. This topic covers complete scenarios for the approval process based on the Apex class.
Agenda of this article:
Automatically submit the record for approval on the basis of field value.
Automatically select the next Approver.
Approve / Reject the record on the basis of field.
Opportunity Object is used.
Approval Process is already set on the Opportunity.
Field “Next_Approver” will decide that who is going to approve the record.
There are three steps in the approval process.
There is no test class written and no check for mandatory fields needed for the trigger, as I have considered positive scenarios only.
51. Explain Permission sets released in Winter 12. Ans :
A permission set is a collection of settings and permissions that give users access to various tools and functions. The settings and permissions in permission sets are also found in profiles, but permission sets extend users’ functional access without changing their profiles. For example, to give users access to a custom object, create a permission set, enable the required permissions for the object, and assign the permission set to the users. You never have to change profiles, or create a profile for a single use case. While users can have only one profile, they can have multiple permission sets.
40. What is Master Detail relationship and look up relationship in Salesforce? Ans:
Master Detail relationship is the Parent child relationship. In which Master represents Parent and detail represents Child. If Parent is deleted then Child also gets deleted. Rollup summary fields can only be created on Master records which will calculate the SUM, AVG, MIN of the Child records.
Look up relationship is something like “has-a” (Containership) relationship. Where one record has reference to other records. When one record is deleted then there is no impact on other records.
41. Can we convert the lookup relationship to Master Detail relationship? Ans:
We can convert the lookup relationship to master detail relationship if and only if all the existing record has valid lookup field.
42. In How many way we can invoke the Apex class? Ans:
To start first we will need to authorize below two URL which can be accessed from salesforce environment.
This can be done from “Setup | Administration Setup | Security Controls | Remote Site Settings”
Email services are automated processes that use Apex classes to process the contents, headers, and attachments of inbound email.
You can associate each email service with one or more Salesforce-generated email addresses to which users can send messages for processing.
The general template to create the apex class for the email services is: