0% found this document useful (0 votes)
49 views

Recursive Function To Access Parent

The code defines a map to store child and parent geography classification IDs, populates the map by querying for classifications and their parents, and recursively calls a method to return the parent ID.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

Recursive Function To Access Parent

The code defines a map to store child and parent geography classification IDs, populates the map by querying for classifications and their parents, and recursively calls a method to return the parent ID.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Map<Id, Id> mapGC = new Map<Id, Id>();

List<Geography_Classification__c> listGC = [select id,


Parent_Geography_Classification__c from Geography_Classification__c];

if (listGC != null && listGC.size() > 0)


{
for (Geography_Classification__c gc : listGC)
{
mapGC.put(gc.Id, gc.Parent_Geography_Classification__c);
}
}

public void returnParent(Id paramId)


{
if (mapGC.containsKey(paramId))
{
Id idPGC = mapGC.get(paramID);
system.debug('id... ' + idPGC);

returnParent(idPGC);
}
}

returnParent('a11j0000003nftaAAA');

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy