• mahendran c 2
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Hi Team,
I am using SOAP api with C# environment, trying to update the Owner in  "Work_Assignment__c". but am getting the issue "The external foreign key reference does not reference a valid entity: Owner". I can able to get Owner Id, Owner Name by using Owner.Id,Owner.Name field.
Please hel me to resolve this issue and below is my code.

sObject attach = new sObject();
 System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
 attach.type = "Work_Assignment__c";
 attach.Id = "a1O0n000000DLZ4EAO";
attach.Any = new System.Xml.XmlElement[1];
attach.Any[0] = xmlDoc.CreateElement("Owner");
attach.Any[0].InnerXml = "0050n0000017hBGAAY"; // Owner Id
SaveResult[] results;
LimitInfo[] limitInfo;
List<sObject> attchmentlist = new List<sObject>();
attchmentlist.Add(attach);
queryClient.update(header, //sessionheader 
                                  null,   //calloptions1 
                                  null,   //assignmentruleheader 2
                                  null,   //mruheader 3
                                  null,   //allowfieldtruncationheader4 
                                  null,   //disablefeedtrackingheader 5
                                  null,  //streamingenabledheader 6
                                  null,   //allornothingheader 7
                                  null, //DuplicateRule header8
                                  null, //Loacaleoption9
                                  null,   //debuggingheader10 
                                  null,   //packageversionheader11 
                                  null, // emailheader
                                  null,   //emailheader 
                                  attchmentlist.ToArray(), //new attachment or issue or anyother object 
                                 out limitInfo,
                                  out results //result of create operation 
                                  );


 
Hi Team,
I am using SOAP api with C# environment, trying to update the Owner in  "Work_Assignment__c". but am getting the issue "The external foreign key reference does not reference a valid entity: Owner". I can able to get Owner Id, Owner Name by using Owner.Id,Owner.Name field.
Please hel me to resolve this issue and below is my code.

sObject attach = new sObject();
 System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
 attach.type = "Work_Assignment__c";
 attach.Id = "a1O0n000000DLZ4EAO";
attach.Any = new System.Xml.XmlElement[1];
attach.Any[0] = xmlDoc.CreateElement("Owner");
attach.Any[0].InnerXml = "0050n0000017hBGAAY"; // Owner Id
SaveResult[] results;
LimitInfo[] limitInfo;
List<sObject> attchmentlist = new List<sObject>();
attchmentlist.Add(attach);
queryClient.update(header, //sessionheader 
                                  null,   //calloptions1 
                                  null,   //assignmentruleheader 2
                                  null,   //mruheader 3
                                  null,   //allowfieldtruncationheader4 
                                  null,   //disablefeedtrackingheader 5
                                  null,  //streamingenabledheader 6
                                  null,   //allornothingheader 7
                                  null, //DuplicateRule header8
                                  null, //Loacaleoption9
                                  null,   //debuggingheader10 
                                  null,   //packageversionheader11 
                                  null, // emailheader
                                  null,   //emailheader 
                                  attchmentlist.ToArray(), //new attachment or issue or anyother object 
                                 out limitInfo,
                                  out results //result of create operation 
                                  );



 
Hi Team,
I am using SOAP api with C# environment, trying to update the Owner in  "Work_Assignment__c". but am getting the issue "The external foreign key reference does not reference a valid entity: Owner". I can able to get Owner Id, Owner Name by using Owner.Id,Owner.Name field.
Please hel me to resolve this issue and below is my code.

sObject attach = new sObject();
 System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
 attach.type = "Work_Assignment__c";
 attach.Id = "a1O0n000000DLZ4EAO";
attach.Any = new System.Xml.XmlElement[1];
attach.Any[0] = xmlDoc.CreateElement("Owner");
attach.Any[0].InnerXml = "0050n0000017hBGAAY"; // Owner Id
SaveResult[] results;
LimitInfo[] limitInfo;
List<sObject> attchmentlist = new List<sObject>();
attchmentlist.Add(attach);
queryClient.update(header, //sessionheader 
                                  null,   //calloptions1 
                                  null,   //assignmentruleheader 2
                                  null,   //mruheader 3
                                  null,   //allowfieldtruncationheader4 
                                  null,   //disablefeedtrackingheader 5
                                  null,  //streamingenabledheader 6
                                  null,   //allornothingheader 7
                                  null, //DuplicateRule header8
                                  null, //Loacaleoption9
                                  null,   //debuggingheader10 
                                  null,   //packageversionheader11 
                                  null, // emailheader
                                  null,   //emailheader 
                                  attchmentlist.ToArray(), //new attachment or issue or anyother object 
                                 out limitInfo,
                                  out results //result of create operation 
                                  );