• Rahul Garg SFD
  • NEWBIE
  • 5 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 4
    Likes Given
  • 1
    Questions
  • 10
    Replies
An Apex transaction insert 100 Account records and 2000 Contact records  before encountering a DML exception when attempting to insert 500 Opportunity records. The Account record are inserted by calling the database.insert() method with the allOrNone argument set to false. The Contact and Opportunity record are inserted using the stand-alone insert statement.
How many total records will be committed to the database in this transaction?
A. 100
B. 2,100
C. 2,000
D. 0

Considering the salesforce documentation of Database.insert() when allOrNone is false, the answer should be A i.e 100. But, when I checked this on Anonymous window in developer console I get answer as D i.e 0.

Please help me with this solution.
1. I have a custom Object
2. I have created a detail page button in that
3. Behavior: Display in existing window without sidebar or header
4. Display Type: Detail Page Button
5. Content Source: URL

This button works properly in lightning(Redirects to specified url in the same existing window)

But In Community, It Opens a new tab and redirects to specified URL. I want to redirect to URL in the same existing window in Community.

Can anyone please suggest a solution for this
This is one of the exam qns I have seen around that I don't agree with the answers I have seen:
A developer needs to create a visualforce page that displays case data. The page will be used by both support reps and support managers. The support rep profile does not allow visibility of the customer_Satisfaction_c Field, but the support manager profile does. How can the developer create the page to enforce field level security and keep future maintenance to a minimum?

A. Create one visualforce page for use by both profiles

B. Use a custom controller that has the with sharing keywords

C. Use a new support manager permission sets

D. Create a separate visualforce page for each profile

Now everywhere the answer suggested is B. But I am wondering why it is not A? By deafault the standard controller will impose user level sharing (rather than custom's system level sharing). This would also need less maintenance because there is no need to create an extension (with the 'sharing' keyword).

Can someone explain why it can't be A? or confirm it is A? (ofcourse B will also work but it is extra development that, IMHO, is not needed)
Hi,

Can someone explain this question to me? The web site where I found this question states the answer as 0 orders will be successfully loaded, but I didn't understand why.   Is it because the governor limit on the number of SELECTs is 100?

Thank you.
Priya

List<Account> customers = new List<Account>();
For (Order__c o: trigger.new)
{
Account a = [SELECT Id, Is_Customer__c FROM Account WHERE Id = :o.Customer__c];
a.Is_Customer__c = true;
customers.add(a);
}
Database.update(customers, false);
The developer tests the code using Apex Data Loader and successfully loads 10 Orders. Then, the developer loads 150 Orders.
How many Orders are successfully loaded when the developer attempts to load the 150 Orders?
 Users report multiple intermittent errors and unexpected results when saving a record. Upon investigation, the developer finds that trigger are executing more than one. What is a potential solution to solve this situation?
a)    Use a one trigger per object approach
b)    Use a static variable to check if the trigger has already run.
c)    Disable all triggers and use workflow rule…..
d)    Use private
Please help me with the correct answer.

A developer creates an Apex helper class to handle complex trigger logic. How can the helper class warn users when the trigger exceeds DML governor limits?
A. By using ApexMessage.Message() to display an error message after the number of DML statements is exceeded.
B. By using Messaging.SendEmail() to conthtinue the transaction and send an alert to the user after the number DML statements is exceeded.
C. By using PageReference.setRedirect() to redirect the user to a custom Visualforce page before the number DML statements is exceeded.
D. By using Limits.getDMLRows() and then displaying an error message before the number of DML statements exceeded.

Hi frndz ! 

                      How to upload a content document file in any object through only developer console.

 

                      Please help me that code.