You need to sign in to do that
Don't have an account?
Opportunity Stage PickList and Recort Type
Hello,
I am Afzal from Hyderabad, India.
I am getting all the picklists and picklist values for an opportunity based on the record type id. But for SalesStage picklist, I am unable to make out which picklist value is isWon or isClosed.
Any help on this, would be appreciated. Below is the source code I've written.
DataSet dsRet = new DataSet();
if(strRecordTypeID!=null && strRecordTypeID.Trim()!=""){
DescribeLayoutResult objDLR = MY_CUSTOM_CLASS.getDescribeLayout(strSFObjectName,objSfConnection);
foreach(RecordTypeMapping objRTM in objDLR.recordTypeMappings){if(strRecordTypeID==objRTM.recordTypeId){
foreach(PicklistForRecordType objPRT in objRTM.picklistsForRecordType){
DataTable dtRet = new DataTable(objPRT.picklistName);
dtRet.Columns.Add("label");
dtRet.Columns.Add("value");foreach(PicklistEntry objPE in objPRT.picklistValues){
if(objPE.active){
DataRow newRow = dtRet.NewRow();
newRow["label"] = objPE.label;
newRow["value"] = objPE.value;
dtRet.Rows.Add(newRow);}
}
dsRet.Tables.Add(dtRet);}
}
}
}
Cheers