Guest User

Untitled

a guest
Jun 30th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. @isTest(seealldata=false)
  2. public class CreateOpty_Phyothersvcs_WPatsBatchTest {
  3. static testMethod void test()
  4. {
  5. patient__C pat=new patient__C();
  6. pat.name=test;
  7. cost__C=100;
  8. insert pat;
  9.  
  10. job__c jb = new job__c();
  11. jb.name__c=test;
  12. patient__C.id=pat.id;
  13. //some field
  14. insert jb;
  15. //formula field in job object is patient_cost__c=patinet__r.cost__C
  16.  
  17. system.debug(''+jb.patient_cost__c); //it showing null
  18. //when i write query like
  19.  
  20. List<job__c> job = new List<job__c>();
  21. job=[select id patient_cost__c from patient_cost__c where id=:jb.id];
  22. system.debug(''+job[0].patient_cost__c); //it showing 100 correct as required
  23.  
  24. // but i want here 100
  25. system.debug(''+jb.patient_cost__c); //its still showing null
  26.  
  27. if(job.patient_cost__c<=50000)
  28. {
  29.  
  30. }
Add Comment
Please, Sign In to add comment