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
FSamorganFSamorgan 

How to get an API name of a SplitField

If I query a SplitField from OpportunitySplitType when I have custom split types I get a result similar to "00N80000004bFXREA2" I would like to get the API name so I can make use of this in a query on the Opportunity object.

SOQL: select SplitField from OpportunitySplitType

I would like to know how to programmatically convert '00N80000004bFXREA2' to 'Product_A__c' using either Apex or Javascript from a Vusualforce Page.
 
KaranrajKaranraj
Are you looking for the SplitTypeId field. Check this link to get the API name for the fields of OpportunitySplitType object.
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_opportunitysplit.htm
FSamorganFSamorgan
Karanraj, no SplitField is a field inside SplitType.
Create a custom SplitType and select a Custom Field in the Opportunity object.
Then do a [select SplitField from OpportunitySplitType] to see what I am talking about.