Giter Site home page Giter Site logo

salesforce-beatbox's People

Contributors

alexanderdesmond avatar

Watchers

 avatar

salesforce-beatbox's Issues

Beatbox strips line feeds from returned SF Text (Long) fields

Saving is ok:

Saving an HTML text area box into a SF Text Area (long) field (via beatbox)
properly saves line endings (as verified by going into SF and seeing proper
data)

Retrieving:

Retrieving that field from SF (via beatbox) returns a string that is
stripped of all line endings.

Ideally beatbox should return line endings so that a text area form can
display that data correctly.

Original issue reported on code.google.com by [email protected] on 13 May 2008 at 12:18

AttributeError: BeatBoxXmlGenerator instance has no attribute '_out'

What steps will reproduce the problem?
1. Deploy Ubuntu 13.04.
2. Deploy and import the beatbox library.
3. Attempt to login.
4. Observe error.

What is the expected output? 
I expect to see a the login method for the client return a valid dictionary.

What do you see instead?
An error.  Something similar to the following...

  File "./script", line 52, in <module>
    svc.login('[email protected]', 'password123' + 'tokentokentoken')
  File "/any/given/path/beatbox/python_client.py", line 73, in login
    res = BaseClient.login(self, username, passwd)
  File "/any/given/path/beatbox/_beatbox.py", line 60, in login
    lr = LoginRequest(self.serverUrl, username, password).post()
  File "/any/given/path/beatbox/_beatbox.py", line 309, in post
    conn.request("POST", path, self.makeEnvelope(), headers)
  File "/any/given/path/beatbox/_beatbox.py", line 266, in makeEnvelope
    s = SoapWriter()
  File "/any/given/path/beatbox/_beatbox.py", line 243, in __init__
    self.startElement(_envNs, "Envelope")
  File "/any/given/path/beatbox/_beatbox.py", line 177, in startElement
    self.xg.startElementNS((namespace, name), name, attrs)
  File "/any/given/path/beatbox/_beatbox.py", line 146, in startElementNS
    self._out.write('<' + self.makeName(name))
AttributeError: BeatBoxXmlGenerator instance has no attribute '_out'


What version of the product are you using? 
beatbox v20.

On what operating system?
Ubuntu 13.04

Please provide any additional information below.
It looks like on Sun, 10 Feb 2013 14:29:52 +0200 (2 months ago), Serhiy 
Storchaka <[email protected]> removed the reference to the _out property of 
the XMLGenerator class.  Here is there reference:
http://hg.python.org/cpython/diff/66f92f76b2ce/Lib/xml/sax/saxutils.py#l1.71

Original issue reported on code.google.com by [email protected] on 4 May 2013 at 5:11

Unicode issue when running under Jython

What steps will reproduce the problem?
1. Install beatbox under Jython
2. Go through the usual steps to connect and login, then run a query, for 
example: svc.query('select id from contact')
3. You will get an exception:

> File 
"/home/jbrendel/Packages/jython2.5.1/Lib/site-packages/beatbox-16.1-py2.5.egg/be
atbox/xmltramp.py", line 104, in __unicode__
>     text += unicode(x)
> UnicodeDecodeError: 'ascii' codec can't decode byte 0x19 in position 9: 
ordinal not in range(128)



What is the expected output? What do you see instead?

Should: Query results. Instead: Exception.


What version of the product are you using? On what operating system?

Latest version of beatbox, Jython 2.5.1, Ubuntu 9.10


Please provide any additional information below.

Yeah, so, Jython uses Java strings internally, which have unicode handling 
built in. Therefore, often around this sort of thing you get issues.

Here's a really dumb patch I did, which seems to solve the problem (this is in 
the __unicode__() function in xmltramp.py:

    def __unicode__(self):
        text = ''
        for x in self._dir:
            try:
                text += unicode(x)
            except UnicodeDecodeError, e:
                text += x

        return ' '.join(text.split())

For some reason, I can't just do 'text += x', even under Jython (and I have no 
time to investigate why), but this here seems to do the trick, even though it 
looks very strange.

Would be great if you could put this (or a better) patch in place, so that 
official versions could contain this fix.

Original issue reported on code.google.com by [email protected] on 12 Aug 2010 at 6:46

Add 'encryptedstring' to stringtypes in beatbox/marshall.py

What steps will reproduce the problem?
1. Query a record with an encrypted field

What is the expected output? What do you see instead?
Either the decrypted or obfusated output, depending on your perms

What version of the product are you using? On what operating system?
Newest, Mac

Please provide any additional information below.

Change this line in beatbox/marshall.py:

stringtypes = ('string', 'id', 'phone', 'url', 'email',
                'anyType', 'picklist', 'reference')

to this:

stringtypes = ('string', 'id', 'phone', 'url', 'email',
                'anyType', 'picklist', 'reference','encryptedstring')

Original issue reported on code.google.com by [email protected] on 18 Aug 2010 at 12:31

typo for childRelationships within describeSObjects method

Problem:
Typo in describeSObjects method causes the data['ChildRelationships'] key to 
return empty even when childRelationships exist.

I've confirmed that changing the case for childRelationships fixes the bug; 
will probably fork this project on Github to help for my future deployments.

Location:
Lines 138-140 within beatbox.python_client

Original code:
            rawreldata = r[_tPartnerNS.ChildRelationships:]
            relinfo = [_extractChildRelInfo(cr) for cr in rawreldata]
            d['ChildRelationships'] = relinfo


Fix:
            rawreldata = r[_tPartnerNS.childRelationships:]
            relinfo = [_extractChildRelInfo(cr) for cr in rawreldata]
            d['childRelationships'] = relinfo

Original issue reported on code.google.com by [email protected] on 2 Nov 2011 at 11:36

Add support for the convertLead operation.

See attached patch. The proposed usage runs along the lines of

from beatbox import PythonClient, ConvertLead

svc = PythonClient()
# ...

svc.convertLead([ConvertLead(leadId='0000000', sendNotificationEmail=False), 
ConvertLead(leadId='0000001')])



Original issue reported on code.google.com by [email protected] on 4 Jun 2009 at 6:34

Attachments:

Salesforce API error/change on upsert

I'm not sure when this changed but the Salesforce API no longer returns
'isCreated' in the results when upsert is used, but 'created'.

The attached patch maintains the current beatbox data as well as adding the
matching 'created' result.


Original issue reported on code.google.com by [email protected] on 9 May 2008 at 12:48

Attachments:

SoapEnvelope.post() catches all exceptions

The error message given when any exception is raised while using post() is
"No response from salesforce".  This is incorrect and misleading.

To reproduce, pass a variable of type long to any create/update/upsert
call.  This exploits another bug in XmlWriter.characters.  Before applying
the attached patch the exception is "No response from salesforce" but after
you get the correct exception, "AttributeError: 'long' object has no
attribute 'replace'"

See before and after tracebacks below.

Before patch:

Traceback (most recent call last):
  File "sf_sync.py", line 85, in ?
    res.extend(svc.upsert('Avatar_Key__c', chunk))
  File
"/Users/splee/envs/langlab/lib/python2.4/site-packages/beatbox-0.9.1.1-py2.4.egg
/beatbox/python_client.py",
line 193, in upsert
  File
"/Users/splee/envs/langlab/lib/python2.4/site-packages/beatbox-0.9.1.1-py2.4.egg
/beatbox/_beatbox.py",
line 92, in upsert
  File
"/Users/splee/envs/langlab/lib/python2.4/site-packages/beatbox-0.9.1.1-py2.4.egg
/beatbox/_beatbox.py",
line 312, in post
No response from Salesforce


After patch:

Traceback (most recent call last):
  File "sf_sync.py", line 85, in ?
    res.extend(svc.upsert('Avatar_Key__c', chunk))
  File "/Users/splee/languagelab/beatbox/src/beatbox/python_client.py",
line 193, in upsert
    res = BaseClient.upsert(self, externalIdName, preparedObjects)
  File "/Users/splee/languagelab/beatbox/src/beatbox/_beatbox.py", line 92,
in upsert
    return UpsertRequest(self.__serverUrl, self.sessionId, externalIdName,
sObjects).post(self.__conn)
  File "/Users/splee/languagelab/beatbox/src/beatbox/_beatbox.py", line
302, in post
    conn.request("POST", path, self.makeEnvelope(), headers)
  File "/Users/splee/languagelab/beatbox/src/beatbox/_beatbox.py", line
272, in makeEnvelope
    self.writeBody(s)
  File "/Users/splee/languagelab/beatbox/src/beatbox/_beatbox.py", line
429, in writeBody
    self.writeSObjects(s, self.__sObjects)
  File "/Users/splee/languagelab/beatbox/src/beatbox/_beatbox.py", line
362, in writeSObjects
    self.writeSObjects(s, o, elemName)
  File "/Users/splee/languagelab/beatbox/src/beatbox/_beatbox.py", line
369, in writeSObjects
    s.writeStringElement(_sobjectNs, fn, sObjects[fn])
  File "/Users/splee/languagelab/beatbox/src/beatbox/_beatbox.py", line
179, in writeStringElement
    self.characters(value)
  File "/Users/splee/languagelab/beatbox/src/beatbox/_beatbox.py", line
199, in characters
    self.xg.characters(s)
  File
"/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/xml/sax/saxuti
ls.py",
line 153, in characters
    self._write(escape(content))
  File
"/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/xml/sax/saxuti
ls.py",
line 39, in escape
    data = data.replace("&", "&amp;")
AttributeError: 'long' object has no attribute 'replace'


Original issue reported on code.google.com by [email protected] on 9 May 2008 at 12:35

Attachments:

Does not marshall time fields correctly

What steps will reproduce the problem?
1. Query a Case with a time field from BusinessHours (ie 
BusinessHours.MondayStartTime)
2. Will fail during .query call

What is the expected output? What do you see instead?
The data marshalled into a datetime.time

Original issue reported on code.google.com by [email protected] on 11 Sep 2013 at 3:18

PythonClient.upsert looks for nonexistant 'isCreated' element in Salesforce response

What steps will reproduce the problem?

1. Create a custom external ID field on Leads (I used 'External_ID__c') in 
Salesforce.
2. Run the following:
>>> svc = beatbox.PythonClient()
>>> svc.login(...)
>>> data = {
...     'type': u'Lead',
...     'FirstName': u'Upsert',
...     'LastName': u'Test',
...     'External_ID__c': 666
... }
>>> svc.upsert('External_ID__c', data)

3. Recieve traceback:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/owen/Library/Python/2.6/site-packages/beatbox-0.10-
py2.6.egg/beatbox/python_client.py", line 207, in upsert
    d['isCreated'] = _bool(r[_tPartnerNS.isCreated])
  File "/Users/owen/Library/Python/2.6/site-packages/beatbox-0.10-
py2.6.egg/beatbox/xmltramp.py", line 143, in __getitem__
    raise KeyError
KeyError

The upsert operation completes successfully.

Using XMLClient, it's possible to see that the the upsert reply looks like

<result xmlns="urn:partner.soap.sforce.com" 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <created>false</created>
  <errors xsi:nil="true"></errors>
  <id>00Q8000000PnO4VEAV</id>
  <success>true</success>
</result>

however, PythonClient's XML translation is looking for
            d['isCreated'] = _bool(r[_tPartnerNS.isCreated])


Original issue reported on code.google.com by [email protected] on 12 May 2009 at 7:05

PythonClient: inlineHelpText missing from field dictionary in describeSObjects

What steps will reproduce the problem?
1. Query sobject with describeSObjects 
2. View Field class for field that has help text configured
3. Help text is missing from field although it is sent via API as 
inlineHelpText

What is the expected output? What do you see instead?

Help text not present.


Please use labels and text to provide additional information.

Add the below to line 412 of python_client.py:

    try:
        data['inlineHelpText'] = str(fdata[_tPartnerNS.inlineHelpText])
    except KeyError:
        data['inlineHelpText'] = ''



Original issue reported on code.google.com by [email protected] on 15 Mar 2010 at 10:34

Add support for using default assignment rule during objection creation (patch attached)

What steps will reproduce the problem?
1. Create a Case through beatbox in an org with assignment rules configured to 
assign the Case to a user other than the creator
2. Verify that the assignment rules did not run and the Case is still owned by 
the creator


What is the expected output? What do you see instead?
1. In most circumstances I've seen in my experience, records created through 
the API should be processed through the assignment rules (which is not the 
default). Even if it's not the majority of the cases, the SFDC API supports a 
header option to decide whether to execute default assignment rules during 
object creation. This option should be exposed through beatbox.

What version of the product are you using? On what operating system?
rev93, all

Please provide any additional information below.
See patch

Original issue reported on code.google.com by [email protected] on 1 Oct 2013 at 5:43

Attachments:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.