Unable to update records?

73 views
Skip to first unread message

Jeff Douglas

unread,
Nov 14, 2011, 8:28:01 AM11/14/11
to activesa...@googlegroups.com
I'm unable to update records using the gem and I'm wondering if I'm doing something wrong? I can query, find, create, etc with no problem, just cannot update.

I've tried:

client.update("Facility__c", params[:id], {"Name" => "My New Name"})

and

client.materialize("Facility__c")
fac = Facility__c.find(params[:id])
fac.Name = params["Name"]
fac.save

Each time it returns a 500 error with the code below.

I'm using a database.com org and the gemfile states databasedotcom (1.1.4).

Also, is there an example app somewhere with code for reference?


Databasedotcom::SalesForceError (<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <head>
 </head>
 <body>
  <center>
   <table bgcolor="white" style="align: center;">
    <tbody>
     <tr><td><br><br></td></tr>
     <tr>

      <td>
       <table bgcolor="white" cellpadding="0" cellspacing="0" style="border:1px solid #ccc;" width="758">
        <tbody>
         <tr><td><br></td></tr>
         <tr>
          <td>
           <div style="background-color: white; border: 1px solid #ccc; padding: 0px; margin-top: 10px; margin-bottom: 0px; margin-left: 10px; margin-right: 10px;">
            <table bgcolor="white" cellpadding="0" cellspacing="0" width="758">
             <tbody>

              <tr>
               <td><span style="font-family: Verdana; font-size: medium; font-weight: bold;">We are down for maintenance.</span><br><br>Sorry for the inconvenience. We'll be back shortly.</td>
              </tr>
             </tbody>
            </table>
           </div>

          </td>
         </tr>
         <tr>
          <td>
           <span>
            <table border="0" cellpadding="0" cellspacing="0" style="text-align: right;" width="100%">
             <tbody>
              <tr>
               <td>

                <span>
                 <span style="font-family: Verdana; font-size: smaller">Powered by <a href="http://force.com">force.com</a></span>
                </span>
               </td>
              </tr>
             </tbody>
            </table>

           </span>
          </td>
         </tr>
        </tbody>
       </table>      
      </td>
     </tr>
     <tr><td><br></td></tr>
     <tr><td></td></tr>

     <tr><td><br></td></tr>
    </tbody>
   </table>
  </center>
  <!--  Served by force.com -->
 </body>
</html> 
<!-- Generated Mon, 14 Nov 2011 12:35:00 GMT by proxy1 (squid/2.7.STABLE9) --> 
):

Thanks!

Jeff Douglas
google voice: (941) 227-4843
mobile: (941) 809-3455
email: je...@appirio.com
blog: http://blog.jeffdouglas.com



Appirio, Inc. 
Accelerating On-Demand in the Enterprise
http://www.appirio.com


Jeff Douglas

unread,
Nov 14, 2011, 8:33:52 AM11/14/11
to activesa...@googlegroups.com
I just upgraded to 1.2.4 with no love.


Thanks!

Jeff Douglas
google voice: (941) 227-4843
mobile: (941) 809-3455
email: je...@appirio.com
blog: http://blog.jeffdouglas.com



Appirio, Inc. 
Accelerating On-Demand in the Enterprise
http://www.appirio.com




Danny Burkes

unread,
Nov 14, 2011, 3:19:52 PM11/14/11
to activesa...@googlegroups.com
"We are down for maintenance" seems to say, well, they are down for maintenance.  Have you contacted Salesforce support about this, to see if it's a known issue?

- D

--
You received this message because you are subscribed to the Google Groups "ActiveSalesforce" group.
To post to this group, send email to activesa...@googlegroups.com.
To unsubscribe from this group, send email to activesalesfor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/activesalesforce?hl=en.

Jeff Douglas

unread,
Nov 14, 2011, 3:25:20 PM11/14/11
to activesa...@googlegroups.com
That's the problem... the org is NOT down for maintenance. I can create new records, query existing ones, login through the salesforce.com UI, etc. The only thing I can't do is update a record.

Does the code look wrong? Are there any example app that I can look at?


Thanks!

Jeff Douglas
google voice: (941) 227-4843
mobile: (941) 809-3455
email: je...@appirio.com
blog: http://blog.jeffdouglas.com



Appirio, Inc. 
Accelerating On-Demand in the Enterprise
http://www.appirio.com




Frank McGeough

unread,
Nov 14, 2011, 3:47:55 PM11/14/11
to activesa...@googlegroups.com
Do you get a similar result from using upsert instead of update? 

Jeff Douglas

unread,
Nov 14, 2011, 4:01:20 PM11/14/11
to activesa...@googlegroups.com
What's the upsert syntax? Can't seem to get it right?

client.materialize("Contact")
c = Contact.find(params[:id])
c.upsert("Name",'Some_Value)

Thanks!

Jeff Douglas
google voice: (941) 227-4843
mobile: (941) 809-3455
email: je...@appirio.com
blog: http://blog.jeffdouglas.com



Appirio, Inc. 
Accelerating On-Demand in the Enterprise
http://www.appirio.com




Frank McGeough

unread,
Nov 14, 2011, 4:08:24 PM11/14/11
to activesa...@googlegroups.com
client.upsert("Contact", "your_id_name", "your_id_value", attrs)

where attrs is the Hash.new of what you are trying to upsert. 

Jeff Douglas

unread,
Nov 14, 2011, 4:21:43 PM11/14/11
to activesa...@googlegroups.com
Yeah... I get the same 500 error with: 

client.upsert("Location__c", "Id", params[:id], {"Name" => "Some new name"})

The records updates fine using SoqlXplorer with the same user so it's nothing with permissions. 

Thanks!

Jeff Douglas
google voice: (941) 227-4843
mobile: (941) 809-3455
email: je...@appirio.com
blog: http://blog.jeffdouglas.com



Appirio, Inc. 
Accelerating On-Demand in the Enterprise
http://www.appirio.com




Frank McGeough

unread,
Nov 14, 2011, 4:27:14 PM11/14/11
to activesa...@googlegroups.com
OK. Do you get anything of interest if you turn on debugging so you see the complete details from salesforce.com
Pass in :debugging => true when doing the Databasedotcom::Client.new 

Jeff Douglas

unread,
Nov 14, 2011, 4:38:20 PM11/14/11
to activesa...@googlegroups.com
Frank,

I've attached the dump from the console. 

Thanks for the help!

Jeff Douglas
google voice: (941) 227-4843
mobile: (941) 809-3455
email: je...@appirio.com
blog: http://blog.jeffdouglas.com



Appirio, Inc. 
Accelerating On-Demand in the Enterprise
http://www.appirio.com




debug.txt

Frank McGeough

unread,
Nov 14, 2011, 5:15:35 PM11/14/11
to activesa...@googlegroups.com
Apologies. I misled you on the use of upsert. I didn't realize that you were using Id (I think I was too lazy to actually read through your email). Sorry. To use upsert you have to have an external id (some unique identifier other than Id). But the error is interesting. I don't know why it would give a 500 error (for either the upsert - even if its in the wrong form - or the update or for your save call - which look perfectly fine to me). The debug log looks like its definitely going to the right URL. I just don't know. I'll think some more on this on the train going home. 

<debug.txt>

Adrian Martínez

unread,
Apr 4, 2012, 8:30:30 PM4/4/12
to activesa...@googlegroups.com
Were you able to find a solution for this? I've been having trouble with this same issue the last couple of days and haven't been able to find a solution. I've tried with client.update, object.update_attributes and object.save without any luck. I also tried using different hashes in the parameters, using less attributes each time but also didn't work.

Adrian Martínez

unread,
Apr 4, 2012, 8:35:56 PM4/4/12
to activesa...@googlegroups.com
Where you able to find a solution for this? I've been having trouble with this same issue for the last couple of days. I tried with client.update, object.update_attributes and object.save with no luck. I also tried changing the hash sent as parameter, reducing the amount of attributes to update, but also didn't work.

On Monday, November 14, 2011 7:28:01 AM UTC-6, jeffdonthemic wrote:
> I&#39;m unable to update records using the gem and I&#39;m wondering if I&#39;m doing something wrong? I can query, find, create, etc with no problem, just cannot update.</div>
>
> </div>
> I&#39;ve tried:</div>
>
>
> </div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
> client.update(&quot;Facility__c&quot;, params[:id], {&quot;Name&quot; =&gt; &quot;My New Name&quot;})</blockquote>
>
> </div>
> and</div>
>
> </div>
> <blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
> client.materialize(&quot;Facility__<WBR>c&quot;)
> fac = Facility__c.find(params[:id])
> fac.Name = params[&quot;Name&quot;]
> fac.save</blockquote></div>
>
> </div>
> Each time it returns a 500 error with the code below.</div>
>
>
> </div>I&#39;m using a <a href="http://database.com" target="_blank">database.com</a> org and the gemfile states databasedotcom (1.1.4).
>
> </div>
> Also, is there an example app somewhere with code for reference?</div>
>
>
> </div>
>
> </div>
>
> <font face="&#39;times new roman&#39;, serif">Databasedotcom::<WBR>SalesForceError (&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;<a href="http://www.w3.org/TR/html4/loose.dtd" target="_blank">http://www.w3.org/TR/html4/<WBR>loose.dtd</a>&quot;&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">&lt;html xmlns=&quot;<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/<WBR>xhtml</a>&quot;&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif"> &lt;head&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif"> &lt;/head&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif"> &lt;body&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">  &lt;center&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">   &lt;table bgcolor=&quot;white&quot; style=&quot;align: center;&quot;&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">    &lt;tbody&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">     &lt;tr&gt;&lt;td&gt;&lt;br&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">     &lt;tr&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">
> </font></div>
> <font face="&#39;times new roman&#39;, serif">      &lt;td&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">       &lt;table bgcolor=&quot;white&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border:1px solid #ccc;&quot; width=&quot;758&quot;&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">        &lt;tbody&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">         &lt;tr&gt;&lt;td&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">         &lt;tr&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">          &lt;td&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">           &lt;div style=&quot;background-color: white; border: 1px solid #ccc; padding: 0px; margin-top: 10px; margin-bottom: 0px; margin-left: 10px; margin-right: 10px;&quot;&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">            &lt;table bgcolor=&quot;white&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;758&quot;&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">             &lt;tbody&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">
> </font></div>
> <font face="&#39;times new roman&#39;, serif">              &lt;tr&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">               &lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: medium; font-weight: bold;&quot;&gt;We are down for maintenance.&lt;/span&gt;&lt;br&gt;&lt;br&gt;<WBR>Sorry for the inconvenience. We&#39;ll be back shortly.&lt;/td&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">              &lt;/tr&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">             &lt;/tbody&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">            &lt;/table&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">           &lt;/div&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">
> </font></div>
> <font face="&#39;times new roman&#39;, serif">          &lt;/td&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">         &lt;/tr&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">         &lt;tr&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">          &lt;td&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">           &lt;span&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">            &lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;text-align: right;&quot; width=&quot;100%&quot;&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">             &lt;tbody&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">              &lt;tr&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">               &lt;td&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">
> </font></div>
> <font face="&#39;times new roman&#39;, serif">                &lt;span&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">                 &lt;span style=&quot;font-family: Verdana; font-size: smaller&quot;&gt;Powered by &lt;a href=&quot;<a href="http://force.com" target="_blank">http://force.com</a>&quot;&gt;<a href="http://force.com" target="_blank">force.<WBR>com</a>&lt;/a&gt;&lt;/span&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">                &lt;/span&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">               &lt;/td&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">              &lt;/tr&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">             &lt;/tbody&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">            &lt;/table&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">
> </font></div>
> <font face="&#39;times new roman&#39;, serif">           &lt;/span&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">          &lt;/td&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">         &lt;/tr&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">        &lt;/tbody&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">       &lt;/table&gt;      </font></div>
>
> <font face="&#39;times new roman&#39;, serif">      &lt;/td&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">     &lt;/tr&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">     &lt;tr&gt;&lt;td&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">     &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">
> </font></div>
>
> <font face="&#39;times new roman&#39;, serif">     &lt;tr&gt;&lt;td&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">    &lt;/tbody&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif">   &lt;/table&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">  &lt;/center&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">  &lt;!--  Served by <a href="http://force.com" target="_blank">force.com</a> --&gt;</font></div>
>
> <font face="&#39;times new roman&#39;, serif"> &lt;/body&gt;</font></div>
> <font face="&#39;times new roman&#39;, serif">&lt;/html&gt; </font></div>
> <font face="&#39;times new roman&#39;, serif">&lt;!-- Generated Mon, 14 Nov 2011 12:35:00 GMT by proxy1 (squid/2.7.STABLE9) --&gt; </font></div>
>
> <font face="&#39;times new roman&#39;, serif">):</font></div>
> Thanks!
>
> Jeff Douglas
> google voice: (941) 227-4843
> mobile: (941) 809-3455
> email: <a href="mailto:je...@appirio.com" target="_blank">je...@appirio.com</a>
>
> blog: <a href="http://blog.jeffdouglas.com/" target="_blank">http://blog.jeffdouglas.<WBR>com</a></div>
>
> </div>
> <a href="http://www.cloudspokes.com" target="_blank"><img width="420" height="96" origsrc="http://www.appirio.com/EmailImages/EmailSigCloudSpokes.jpg"></a><span></span><span></span><a></a>
>
>
>
> </div>
> <a href="http://blog.jeffdouglas.com/" target="_blank"></a>Appirio, Inc. 
> Accelerating On-Demand in the Enterprise
> <a href="http://www.appirio.com/" target="_blank">http://www.appirio.com</a>
>
> </div>
>
> </div>
> Author: <a href="http://www.lulu.com/spotlight/salesforcehandbook" target="_blank">Salesforce Handbook</a> &amp; <a href="http://apress.com/book/view/9781430225539" target="_blank">Beginning Java Google App Engine</a></div>
> </div>
>
> </div>

Mason Jones

unread,
Apr 16, 2012, 11:53:58 AM4/16/12
to activesa...@googlegroups.com
Can you post some of your code that's apparently not updating the
objects? And have you set "debugging: true" in your databasedotcom.yml
file and watched the log to see if anything shows up? As a debugging
method, I'd suggest going into irb/console, setting debugging to true,
and manually going through an object query and then update and
watching the log to see what it's doing.


On Wed, Apr 4, 2012 at 5:30 PM, Adrian Martínez <aku...@gmail.com> wrote:
> Were you able to find a solution for this? I've been having trouble with this same issue the last couple of days and haven't been able to find a solution. I've tried with client.update, object.update_attributes and object.save without any luck. I also tried using different hashes in the parameters, using less attributes each time but also didn't work.
>

> --
> You received this message because you are subscribed to the Google Groups "ActiveSalesforce" group.

> To view this discussion on the web visit https://groups.google.com/d/msg/activesalesforce/-/76yKFHu0CKwJ.

Reply all
Reply to author
Forward
0 new messages