Created
February 12, 2013 18:39
-
-
Save dancinllama/4772135 to your computer and use it in GitHub Desktop.
Method for retrieving managed package prefix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description determines the namespace prefix of the managed package | |
*/ | |
public static String getNamespacePrefix(DescribeFieldResult fr){ | |
String prefix = null; | |
String fieldName = fr.getName(); | |
String localname = fr.getLocalName(); | |
Integer idx = fieldName.indexOf(localname); | |
if(idx > 0){ | |
prefix = fieldName.substring(0,idx); | |
} | |
return prefix; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment