• Deepal Dsilva
  • NEWBIE
  • 5 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Greetings all, I've created this apex trigger to create a child case record when a few words are found in the description of a parent case record such as social security, credit cards, etc. What I am trying to do, however, is have the child case record create with a description that only contains the words found in the parent case description. These words are captured in the secretKeyword set.

I tried using the .split method in my string, but get this error that such methods don't exist, any steps I should take.

triggers/CheckSecretInformation.trigger: Method does not exist or incorrect signature: void split(String) from the type Set<String> 

 
trigger CheckSecretInformation on case (after insert, before update) {
	
	String childCaseSubject = 'Waring: Parent case may contain secret info';

	// Step 1: Create a collection containing each of our secret keywords
	Set<String> secretKeywords = new Set<String>();
	secretKeywords.add('Credit Cards');
	secretKeywords.add('Social Security');
	secretKeywords.add('SSN');
	secretKeywords.add('Passport');
	secretKeywords.add('Bodyweight');

// Step 2: Check to see if our case contains any of the secret words
	List<Case> casesWithSecretInfo = new List<Case>();
	for(Case myCase : Trigger.new){		
		if (myCase.Subject != childCaseSubject) {
		for (String Keyword : secretKeywords) {
			if(myCase.Description != null && myCase.Description.containsIgnoreCase(Keyword)) {
				casesWithSecretInfo.add(myCase);
				System.debug('Case ' + myCase.Id + ' include secret keywords' + keyword);
				break;
				}
			}
		}
	}
	// Step 3: If our case contains a secret keyword, create a child case
	List<Case> casesToCreate = new List<Case>();
	  System.debug('Size of offending cases: ' + casesWithSecretInfo.size());


	for (Case casesWithSecretInfo : casesWithSecretInfo) {
		Case childCase        = new Case();
		childCase.Subject     = childCaseSubject;
		childCase.ParentId    = casesWithSecretInfo.Id;
		childCase.IsEscalated = true;
		childCase.Priority    = 'High';
		childCase.Description = 'At least one of the following keywords were found:' + secretKeywords.split(;);
		casesToCreate.add(childCase);
	}
	insert casesToCreate;
}



 

2)Which statement about the Lookup Relationship between a Custom Object and a
Standard Object is correct?
A. The Lookup Relationship on the Custom Object can prevent the deletion of the
Standard Object.
B. The Lookup Relationship cat:That be marked as required on the page layout for the
Custom Object.
C. The Custom Object will be deleted when the referenced Standard Object is
deleted.
D. The Custom Object inherits security from the referenced Standard Objects

Answer: A
C or A




3)When would a developer use a custom controller instead of a controller extension?Choose 2 answers:

A. When a Visualforce page needs to replace the functionality of a standard controller.
B. When a Visualforce page does not reference a single primary object.
C. When a Visualforce page should not enforce permissions or field-level security.
D. When a Visualforce page needs to add new actions to a standard controller.

Answer
some say its A&C and some its B&C


4)Which requirement needs to be implemented by using standard workflow instead of process?
A. Create activities at multiple intervals.
B. Send an outbound message without apex code.
C. Copy an account address to its contacts.
D. submit a contract for approval.

Ans A&B
Some say its A&B , B&C


5)In which order does salesforce execute events upon saving a record?
A. before Trigger; validation Rules; After Triggers; Assignment Rules; Workflow Rules; Commit
B. Validation Rules; Before Triggers; After Triggers; Workflow Rules; Assignment Rules; commit
C. before Triggers; Validation Rules; After Triggers; Workflow Rules; assignment Rules; commit
D. Validation Rules; Before Triggers; After Triggers; assignment Rules; Workflow Rules; Commit

Ans
Some say its A, some D


6)In an organization that has enabled multiple currencies, a developer needs to aggregate the sum of
theEastimated_value__c currency field from the campaignmember object a roll-up summary field called
total_estimated_value__c on campaign. 
How is the currency of the total_Estimated_value__c roll-up summary field determined?
A. The values in campaignmember.estimated_value__c are converted into the currency of the
campaign record, and the sum is displayed using the currency on the campaign record.
B. The values in campaignMember.Estimated_value__c are converted into the currency on the majority
of the campaignmember records and the sum is displayed using that currency.
C. The values in campaignMember.Estimated_value__c are summed up and the resulting
Total_Estimated_value__c field is diaplyed as a numeric field on the campaign record.
D. The values in campaignMember.Estimated_value__c are converted into the currency of the current
user, and the sum is displayed using the currency on the campaign record.


Ans A
Some say A , and some B


7)What is a capability of cross-object formula fields? Choose 3
A. Formula fields can reference fields from master-detail or lookup parent relationships.
B. Formula fields can expose data the user does not have access to in a record.
C. Formula fields can be used in three roll-up summaries per object.
D. Formula fields can reference fields in a collection of records from a child relationship.
E. Formula fields can reference fields from objects that are up to 10 relationships away

Ans A,B,E
Some say its A,b,E and some say C,D,E

8)How can a developer avoid exceeding governor limits when using an apex trigger? Choose 2
A. By using a helper class that can be invoked from multiple triggers.
B. By using the database class to handle DML transactions.
C. By using maps to hold data from query results.
D. By performing DML transactions on lists of sobjects.

Ans C&D
Some say its B&D, some say its C&D




9)Public String getStringMethod1 (){
returnmyString;
}
public String getStringMethod2 () {
if(myString == null)
myString ='Method2';
returnmyString;
}
}
<apex: page controller = "mycontroller">
{!myString},{!StringMethod1}, {!StringMethod2}, {!myString}
</apex:page>
what does the user see when accessing the custom page?
A. getMyString---
B. ,,Method2,
C. , ,Method2,getMyString
D. getMyString, , Method2,getMyString

Ans
Some say its B , some say its D


10)A developer wants to create a custom object to track customer invoices. how should invoices and
accounts be related to ensure that all invoices are visible to everyone with access to an Account?
A. The Account should have a lookup relationship to the invoice.
B. The Invoice should have a Master-detail relationship to the Account.
C. The account ahould have a Master- detail relationship to the Invoice.
D. The Invoice should have a lookup relationship to the account.

Ans:B
Some say its B, some say its C


11)Which declarative method helps ensure quality data? choose 3
A. Exception handling.
B. Workflow alerts.
C. Validation rules.
D. Lookup filters.
E. page layouts.

Ans:C,D;E
Some its A,C,D and Some say its C,D,E

12)A company wants a recruiting app that models candidates and interviews; displays the total number of interviews on each candidate record; and defines security on interview records that is

independent from the security on candidate records.What would a developer do to accomplish this task?
Choose 2 answers.
A) Create a lookup relationship between the Candidate and Interview objects.
B) Create a trigger on the Interview object that updates a field on the Candidate object
C) Create a roll-up summary field on the Candidate object that counts Interview records.
D) Create a master-detail relationship between the Candidate and Interview objects.

Ans:The ans is A&B
some say A&B, some say its


13)A wants to list all of the Tasks for each Account on the Account detail page. When a Task is
createdfor a Contact, What does the developer need to do to display the Task on the related Account
records?
A Create an account formula field that dislay the task information.
B Nothing. The task is automatically displayed on the Account page.
C Create a workflow Rule to relate the Task to the Contact`s Account.
D Nothing. The Task connot be related to an Account and a Contact.

Ans:Mostly its B
Some say its B and some say C

14)What is a capability of formula fields?(choose 3)
A Display the previous value for a field using the PRIORVALUE function.
B Return and display a field value from another object using the VLOOKUP function.
C Determine which of three different images to display using the IF function.
D Generate a link using the HYPERLINK funcion to specific record in a legacy system.
E Determine if a datetime field has passed using the NOW function.

Ans
Some says its B,C,D and some say its A,B,C

15)A developer writes a SOQL query to find child records for a specific parent. How many levels can be
returned in a single query?
A. 3
B. 5
C. 1
D. 7

Ans:C
Some says its c, and some say its D

16)A developer creates a new visualforce page and apex extension, and writes test classes that exercise 95% coverage of the new apex extension. changeset deployment to production fails with the test coverage warning; "average test coverage across all apex classes and triggers is 74%, at least 75% test coverage is required."
What can the developer do to successfully deploy the new visualforce page and extension?
A. create test classes to exercise the visualforce page markup.
B. Select “Disable parallel apex testing" to run all the tests.
C. Add test methods to existing test classes from previous deployments.
D. Select "Fast Deployment" to bypass running all the tests.

Ans:C
Some say c, some say D