function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
metaforcemetaforce 

Test methods, workflow field update, approval processes

How do we test code that's dependent on an approval process or workflow field update? the reason I ask this question is because we are working with managed packages, and whenever we try to create a patch org, no configuration (workflow/approval process) gets created, and so corresponding test methods fail.

 

Let me how what are the best practices in such cases?

 

Thanks

Ajay

 

 

bob_buzzardbob_buzzard

We have a similar issue with one of our packages.  The unit tests rely on workflow being set up, but at first installation, the workflow doesn't exist.  One way around this is to use trialforce.  This allows you to provide interested parties with an org that has your managed package installed and a bunch of pre-existing configuration and data.

 

Unfortunately, the only other solution I've found is to tell installers to tick the "ignore unit test failures" box when installing the package, but this never feels like a good thing.

Malli'sMalli's

Hi

 

Please tell me how to Write code for workflow& Approval process through APEX code