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
brooksbrooks 

.php in Documents . . .

Tran,

Is it possible to store a .php script in the Documents object and have it communicate with other objects through the API?

Thanks.
Tran ManTran Man
Unfortunately, no.  PHP is a server-side language.  You need a web server that can execute PHP scripts.  You can of course access PHP scripts outside of Salesforce via S-Controls or do a straight web-link.
brooksbrooks
Yes, I was hoping (beyond hope) that there was a way to execute the script from within Salesforce.com.

Know of any way to reach out from Salesfore.com on a regular schedule and activate a .php script? sControls can reach out, but there's not way to schedule them, right? They have to be triggered.

I know the .php script can be automated, but I want to do it from the Salesforce.com side.

Any ideas are appreciated.




Tran ManTran Man
Can you give an example of what the PHP script would do?
brooksbrooks
Sure, it's basic. I want the .php script to update documents in the Documents object with data from another object like Leads. It's fine if the .php script lives externally, but I want to initiate that regular "refresh" from within Salesforce.com.
Tran ManTran Man
Let me see if I understand this correctly:  do you want to schedule this to happen automatically at some time interval but also have the capability to initiate this process manually from within salesforce?
brooksbrooks
No, I want it to happen automatically at some time interval, and that's all.

That is, I want a script in my Salesforce.com account to wakeup every, say, 3 hours and prompt a .php script living on a server somewhere to login and perform an object to object update.
Tran ManTran Man
I would use a scheduler or cron to execute the PHP script outside of Salesforce.com.  It doesn't seem like the use case require UI interaction.


brooks wrote:
No, I want it to happen automatically at some time interval, and that's all.

That is, I want a script in my Salesforce.com account to wakeup every, say, 3 hours and prompt a .php script living on a server somewhere to login and perform an object to object update.



brooksbrooks
Right, well the reason I don't want to schedule the .php script to do it is because this needs to work with more than one Salesforce.com account.

So I thought perhaps if some kind of script in each of the Salesforce.com accounts could prompt a .php script to run and tell it where it was, then the .php script could do the rest.

Is there any scheduler or cron equivalent in a Salesforce.com account?
SuperfellSuperfell
Nope, no cron/schedular inside of salesforce.com
Tran ManTran Man


brooks wrote:
Right, well the reason I don't want to schedule the .php script to do it is because this needs to work with more than one Salesforce.com account.

So I thought perhaps if some kind of script in each of the Salesforce.com accounts could prompt a .php script to run and tell it where it was, then the .php script could do the rest.

Is there any scheduler or cron equivalent in a Salesforce.com account?


Two suggestsions:
(1) Instantate a connection for each Salesforce.com account in the script
(2) Have a PHP function that takes in a Salesforce.com username/pass as parameters and pass those using a scheduler.

Message Edited by Tran Man on 05-05-2006 03:51 PM

SynchroSynchro
I get what you're asking for, but you can't do it. The closest you can get to running 'within' salesforce is javascript, and that's no use for your application.

It sounds like you're relying on salesforce 'knowing' that it's allowed to call this script and update stuff, which by implication makes it sound like you're not storing sf account info on the server your script runs on. That in turn sounds like a security problem to me. Any legitimate user of your script could discover the obscure URL and use it as an attack vector against other accounts (i.e. if you called me then I must be allowed to do this to your account).

You need to turn it around. If you need to update multiple accounts just store the sets of login info on your remote server and schedule it as usual from there.
brooksbrooks
Thanks Nick, Synchro, and Simon for your comments.