def bajadaSFDC(a,ll): my_sf = salesforce_reporting.Connection(llaves[0],llaves[1],llaves[2]) print("Conectado con exito a SFDC.") print("http://eu5.salesforce.com/" + llaves[3]) try: SFSF=requests.get("https://eu5.salesforce.com/" + str(llaves[3])) except Exception, e: print e + (":: No funcionó la request.")
username=(config['user']['username']), password=(config['user']['password']), security_token=(config['user']['salesforce_token'])) print(session_id) # Options options = Options() options.add_argument("--headless") pd.set_option('display.max_rows', None) # System Variables today = date.today() date = today.strftime("%m/%d/%Y") node = platform.node() system = platform.system() username = getpass.getuser() version = platform.version() my_sf = salesforce_reporting.Connection((config['user']['username']), (config['user']['password']), (config['user']['salesforce_token'])) with open('reports.json', 'r') as f: config = json.load(f) report = my_sf.get_report((config['report']['all_cases'])) parser = salesforce_reporting.ReportParser(report) report_final = pd.DataFrame(parser.records()) print(report_final)
from simple_salesforce import Salesforce import salesforce_reporting import requests, json from flask import jsonify from SFDC import dbmodels sf = Salesforce(username='', password='', security_token='3GKZny4jRWggQ') analytic_sf = salesforce_reporting.Connection( '3MVG99OxTyEMCQ3glBkdKh4SE2HJs4uODXEl2Fux.LFlCzqkgs9Tr8XLqmCvUsOSdsVpbGoj9xhN5f4hpJ2OZ', '86072956447270870', 'cgenx.com', 'passKhggQ', 'na13') report = analytic_sf.get_report('00Oa0000008uK2BEAU', filters=None, details=True) parser = salesforce_reporting.ReportParser(report) dict = parser.records() class Opportunity(): def __int__(self, AccountId, Amount, CloseDate, OwnerId, FiscalYear, CreatedById): self.AccountId = AccountId, self.Amount = Amount, self.CloseDate = CloseDate, self.OwnerId = OwnerId, self.FiscalYear = FiscalYear, self.CreatedById = CreatedById, def Load(self): try: #list=sf.query("SELECT AccountId,Amount,CloseDate,OwnerId,FiscalYear,CreatedById FROM Opportunity ") #sf = Salesforce(username='******', password='******', security_token='3GKZny4jRWgmXNUmvFjzKhggQ')
from sqlalchemy import sql, create_engine, text engine = create_engine('mssql+pymssql://sysdba:[email protected]:1433/ESIDB') from simple_salesforce import Salesforce import salesforce_reporting import requests, json from flask import jsonify sf = Salesforce(username='******', password='******', security_token='3GKZny4jRWgmXNUmvFjzKhggQ') analytic_sf = salesforce_reporting.Connection( '3MVG99OxTyEMCQ3glBkdKh4SE2HJs4uODXEl2Fux.LFlCzqkgs9Tr8XLqmCvUsOSdsVpbGoj9xhN5f4hpJ2OZ', '86072956447270870', '*****@*****.**', 'password123453GKZny4jRWgmXNUmvFjzKhggQ', 'na13') try: mydict = sf.Solution.create({ 'SolutionNote': 'testALM', 'SolutionName': 'testALM' }) except Exception as e: print(str(e)) # def FillSFDC7(*mydict): # try: # with engine.connect() as con: # dict=mydict[0] # val=dict.values() # key=dict.keys() # rs = con.execute('INSERT INTO [SFDC7]([Sales Order Number] )' # 'values('+ val[0] +')') # con.close()
def bajadaSFDC(a,ll): my_sf = salesforce_reporting.Connection(llaves[0],llaves[1],llaves[2]) print("Conectado con exito a SFDC.") print("http://eu5.salesforce.com/" + llaves[3]) try: SFSF=requests.get("https://eu5.salesforce.com/" + str(llaves[3])) except Exception, e: print e + (":: No funcionó la request.") my_sf = salesforce_reporting.Connection(llaves[0],llaves[1],llaves[2]) report= my_sf.get_report(llaves[3]) ### ACA VER print(report) parser = salesforce_reporting.ReportParser(report) parsed=parser.records() labels=parser._get_field_labels() parsedlabels=[str(labels[x]) for x in range(len(labels))] print(parsed) print('''\n\n\n''') print('''\n\n\n''') TABLA=pandas.DataFrame(parsed) TABLA.columns = (parsedlabels)
import pysolr from simple_salesforce import Salesforce import salesforce_reporting import requests, json from flask import jsonify from SFDC import dbmodels solr = pysolr.Solr('http://*****:*****@integenx.com', 'integenx1nqVHADdVuTvNqv7Cgg4FaNqPj', 'na13') report = analytic_sf.get_report('00Oa0000008uK2BEAU', filters=None, details=True) parser = salesforce_reporting.ReportParser(report) dict = parser.records() class Opportunity(): def __int__(self, AccountId, Amount, CloseDate, OwnerId, FiscalYear, CreatedById): self.AccountId = AccountId, self.Amount = Amount, self.CloseDate = CloseDate, self.OwnerId = OwnerId,