This is a discussion on Using String or float on Numeric Fields in Salesrforce with PHP within the Salesforce Coding Discussions forums, part of the Salesforce category; I was working on this script over the past few days and
Using String or float on Numeric Fields in Salesrforce with PHP
I was working on this script over the past few days and in my orginal tutorial none of the fields that I supplied used or discussed any NUMERIC fields. I added two numeric fields to test the extraction process and I could not get the local array that I had created to be populated with the data coming in from the object from salesforce. This is just related to developers that are working with MySQL!
My orginal tutorial, http://www.mikesimonds.com/salesforc...cript-t41.html, did not have any numeric fields to work with, therefore I did not take this into consideration. For that I am sorry. So in order to work with numeric fields, such as currency, from salesforce.com, here is what worked for me:
the array > $pass_this was not being populated from the $r->fields object and it really threw me for a loop. I could not figure out why the fields were not being passed and it really started to get on my nerve. Then I remember that sometimes you have to tell PHP to cast variables to treat them a specific way. Look at my new php snippet:
By using the (string) function or cast, this makes PHP treat the object or variable as a string and then the value will pass to the array. You can also use (float) if you want to pass these values as a numeric field with decimals.
Here is a full example with a complete array being passed from $r to $pass_this (see attached)
Bookmarks