How to tell the object type of an AttachmentAPI Access to Google Doc Attachments?Triggering code on sObject Child Relationship actionsNeed to export attachments from Salesforce using a soql query and reload them to a different custom objectHow to “deep clone including Attachments” without hitting the heap space governor limit?Email File Attachment typeDecode Body from Attachment ObjectHow to Purge Case Attachments?How to remove notes and attachment from account object?Need help understanding this apex trigger exampleIssue in fetching the Task subject data from it's Attachment list via query
How can one convert an expression to a string while keeping the quotation marks of strings that are part of the expression?
How would you say "Sorry, that was a mistake on my part"?
How can I help our ranger feel special about her beast companion?
What were the problems on the Apollo 11 lunar module?
Term “console” in game consoles
Random piece of plastic
Why did Fury respond that way?
How to not confuse readers with simultaneous events?
Who determines when road center lines are solid or dashed?
Operation Unzalgo
Necroskitter and creatures dying because of placing -1/-1 counters
I have found a mistake on someone's code published online: what is the protocol?
Is it rude to refer to janitors as 'floor people'?
I want to identify a part from a photo
Parallel Computation with the possibility of calculation failure
When can a polynomial be written as a polynomial function of another polynomial?
Desecrating Shabbos to ask a Gadol to daven for a patient?
Locked-up DOS computer beeped on keypress. What mechanism caused that?
Why aren't there any women super GMs?
Strategy to pay off revolving debt while building reserve savings fund?
Should I use a resistor between the gate driver and MOSFET (gate pin)?
Is straight-up writing someone's opinions telling?
How to belay quickly ascending top-rope climbers?
How would thermophilic fish survive?
How to tell the object type of an Attachment
API Access to Google Doc Attachments?Triggering code on sObject Child Relationship actionsNeed to export attachments from Salesforce using a soql query and reload them to a different custom objectHow to “deep clone including Attachments” without hitting the heap space governor limit?Email File Attachment typeDecode Body from Attachment ObjectHow to Purge Case Attachments?How to remove notes and attachment from account object?Need help understanding this apex trigger exampleIssue in fetching the Task subject data from it's Attachment list via query
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I need to export all of the attachments of an org. I would like to break them down to be in a folder based upon the object type of their parent. In other words, I want all attachments which are in an Account to be in one single folder, and all of the ones in an Opportunity to be in another folder.
I've been trying to determine how the Attachments are arranged by running queries on the Attachment object in Workbench. But I believe the closest I can come to determining this information is the Attachment object's ParentID field. But that's just the ID of the individual record, not the object type of the Parent. Is there any way to determine the object type of the Parent of the Attachment ?
attachment
add a comment |
I need to export all of the attachments of an org. I would like to break them down to be in a folder based upon the object type of their parent. In other words, I want all attachments which are in an Account to be in one single folder, and all of the ones in an Opportunity to be in another folder.
I've been trying to determine how the Attachments are arranged by running queries on the Attachment object in Workbench. But I believe the closest I can come to determining this information is the Attachment object's ParentID field. But that's just the ID of the individual record, not the object type of the Parent. Is there any way to determine the object type of the Parent of the Attachment ?
attachment
add a comment |
I need to export all of the attachments of an org. I would like to break them down to be in a folder based upon the object type of their parent. In other words, I want all attachments which are in an Account to be in one single folder, and all of the ones in an Opportunity to be in another folder.
I've been trying to determine how the Attachments are arranged by running queries on the Attachment object in Workbench. But I believe the closest I can come to determining this information is the Attachment object's ParentID field. But that's just the ID of the individual record, not the object type of the Parent. Is there any way to determine the object type of the Parent of the Attachment ?
attachment
I need to export all of the attachments of an org. I would like to break them down to be in a folder based upon the object type of their parent. In other words, I want all attachments which are in an Account to be in one single folder, and all of the ones in an Opportunity to be in another folder.
I've been trying to determine how the Attachments are arranged by running queries on the Attachment object in Workbench. But I believe the closest I can come to determining this information is the Attachment object's ParentID field. But that's just the ID of the individual record, not the object type of the Parent. Is there any way to determine the object type of the Parent of the Attachment ?
attachment
attachment
asked 8 hours ago
Zoom_vZoom_v
1,8503 gold badges33 silver badges70 bronze badges
1,8503 gold badges33 silver badges70 bronze badges
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
In a query, you can pull Parent.Type in your SELECT clause, or even filter on it in your WHERE clause.
SELECT Body, Parent.Type FROM Attachment
add a comment |
Quite easy, just call getsobjecttype() on that Id, and it will return API name of that object.
Id parentId= '00161000000Mjya';
System.debug('object is '+ parentId.getsobjecttype()); //Returns Account
Src: https://help.salesforce.com/articleView?id=000340200&language=en_US&type=1&mode=1
Thank you very much Pranay. I'm not quite sure how to incorporate that into my query, or my actual export. I'm going to use dataloader.io for the export, and it doesn't really have a way to filter based on that - or at least not from what I see. Any thoughts ?
– Zoom_v
7 hours ago
add a comment |
Just to add on the answer about getsobjecttype() :
You can also check this video which explains how to export attachments from salesforce using NodeJS.
You can adapt the code by adding query filter on object type and organise the file export in appropriate folder.
Hope this helps
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "459"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f270000%2fhow-to-tell-the-object-type-of-an-attachment%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
In a query, you can pull Parent.Type in your SELECT clause, or even filter on it in your WHERE clause.
SELECT Body, Parent.Type FROM Attachment
add a comment |
In a query, you can pull Parent.Type in your SELECT clause, or even filter on it in your WHERE clause.
SELECT Body, Parent.Type FROM Attachment
add a comment |
In a query, you can pull Parent.Type in your SELECT clause, or even filter on it in your WHERE clause.
SELECT Body, Parent.Type FROM Attachment
In a query, you can pull Parent.Type in your SELECT clause, or even filter on it in your WHERE clause.
SELECT Body, Parent.Type FROM Attachment
answered 5 hours ago
Adrian Larson♦Adrian Larson
114k19 gold badges131 silver badges270 bronze badges
114k19 gold badges131 silver badges270 bronze badges
add a comment |
add a comment |
Quite easy, just call getsobjecttype() on that Id, and it will return API name of that object.
Id parentId= '00161000000Mjya';
System.debug('object is '+ parentId.getsobjecttype()); //Returns Account
Src: https://help.salesforce.com/articleView?id=000340200&language=en_US&type=1&mode=1
Thank you very much Pranay. I'm not quite sure how to incorporate that into my query, or my actual export. I'm going to use dataloader.io for the export, and it doesn't really have a way to filter based on that - or at least not from what I see. Any thoughts ?
– Zoom_v
7 hours ago
add a comment |
Quite easy, just call getsobjecttype() on that Id, and it will return API name of that object.
Id parentId= '00161000000Mjya';
System.debug('object is '+ parentId.getsobjecttype()); //Returns Account
Src: https://help.salesforce.com/articleView?id=000340200&language=en_US&type=1&mode=1
Thank you very much Pranay. I'm not quite sure how to incorporate that into my query, or my actual export. I'm going to use dataloader.io for the export, and it doesn't really have a way to filter based on that - or at least not from what I see. Any thoughts ?
– Zoom_v
7 hours ago
add a comment |
Quite easy, just call getsobjecttype() on that Id, and it will return API name of that object.
Id parentId= '00161000000Mjya';
System.debug('object is '+ parentId.getsobjecttype()); //Returns Account
Src: https://help.salesforce.com/articleView?id=000340200&language=en_US&type=1&mode=1
Quite easy, just call getsobjecttype() on that Id, and it will return API name of that object.
Id parentId= '00161000000Mjya';
System.debug('object is '+ parentId.getsobjecttype()); //Returns Account
Src: https://help.salesforce.com/articleView?id=000340200&language=en_US&type=1&mode=1
answered 8 hours ago
Pranay JaiswalPranay Jaiswal
22.3k5 gold badges33 silver badges72 bronze badges
22.3k5 gold badges33 silver badges72 bronze badges
Thank you very much Pranay. I'm not quite sure how to incorporate that into my query, or my actual export. I'm going to use dataloader.io for the export, and it doesn't really have a way to filter based on that - or at least not from what I see. Any thoughts ?
– Zoom_v
7 hours ago
add a comment |
Thank you very much Pranay. I'm not quite sure how to incorporate that into my query, or my actual export. I'm going to use dataloader.io for the export, and it doesn't really have a way to filter based on that - or at least not from what I see. Any thoughts ?
– Zoom_v
7 hours ago
Thank you very much Pranay. I'm not quite sure how to incorporate that into my query, or my actual export. I'm going to use dataloader.io for the export, and it doesn't really have a way to filter based on that - or at least not from what I see. Any thoughts ?
– Zoom_v
7 hours ago
Thank you very much Pranay. I'm not quite sure how to incorporate that into my query, or my actual export. I'm going to use dataloader.io for the export, and it doesn't really have a way to filter based on that - or at least not from what I see. Any thoughts ?
– Zoom_v
7 hours ago
add a comment |
Just to add on the answer about getsobjecttype() :
You can also check this video which explains how to export attachments from salesforce using NodeJS.
You can adapt the code by adding query filter on object type and organise the file export in appropriate folder.
Hope this helps
add a comment |
Just to add on the answer about getsobjecttype() :
You can also check this video which explains how to export attachments from salesforce using NodeJS.
You can adapt the code by adding query filter on object type and organise the file export in appropriate folder.
Hope this helps
add a comment |
Just to add on the answer about getsobjecttype() :
You can also check this video which explains how to export attachments from salesforce using NodeJS.
You can adapt the code by adding query filter on object type and organise the file export in appropriate folder.
Hope this helps
Just to add on the answer about getsobjecttype() :
You can also check this video which explains how to export attachments from salesforce using NodeJS.
You can adapt the code by adding query filter on object type and organise the file export in appropriate folder.
Hope this helps
answered 5 hours ago
ShaminaShamina
766 bronze badges
766 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Salesforce Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f270000%2fhow-to-tell-the-object-type-of-an-attachment%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown