Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @isTest(seealldata=false)
- public class CreateOpty_Phyothersvcs_WPatsBatchTest {
- static testMethod void test()
- {
- patient__C pat=new patient__C();
- pat.name=test;
- cost__C=100;
- insert pat;
- job__c jb = new job__c();
- jb.name__c=test;
- patient__C.id=pat.id;
- //some field
- insert jb;
- //formula field in job object is patient_cost__c=patinet__r.cost__C
- system.debug(''+jb.patient_cost__c); //it showing null
- //when i write query like
- List<job__c> job = new List<job__c>();
- job=[select id patient_cost__c from patient_cost__c where id=:jb.id];
- system.debug(''+job[0].patient_cost__c); //it showing 100 correct as required
- // but i want here 100
- system.debug(''+jb.patient_cost__c); //its still showing null
- if(job.patient_cost__c<=50000)
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement