You need to sign in to do that
Don't have an account?
Vishal Gaddi6
PHP Integration
Hey Everyone !!!
Can we create Custom Object via PHP Script ??
Not Records, I want to create a new Custom Object into my Salesforce Database via PHp Script....
You're right - the docs are a bit sparse on the PHP Metadata Client. Here is some sample code to create a custom object and a custom field on that object. Note that you will need to get the very latest PHP toolkit from https://github.com/developerforce/Force.com-Toolkit-for-PHP since I fixed a bug in creating custom fields just a few minutes ago.
All Answers
Yes. You cn do that. Check out Metadata API documentation.
But all the sample codes available are in Java. However i need them in PHP only which i could not find anywhere.....
You're right - the docs are a bit sparse on the PHP Metadata Client. Here is some sample code to create a custom object and a custom field on that object. Note that you will need to get the very latest PHP toolkit from https://github.com/developerforce/Force.com-Toolkit-for-PHP since I fixed a bug in creating custom fields just a few minutes ago.
Hey Pat !!
Thanx for the code. Its really helpful and working fine.....
But i dont know y m getting following Message :
Strict Standards: Creating default object from empty value in C:\xampp\htdocs\Connection\soapclient\SforceMetadataClient.php on line 121
Just a little tweak required to make that file E_STRICT compliant... Grab it from GitHub again - I just fixed it - should be no warnings now :-)
Cheers,
Pat
Hey Pat
Thanx again...
Can you refer me any artical or documentaion which tells the properties to be set while creating a Custom Field of different types ??
Like for Type 'Text', we simple need following properties:
setLenght();
i am facing some problem in inserting an Custom Field of type 'Number as i dont know the function of setting 'Decimal Places' becoz its a required field.
Thanx in advance
Custom fields are described at http://www.salesforce.com/us/developer/docs/api_meta/Content/customfield.htm - you should be able to figure out the SetXXX() calls - for Number you'll need setPrecision() and setScale() - like this:
Cheers,
Pat
Hey Pat !!!
Thts Wonderful.... Thanx a lot...
But i think Salesforce should provide a artical with details for each Field Type i.e. which properties are needed to be set with each Type... it would be more helpful... if its already there, then do let me know.....;-)
Regards
Vishal
HI,
You can find the Basic Tutorials about PHP and Salesforce Implementation using Below URL
http://theblogreaders.com/integration-between-salesforce-and-php
TheBlogreaders.com
Blog | Salesforce Certified Administrator | Salesforce Certified Developer