• Alexander the Keeper
  • NEWBIE
  • 10 Points
  • Member since 2015
  • Web/Salesforce Developer
  • Mirantis


  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Hello, 

I have a situation when we have about 50 different test classes, and each of them has from 1 to 10 test methods.

As far as I understand, for speed is better to have a testSetup method in classes with a significant number of test methods, because data not added but refreshed for each method.

In my case, more than 50% of tests use the same necessary data, so I was wondering how to optimize its creation.

Do anybody know the pros/cons sheets for Test.loadData(CSV) and Test Data Factory.

I understand basics and documentation, but maybe someone has real-life experience with using both of them and can provide its feedback?
Hello,

i need help with best practices from experienced salesforce developers.

For Update our Object we have Process Builder, Worfklow Rules and Triggers.

But we also know that if Process Builder or WFR have to change Object, then all triggers will be executed one more time.

So my example is:
I have Case Object
It already have 10-15 update triggers (before + after) (actually it's only 1 trigger but with a lot of other methods to run)
So i can see in debug log, that full work of this triggers, for example take 30 of 100 SOQL Querrys

Now i need to Stop Entitlement process for "Pending" Cases. (or another simple task, what can be accomplished with WFR/PB)
Ok. i have 2 ways:
1. Add WFR/PB with start/stop case for case status is changed = true && status = pending, etc.
2. Add more logic in Before Trigger.

And if i will use first way, then my triggers will be exucuted twice.
So, instead of 30 of 100 SOQL querries it will be 60 of 100... And for me it looks awful.

Main question: Am I right that if we already have complex structure with triggers, then using WFR/PB is undesirable (if they are update same object)?

Sorry for my english.
Hello,

i need help with best practices from experienced salesforce developers.

For Update our Object we have Process Builder, Worfklow Rules and Triggers.

But we also know that if Process Builder or WFR have to change Object, then all triggers will be executed one more time.

So my example is:
I have Case Object
It already have 10-15 update triggers (before + after) (actually it's only 1 trigger but with a lot of other methods to run)
So i can see in debug log, that full work of this triggers, for example take 30 of 100 SOQL Querrys

Now i need to Stop Entitlement process for "Pending" Cases. (or another simple task, what can be accomplished with WFR/PB)
Ok. i have 2 ways:
1. Add WFR/PB with start/stop case for case status is changed = true && status = pending, etc.
2. Add more logic in Before Trigger.

And if i will use first way, then my triggers will be exucuted twice.
So, instead of 30 of 100 SOQL querries it will be 60 of 100... And for me it looks awful.

Main question: Am I right that if we already have complex structure with triggers, then using WFR/PB is undesirable (if they are update same object)?

Sorry for my english.
Hello, 

I have a situation when we have about 50 different test classes, and each of them has from 1 to 10 test methods.

As far as I understand, for speed is better to have a testSetup method in classes with a significant number of test methods, because data not added but refreshed for each method.

In my case, more than 50% of tests use the same necessary data, so I was wondering how to optimize its creation.

Do anybody know the pros/cons sheets for Test.loadData(CSV) and Test Data Factory.

I understand basics and documentation, but maybe someone has real-life experience with using both of them and can provide its feedback?