Linked Questions

1 vote
1 answer
5k views

Test Class for Contact [duplicate]

I have a code that is testing a batch, I am creating a contact and an Account , but the contact isn't getting linked to the account (c.AccountId = null). The same code is tested in Async window and it ...
Zame's user avatar
  • 125
-2 votes
1 answer
2k views

test class for apex class creating multiple object records [duplicate]

Can anyone helps me out in writing the test class for below apex class. I know that I should not post it here asking for this kind of questions but as I am new to apex and I need to deploy so I was ...
Sainath's user avatar
  • 11
1 vote
1 answer
1k views

How to test trigger that compares Trigger.new with Trigger.old [duplicate]

I have a simple trigger that runs on Account update, and the only logic is a check to whether or now BillingPostalCode changes or not. This is my code: trigger ZipCodeUpdated on Account (before update)...
Santiago Barboza's user avatar
0 votes
1 answer
600 views

how to write Test class for generate Random String method present in a class in salesforce [duplicate]

@AuraEnabled public static Integer generateRandomString() { try{ return Math.round((Math.random() * (900000) + 100000)); } catch (Exception e) { throw e; } }
Swarnim's user avatar
0 votes
1 answer
1k views

How to write test class for below Vf Page Controller [duplicate]

Class public with sharing class CreateQuotePDFController { public list<QuoteLineItem> quoteLineItemsList{get;set;} public Id getid{get;set;} public Double grandTotalTax{get;set;} ...
Wheels-Of- My Soul's user avatar
-2 votes
1 answer
556 views

Test Class for a simple Apex Class [duplicate]

I am trying to write a test class for a simple Apex Class which sets the status of the Case to be Closed like below public class updateCaseRecord { @AuraEnabled public static void ...
user81642's user avatar
  • 669
-3 votes
1 answer
796 views

Test class trigger.NewMap trigger.oldMap on opportunity [duplicate]

I need to write a test class on my OpportunityTriggerHandler and I'm having some difficulties to define how to construct the logic & scenarios in my test to test and the data to build in my test ...
Fatih's user avatar
  • 1
0 votes
0 answers
655 views

Need Help with a test class to my apex class that attaches a Visualforce Page pdf to the quote [duplicate]

I found a way to write an apex class that attaches my quote which is generated by an vf page as a pdf to my quote object. Writing the test class is even a bigger problem for me. I get to 36% coverage ...
Thomas Kayser-Eichberg's user avatar
-1 votes
3 answers
609 views

How to write a test class for this below code can anyone help me [duplicate]

I want to write a test class to achieve 100 % code coverage for this below code can anyone help me to solve this problem i don't know how to write a test class for using this trigger Trigger: trigger ...
Jayati Shukla's user avatar
0 votes
1 answer
434 views

Test Class Coverage for Apex Controller [duplicate]

I need help in writing test class for following apex class. Could anyone please suggest how to create test data,test the following method defined in apex class with positive and negative scenarios and ...
Rose 's user avatar
  • 71
-2 votes
1 answer
319 views

Add test method to your test class error getting, please help how to resolve [duplicate]

public with sharing class CreateQuotePDFController { public list<QuoteLineItem> quoteLineItemsList{get;set;} public Id getid{get;set;} public Double grandTotalTax{get;set;} ...
user105753's user avatar
0 votes
1 answer
324 views

How to get rid of this System.ListException: List index out of bounds: 0 error in my test class [duplicate]

I am trying to create a new case with record type to cover the lines in my apex class but throwing the inbound error. please help me to cover the lines This is the full method public void ...
Teja 's user avatar
  • 15
0 votes
1 answer
311 views

Test Class for Trigger on Event [duplicate]

I am new to Salesforce and I am writing a test class for the trigger. Can anyone tell me how to write a test class for the trigger below? trigger QBRNewRec on Account (After insert, After Update) { ...
Monica Manickam's user avatar
0 votes
1 answer
215 views

Use Map instead of For loop in my Apex Trigger [duplicate]

I'm new to coding and I need help in modifying the apex trigger below to the correct one. Can you also help me in creating a test class for this? Thank you so much! trigger UpdateLadderedFields on ...
Salesforce Dev's user avatar
0 votes
0 answers
342 views

Test Class for Dynamic SOQL [duplicate]

Pretty new with salesforce dev. So forgive me. I am doing a SOQL query and then updating records. The trick here is . I am grabbing my query from two custom fields which are in the Custom Settings . ...
deboniar's user avatar

15 30 50 per page
1
2 3 4 5
10