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
Again AgainAgain Again 

record.Id returned via join seems different than record.Id in non-join query?

Hi,
 
I'm building a custom view of sorts, of a Case, using an s-control. I'm listing the attachments and want to provide a link to the attachments.
 
The query looks as follows:

var result = sforce.connection.query("Select Name, Id, Parent.Name, Parent.Id, ParentId FROM Attachment Where Parent.Name = '"+ CaseId +"'");

I construct a string like this:

output += "<tr><td><a target=new href=https://nas4.salesforce.com/"+record.Id +">"+ record.Name + "</a></td></tr>"

However, the Id returned is slightly different from the attachment's actual Id. I suspect it's a relationship Id of sorts. For example, if the recordId is actually OOP300000VWTIEA4 (obtained by just doing a Select Id from Attachment where ParentId = xxx), the Id returned by my join query is  OOP300000WDoIEAC.

What must I do to my join query to get the actual Id for the attachment? I'd need either some change to the query, or maybe there's a different method to open the attachment (would be very interested if someone could tell me a way to open attachment directly, without directing to the attachment detail page first).

Thanks

Rozanne

Again AgainAgain Again

Has anyone else come across this behaviour before?

Thanks
Rozanne