Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

How to execute global batch job from installed package:

NS__BirthdayBatch bb = new NS__BirthdayBatch();
Database.executeBatch(vb); 

When I try ti run this code in dev console or workbench I am getting this error:

COMPILE ERROR: Invalid type: NS__BirthdayBatch
LINE: 1 COLUMN: 45
share|improve this question

1 Answer 1

up vote 4 down vote accepted

Classes are namespace prefixed with a dot rather than double underscores. Your code should be:

NS.BirthdayBatch bb = new NS.BirthdayBatch();
Database.executeBatch(bb); 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.