Hello All ,
Below are the fetchxml before and after
Before Change:
fetchXML = "<fetch version=\"1.0\" output-format=\"xml-platform\" mapping=\"logical\" distinct=\"true\">" +
"<entity name=\"contact\">" +
"<attribute name=\"fullname\" />" +
"<attribute name=\"emailaddress1\" />" +
"<attribute name=\"mobilephone\" />" +
"<attribute name=\"telephone1\" />" +
"<attribute name=\"parentcustomerid\" />" +
"<attribute name=\"address1_city\" />" +
"<order attribute=\"fullname\" descending=\"false\" />" +
"<filter type=\"and\">" +
"<condition attribute=\"statecode\" operator=\"eq\" value=\"0\" />" +
"</filter>" +
"<link-entity name=\"connection\" from=\"record2id\" to=\"contactid\" alias=\"de\">" +
"<filter type=\"and\">" +
"<condition attribute=\"record2objecttypecode\" operator=\"eq\" value=\"2\" />" +
"<condition attribute=\"record1id\" operator=\"eq\" value=\"" +
accountId +
"\" />" +
"</filter>" +
"</link-entity>" +
"</entity>" +
"</fetch>";
After Change:
fetchXML = "<fetch version=\"1.0\" output-format=\"xml-platform\" mapping=\"logical\" distinct=\"false\">" +
"<entity name=\"contact\">" +
"<attribute name=\"fullname\" />" +
"<attribute name=\"emailaddress1\" />" +
"<attribute name=\"mobilephone\" />" +
"<attribute name=\"telephone1\" />" +
"<attribute name=\"parentcustomerid\" />" +
"<attribute name=\"address1_city\" />" +
"<order attribute=\"fullname\" descending=\"false\" />" +
"<filter type=\"and\">" +
"<condition attribute=\"statecode\" operator=\"eq\" value=\"0\" />" +
"</filter>" +
"<link-entity name=\"connection\" from=\"record2id\" to=\"contactid\" alias=\"de\">" +
"<filter type=\"and\">" +
"<condition attribute=\"record2objecttypecode\" operator=\"eq\" value=\"2\" />" +
"<condition attribute=\"record1id\" operator=\"eq\" value=\"" +
accountId +
"\" />" +
"</filter>" +
"</link-entity>" +
"</entity>" +
"</fetch>";
This after change has resolved my issue.
i am not sure what it is to be done with distinct as false or true.