• TheDevLife
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 6
    Replies
Hello,

I'm designing an application for SalesForce. I need to communicate to some other server, from this application (Apex Code, not external using SOAP, etc.)

I have two things in my mind:
a) Apex Code connects to other server. But I think that Apex doesn't have this capabilities (searching for TCP, etc. in documentations doesn't show me anything)

b) Use some Javascript code in client side who will connect to exterior.

For my purposes "b" is enough, if Javascript allows it :) (because security reasons and so on, but I can change users settings).

Am I forgetting to study some other option?

Thank you very much,

Carles
  • October 10, 2007
  • Like
  • 0

I am trying to create multiple entries from single entry, let me explain.

On the opportunities tab, we have four custom text boxes, one for each product the customer is requesting a price for.   I have created a custom object called "pricing" that allows our users run the pricing model for each product.  What I would like to b able to do is either, 1- on pressing the save button on the opportunities, automatically create four “pricing” entries, one for each product on the opportunity in the “Pricing” object or 2-create a customer button on the opportunity object that would do the afore mentioned.

Any ideas on where to start?

Thx

tmbarry

Hi All,
 
I have created a button and on click of this i am trying to save a .txt file in to my local machine. PFB the code. But when i execute this, i am getting the following error.
Error: Number:-2146827859 Description:Automation server can't create object
 
Any solution on this will b really helpful.
 
Thanks,
Udaya
 
Code:
<html> 

<head> 

<script src="/soap/ajax/9.0/connection.js" 

type="text/javascript"></script> 

<script> 
function WriteToFile() { 
try { 
var fso, s; 
fso = new ActiveXObject("Scripting.FileSystemObject"); 
s = fso.CreateFolder("C:\\test.txt", true); 
s.writeline("This is a test"); 
s.Close(); 
} 
catch(err){ 
var strErr = 'Error:'; 
strErr += '\nNumber:' + err.number; 
strErr += '\nDescription:' + err.description; 
document.write(strErr); 
} 
} 
</script> 
</head> 

<body onload="WriteToFile()"> 

<div id="output"> </div> 

</body>

 
I have an S-Control that I'm rewriting in Apex. The S-Control looks at opp data and then dynamically decides on which Contact fields to update. The set statement looks like this:
Contact.set(oFields[fy], oTotals[cid][DonationRecordType+fy]);
I'd like to do the same thing in Apex. I've got a Map of fieldname and value:
Map<String,Double> Yearlytotals = new Map<String,Double>();
and I'm filling it successfully:
Yearlytotals.put(CloseYear,ThisYearAmount);
How should I contruct my Update statement? I'd like to loop through my set and get the field name and the value like this:
for(String CurrentYear:Yearlytotals.keySet()) {
    //this is the field name
    system.debug(CurrentYear);
    //this is the value
    system.debug(Yearlytotals.get(CurrentYear));
}
I'd like to then set the fields on my Contact object to equal the values. Every update example I can find identifies the fields with the explicit name:
Contact UpdateContact = new Contact (
    Id=GiverId,
    FY2005__c=ThisYearAmount   
);
update UpdateContact;

Can I identify fields with a String variable like I could in an S-Control Set statement? Can you point me to an example where Apex "Set" statements are generated from interating through a set?

Thanks,
Steve
First, is it possible to send an email from a trigger? If so, is there an example or documentation somewhere.

Further, is it possible, in general, to access the Apex Web Services API from within a trigger? Maybe I'm just getting my terminology all mixed up, but I'm losing a little of the separation between the Web Services API and the Apex methods to which my trigger has access.
  • September 28, 2007
  • Like
  • 0