Skip to main content
12 events
when toggle format what by license comment
Oct 19, 2021 at 18:18 comment added ipavlic @sfdcfox I'm trying to determine the SObjectType of a relationship name portion of a full relationship given the starting SObjectType, which I tried to describe in the question. It's as specific as it gets. I'm interested in the inverse of reading a field via get and getSObject, i.e. writing via put and putSObject, in situations when the structure does not exist yet but would be dynamically created.
Oct 19, 2021 at 18:12 comment added sfdcfox "Can I determine SObjectType Foo is referring to...?" is the question to which I responded "You can, but..." It'd be nice to know why you want to do this, the purpose behind it. Maybe there's a better way, maybe not. Seeing your other comments did help with context, but ideally, the question should be specific enough to say what you're doing, precisely how you're stuck, etc. I have several ideas in mind, but I'd like to know what you're trying to do for context.
Oct 19, 2021 at 16:30 comment added ipavlic @sfdcfox You can what specifically? It's a simple and well-defined question. If there's no nicer way, I will accept a negative response. But to discount a question based on preconceptions of what should be asked is an inverse XY problem.
Oct 19, 2021 at 16:27 vote accept ipavlic
Oct 19, 2021 at 16:27 comment added sfdcfox You can, but I agree with this being an X-Y Problem. Let's say this question was a User Story, I'd have to ask for more information before writing code that would definitively solve the requirements.
Oct 19, 2021 at 16:24 answer added Derek F timeline score: 2
Oct 19, 2021 at 16:21 history edited ipavlic CC BY-SA 4.0
added 20 characters in body
Oct 19, 2021 at 16:20 comment added ipavlic @identigral Account.Id is a plain String. My question is, knowing where the relation starts at (e.g. an Opportunity), is it possible to dynamically determine what kind of an SObject "Account" substring might refer to. I don't have an Opportunity which has Account and Id selected, nor am I interested in it. I've edited the question to make it clearer.
Oct 19, 2021 at 16:16 comment added identigral Account.Id is an Id
Oct 19, 2021 at 16:10 comment added ipavlic @identigral Id prefix is not relevant for the question, as there's no Id to work with at all.
Oct 19, 2021 at 16:02 comment added identigral Sounds like a XY problem but one way is to parse the ID prefix
Oct 19, 2021 at 15:43 history asked ipavlic CC BY-SA 4.0