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
Varun AnnadataVarun Annadata 

I am trying to use inline query to query a child fields

But the compiler is not recognizing the relationship name.Why is the inline query not able to recognize the relationship name.What may be possible problem?
Best Answer chosen by Varun Annadata
Maharajan CMaharajan C
Try this,

List<Medical_History_MVN__c> Mh= new List<Medical_History_MVN__c>([select Id,Primary_ICD_10_CM_Code_C1__c,Primary_ICD_10_CM_Code_C1__r.Disease_State__c from Medical_History_MVN__c where Program_Member__c =: pmId and RecordTypeId =:  RT1Id]);

Can you please Let me know if it works or not!!!

If it helps don't forget to mark this as a best answer!!!

Thanks,
​Raj
 

All Answers

Imran AnsariImran Ansari
Can you paste your query here?
Varun AnnadataVarun Annadata
List<Medical_History_MVN__c> Mh= new List<Medical_History_MVN__c>([select Id,Primary_ICD_10_CM_Code_C1__c,(select id,Disease_State__c from Primary_ICD_10_CM_Code_C1__r) from Medical_History_MVN__c where Program_Member__c =: pmId and RecordTypeId =:  RT1Id]);
Maharajan CMaharajan C
Try this,

List<Medical_History_MVN__c> Mh= new List<Medical_History_MVN__c>([select Id,Primary_ICD_10_CM_Code_C1__c,Primary_ICD_10_CM_Code_C1__r.Disease_State__c from Medical_History_MVN__c where Program_Member__c =: pmId and RecordTypeId =:  RT1Id]);

Can you please Let me know if it works or not!!!

If it helps don't forget to mark this as a best answer!!!

Thanks,
​Raj
 
This was selected as the best answer