• nrwing
  • NEWBIE
  • 25 Points
  • Member since 2008

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 15
    Replies
Is it even possible to add an attachment from Apex?  I am able to add an attachment to the Notes & Attachments section upon the update of a case, but the attachment is nothing more than a string of characters....when it is supposed to be an excel file, for instance.
  • August 25, 2009
  • Like
  • 0
I have the below code setup for a detail page button/on click execute java script, and it doesn't give any errors, it reloads the page, but it doesn't change the record type at all.  From everything I can find this should work.  Any eyes see what I cannot? 
 
Code:
{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}
var newRecords = []; 
var c = new sforce.SObject("Opportunity"); 
c.id ="{!Opportunity.Id}";
c.RecordTypeId = "01240000000DMIpADO";
newRecords.push(c); 
result = sforce.connection.update(newRecords);
window.location.reload();

 
Thanks a ton in advance!
 
 
  • October 20, 2008
  • Like
  • 0
I am putting together basic VS pages, but want I had hoped to do is set it up so that I can change the label and color on the detail of a record (when it is first being created as well as viewed and edited) depending on the record type.  Can you do this using the visualforce and incorporating apex conditionals?  I would assume I want to use a conditional that might reference a stylesheet, but how do you do that in visualforce?
 
 
  • October 13, 2008
  • Like
  • 0

I have a related list button for a custom object that appears to basically work, however it creates a new window inside the current one.

Also, upon saving it does not refresh the opportunity detail page (to which it is related) therefore showing the new record that was recently created.

 

/a05/e?CF00N40000001jSgT={!Opportunity.Name}&00N40000001jXi0={!Opportunity.Market__c}&CF00N40000001jSgT_lkid={!Opportunity.Id}&retURL=%2F{!Opportunity.Id}&saveURL=%2F{!Opportunity.Id}

 

If I rewrite as shown below , which is the help I have been able to locate, I get a cross-site scripting error/warning...... Any help on this one....I have exhausted anything I can find.....

 

<script language="Javascript"> function redirect(){ parent.frames.locations.replace('/a05/e?CF00N40000001jSgT={!Opportunity.Name}&00N40000001jXi0={!Opportunity.Market__c}&CF00N40000001jSgT_lkid={!Opportunity.Id}&retURL=%2F{!Opportunity.Id}&saveURL=%2F{!Opportunity.Id}'); } redirect(); </script>



Message Edited by nrwing on 08-13-2008 01:16 PM
  • August 13, 2008
  • Like
  • 0
Warning: SoapClient::SoapClient() [function.SoapClient-SoapClient]: I/O warning : failed to load external entity "/wsdl/enterprise.wsdl.xml" in C:\xampp\htdocs\SforceBaseClient.php on line 121

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from '/wsdl/enterprise.wsdl.xml' in C:\xampp\htdocs\SforceBaseClient.php:121 Stack trace: #0 C:\xampp\htdocs\SforceBaseClient.php(121): SoapClient->SoapClient('/wsdl/enterpris...', Array) #1 C:\xampp\htdocs\sf_rodopi_importer02.php(16): SforceBaseClient->createConnection('/wsdl/enterpris...') #2 {main} thrown in C:\xampp\htdocs\SforceBaseClient.php on line 121
 
 
Above is the problem/error I am having.  I am just getting started on using PHP versus VBA to connect to salesforce and have worked my way through several errors but have gotten stuck on this one. 
 
The code is pretty basic
 

<?php

/*

*/

error_reporting(E_ALL);

require_once('SforceEnterpriseClient.php');

 

define("DEBUG", true);

$conn = new SforceEnterpriseClient();

$conn ->createConnection('/wsdl/enterprise.wsdl.xml');

$mylogin = $conn->login(person@company.net, "password");

$query = 'SELECT Name from Account limit 5';

$response = $conn->query($query);

?>

With the actual error being caught at this which is part of an include file.........

$this->sforce = new SoapClient($wsdl, $soapClientArray);

return $this->sforce;

 

Any thoughts/help........need further explanations?

 

Thanks,

Hi all.

 

I'm need help.I need to create list of attachments of custom objects for VisualForce page, but how I can get access to attachments of object. In the manual I not found information about acces to attachments from an APEX code.

 

Please Help.

Hi,

 

here is the case :

 

I want to include a new custom button which call an APEX method that will create maybe more than 100 objects linked to the object we currently seeing.

As you can see I have some difficulties to do it with an APEX trigger because governor limits.

 

So the solution should be to create this objects by the user with a simple button on the layout.

 

Can you help ?

Hi,

 

     I have a trigger on opportunity update which will update the opportunity line items  accordingly.

 

     Through the debug log I found the trigger is triggered twice, even though I specify it will only be triggered if there is a stage change from sA to sB. 

 

     From the discussion board, I found the reason is due to certain workflow rule did field update right after the trigger. But the funny thing is after the first firing, the previous stage of the opportunity is still considered as sA instead of sB, while the opportunity line items data did accumulated after the firing.

 

     In the end, the number of line items doubled.  Although I have ways to prevent the line items from the second round of accumulation, I am just curious how to deal with the second fire of trigger?

 

 

     Btw, I found the governer limit of SOQL in sandbox increased from 20 to 100! Good news!

 

 

Thanks,

Dawn

Message Edited by dawnzdy on 04-15-2009 12:23 PM

How does one attach files to saleforce using php... it does not appear to store files in the conventional upload to a directory sense....

 

is it storing them in the body field of the attachment table?

I have the below code setup for a detail page button/on click execute java script, and it doesn't give any errors, it reloads the page, but it doesn't change the record type at all.  From everything I can find this should work.  Any eyes see what I cannot? 
 
Code:
{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}
var newRecords = []; 
var c = new sforce.SObject("Opportunity"); 
c.id ="{!Opportunity.Id}";
c.RecordTypeId = "01240000000DMIpADO";
newRecords.push(c); 
result = sforce.connection.update(newRecords);
window.location.reload();

 
Thanks a ton in advance!
 
 
  • October 20, 2008
  • Like
  • 0
I am putting together basic VS pages, but want I had hoped to do is set it up so that I can change the label and color on the detail of a record (when it is first being created as well as viewed and edited) depending on the record type.  Can you do this using the visualforce and incorporating apex conditionals?  I would assume I want to use a conditional that might reference a stylesheet, but how do you do that in visualforce?
 
 
  • October 13, 2008
  • Like
  • 0

I have a related list button for a custom object that appears to basically work, however it creates a new window inside the current one.

Also, upon saving it does not refresh the opportunity detail page (to which it is related) therefore showing the new record that was recently created.

 

/a05/e?CF00N40000001jSgT={!Opportunity.Name}&00N40000001jXi0={!Opportunity.Market__c}&CF00N40000001jSgT_lkid={!Opportunity.Id}&retURL=%2F{!Opportunity.Id}&saveURL=%2F{!Opportunity.Id}

 

If I rewrite as shown below , which is the help I have been able to locate, I get a cross-site scripting error/warning...... Any help on this one....I have exhausted anything I can find.....

 

<script language="Javascript"> function redirect(){ parent.frames.locations.replace('/a05/e?CF00N40000001jSgT={!Opportunity.Name}&00N40000001jXi0={!Opportunity.Market__c}&CF00N40000001jSgT_lkid={!Opportunity.Id}&retURL=%2F{!Opportunity.Id}&saveURL=%2F{!Opportunity.Id}'); } redirect(); </script>



Message Edited by nrwing on 08-13-2008 01:16 PM
  • August 13, 2008
  • Like
  • 0
I have two fields - one in a standard object and one in a custom object.

When the value for the field in the standard object is populated I would like the corresponding field in the custom object to be updated with the same value.  Is there a way to do this?
There are some controls on home page, which are event calendar, task and dashboard.
I want to display them on apex page, Is it possible to implement?
Im just starting out looking at the API interface before we go ahead with the full deployment of our CRM as we have some custom requirements.
 
Ive been looking for this Office Toolkit so i can have a look at some Classic ASP examples and work from there, but i cant find it anywhere.
 
Does anyone have a link where i can download this file from, starting to drive me mad not being able to find it on here.
 
Cheers
 
Kris
  • April 21, 2008
  • Like
  • 0