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
If an arcane trickster rogue uses his mage hand and makes it invisible, does that mean anything the hand picks up is also invisible?
What's the differences between the two version of oracle client download file, "client" and "client home"?
Exploiting the delay when a festival ticket is scanned
Why did some Apollo missions carry a grenade launcher?
What did G-d do before Creation?
Compound Word Neologism
Going from a circuit to the quantum state output of the circuit
Why force the nose of 737 Max down in the first place?
Telling manager project isn't worth the effort?
Does dual boot harm a laptop battery or reduce its life?
What language is Raven using for her attack in the new 52?
Why is it considered acid rain with pH <5.6?
Struggling with cyclical dependancies in unit tests
Spacing after a tikz figure
Introducing Tetronogram!
Desktop app status bar: Notification vs error message
Why didn’t Christianity spread southwards from Ethiopia in the Middle Ages?
How likely is fragmentation on a table with 40000 products likely to affect performance
Do 3/8 (37.5%) of Quadratics Have No x-Intercepts?
Anti-cheating: should there be a limit to a number of toilet breaks per game per player?
What happens when a flying sword is killed?
Japanese reading of an integer
Irreducible factors of primitive permutation group representation
Must a song using the A minor scale begin or end with an Am chord? If not, how can I tell what the scale is?
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 Jul 18 at 14:55
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
Jul 18 at 15:24
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 Jul 18 at 17:19
Adrian Larson♦Adrian Larson
115k19 gold badges133 silver badges272 bronze badges
115k19 gold badges133 silver badges272 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
Jul 18 at 15:24
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
Jul 18 at 15:24
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 Jul 18 at 15:01
Pranay JaiswalPranay Jaiswal
22.8k5 gold badges33 silver badges74 bronze badges
22.8k5 gold badges33 silver badges74 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
Jul 18 at 15:24
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
Jul 18 at 15:24
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
Jul 18 at 15:24
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
Jul 18 at 15:24
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 Jul 18 at 17:14
ShaminaShamina
1411 silver badge7 bronze badges
1411 silver badge7 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