00001 from vyperlogix.classes.CooperativeClass import Cooperative 00002 00003 import os, sys, traceback 00004 00005 from vyperlogix import misc 00006 from vyperlogix.misc import ObjectTypeName 00007 00008 try: 00009 from cStringIO import StringIO as StringIO 00010 except: 00011 from StringIO import StringIO as StringIO 00012 00013 from vyperlogix.sf.abstract import SalesForceAbstract 00014 00015 __copyright__ = """\ 00016 (c). Copyright 1990-2008, Vyper Logix Corp., All Rights Reserved. 00017 00018 Published under Creative Commons License 00019 (http://creativecommons.org/licenses/by-nc/3.0/) 00020 restricted to non-commercial educational use only., 00021 00022 See also: http://www.VyperLogix.com and http://www.pypi.info for details. 00023 00024 THE AUTHOR VYPER LOGIX CORP DISCLAIMS ALL WARRANTIES WITH REGARD TO 00025 THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 00026 FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, 00027 INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING 00028 FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 00029 NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 00030 WITH THE USE OR PERFORMANCE OF THIS SOFTWARE ! 00031 00032 USE AT YOUR OWN RISK. 00033 """ 00034 00035 class SalesForceRecordTypes(SalesForceAbstract): 00036 def __init__(self, sfQuery): 00037 super(SalesForceRecordTypes, self).__init__(sfQuery) 00038 00039 def getRecordTypes(self): 00040 soql = "Select r.BusinessProcessId, r.Description, r.Id, r.Name, r.SobjectType from RecordType r" 00041 return self.sf_query(soql) 00042 00043 ## 00044 # rtype is one of the available case types or None to get all the types. 00045 def getCaseRecordTypes(self,rtype=None): 00046 soql = "Select r.BusinessProcessId, r.Description, r.Id, r.Name, r.SobjectType from RecordType r WHERE (r.SobjectType = 'Case')" 00047 if (rtype is not None): 00048 soql += " and (r.Name = '%s')" % (rtype) 00049 return self.sf_query(soql) 00050 00051 ## 00052 # rtype is one of the available case types or None to get all the types. 00053 def getMoltenRecordTypes(self,rtype=None): 00054 soql = "Select r.BusinessProcessId, r.Description, r.Id, r.Name, r.SobjectType from RecordType r WHERE (r.SobjectType = 'MoltenPost__c')" 00055 if (rtype is not None): 00056 soql += " and (r.Name = '%s')" % (rtype) 00057 return self.sf_query(soql) 00058 00059 ## 00060 # rtype is one of the available case types or None to get all the types. 00061 def getMoltenPostArticlesRecordTypes(self,rtype='Articles'): 00062 return self.getMoltenRecordTypes(rtype=rtype) 00063 00064 ## 00065 # rtype is one of the available case types or None to get all the types. 00066 def getMoltenTipsRecordTypes(self,rtype='Tips'): 00067 return self.getMoltenRecordTypes(rtype=rtype) 00068 00069 if __name__ == "__main__": 00070 import sys 00071 print >>sys.stdout, __copyright__ 00072 print >>sys.stderr, __copyright__ 00073 00074
© Copyright 2008-2009 Vyper Logix Corp., All Right Reserved; If you reference this document or any part of this document you must use the citation verbatim (including the link) "© Copyright 2008-2009 Vyper Logix Corp., All Right Reserved."
Notice: This source code contained in this document is NOT open source and is NOT being distributed as open source.
122,241 lines of code and growing...