function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sunny NarulaSunny Narula 

how to update custom picklist values from PHP(Website) to Salesforce

I need to update custom picklist values ( for custom field on Product2 ) from PHP(Website) to Salesforce

I can update data (i.e. records)

but is their a way to update THE VALUES IN THE PICKLIST ITSELF FROM the website, as I have the connection establish ann I can access SDFC from my website.

Thanks in advance
Sunny
Pavan DavePavan Dave
Web Services Call can be an option.
Callout a web service on your VF page load and it will get the picklist values from your website.
Sunny NarulaSunny Narula

Hi Pavan,
it's a standard object (Product2) having a custom picklist..
creating a webservice and making callout every time the VF page loads can create problem in long run as the org has many users and I m afraid that it might hit the governer limits...and the process for getting values from the website can slow down the application too..

Is their a way to update the values in the Picklist itself from PHP, as we update records back to saleforce..
 

Sunny

Pavan DavePavan Dave
Other option would be updating picklist's Metadata.
But still that would be done by Web Service call and there you can write a scheduler which runs 5 or N number of times in a day and update the picklist metadata.
Sunny NarulaSunny Narula

@Pavan

That would work..

Please can I get any example or links to proceed for the second option...

Pavan DavePavan Dave
Just found:
The following custom field types aren’t available for external objects.
Auto-number
Currency
Formula
Geolocation
Master-detail relationship
Picklist
Picklist (multi-select)
Text (encrypted)
Text Area (rich)

So now you need to popule piclist from a Custom Setting and update custom setting data from Web Service.
Sunny NarulaSunny Narula

@Pavan

Please can I get a links or a way to proceed for the same...

I think I need to write a Webservice in Apex that can we called from PHP website that will pass the picklist values to updated in salesforce, then this Apex Webservice will update the metadata.. We can call the webservice only when the values are added to th picklist in website.

Please can I get the way to update the metadata this way.....

any links or example to proceed with will be very helpful...

Pavan DavePavan Dave
You may need to follow below steps:
Thanks,
Pavan