• ddoelling
  • NEWBIE
  • 5 Points
  • Member since 2003

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

I have a javascript that creates a clone of an opportunity from a "locked" one.  We lock certain fields on the opportunity (via record type) after it passes audits with the billing system.  I have a function that replaces ampersands and apostrophes in the string fields such as the Opportunity Name.  The problem I am having is that I am getting an error on the code that is attempting to extract the Opportunity Name from the screen and pass it to the function. 

// name=stringedit('{!Opportunity_Name}') + " - " + order;

Any suggestions on how to get around this problem?

 

Message Edited by ddoelling on 08-05-2005 11:13 AM

I am sort of posting this question twice - my apologies.  I have done a bit more research and think I am on the right track but have hit a wall.  

I am trying to obtain the key of a new opportunity created by my sforce control..  The code I am using was initially posted by DevAngel and demonstrated how to calculate a field and perform an update using javascript and msxml.  I have modified the code to do clone operation from an existing opp.

The problem is that I can't seem to get to the id that is returned in the response from the create call per the API.  I can see the key when I display the msxml.responseText.   For some reason the selectNodes isn't working because objNodeList is undefined. 

Here is the code I am using to attempt to retrieve the "id" node that is returned per the API doc.  Any guidance would be greatly appreciated. 

if (status == 200)
{
  xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
  xmlDoc.loadXML(msxml.responseText);
  xmlDoc.setProperty("SelectionNamespaces", "xmlns:sf='urn:sobject.enterprise.soap.sforce.com'");
  var objNodeList = xmlDoc.documentElement.selectNodes("//sf:id");
  var newoppid = objNodeList.item(0).text;
  document.write("<br><strong><center>Opportunity successfully cloned.");
  //window.parent.parent.location.href="https://na1.salesforce.com/" +  newoppid;

I am trying to build an sforce control (WIL) in javascript that will allow our service reps to test the customer's equipment directly from Salesforce.  The control will get the serial number from Salesforce and pass it as a parm in a URL (know how to do that).  The URL is a utlity function (ip address/function/parm) that takes in the serial number, performs the test and returns the test results in XML format.  Ultimately we would want to analyze the results and display a red/yellow/green light to the rep.  

The problem I am having is that I can't figure out how to call the URL and capture the results in javascript.  I have tried using the XMLHTTPRequest function but get a security error.  Any advice would be greatly appreciated. 

I am attempting to write an sforce control / WIL that will create a copy of an existing opportunity.  We are looking at using record types to "lock down" our closed opportunities.  This control will be used when sales needs to handle a contract renewal.  The control would insert a new opportunity using some of the fields on the locked opportunity and reset the record type so the new opp can be edited. .  

The problem I am having is in setting the Close Date on the opportunity.  Javascript's Date object doesn't seem to work nor does passing the date as a string.  I saw one message on this board regarding the use of the primitive datatypes but haven't been able to figure out how to incorporate that into the xml.   I am using the Enterprise WSDL. 

Anyone have any ideas? 

(The script I am using came from a message on this board regarding how to perform a calculation and udpate the opportunity record from a WIL.)

 

I am working on a contract generator that takes the output of the mail merge process and customizes it based on data extracted from Salesforce as well as options selected by the user.  The generator is simply a Word document that contains nothing but a couple of forms and VBA script.  We have stored the generator on the Documents tab (to manage change control).  The mail merge file contains bookmarked text that the generator uses to build the contract.  (Note:  I inherited this from a prototype someone created so I'm stuck with this design for now.)

The process for using the generator was that the user would run the mail merge (keeping the output displayed in IE) and then run the generator.   When the generator starts it finds all the open Word documents (Documents.Count) and loads a list box with the document names.  The problem is that the output of the mail merge isn't listed as a document in the list box.  I now understand that the file created out of the mail merge is just a view of a Word document running inside IE.  Word is not running as an application - IE is the application.  What I don't understand is why when I view the VBA file located in Documents, it starts and runs the VBA script in IE just like it was running as a Word application.  I'm not a MS developer type so maybe this is my ignorance.  

Is there a way that I could add code in the generator to obtain a list of all the open IE windows and load them into the list box?   I don't like the idea of requiring the user to save the mail merge document prior to running the generator.   

We are currently creating contracts (in Word) using the mail merge template function.  The problem is that our customers don't want to see language specific to a product they didn't purchase.  Also, we don't want to print every possible product/service that isn't included in the sale.  Creating many, many possible versions of the contract just isn't practical. 

One of my peers has developed a Word document containing macros that parses through the output of the mail merge and includes or excludes sections using bookmarks.  The macro displays a window where the user selects various options that control the customization.  He created this process because he was told that you couldn't mix macros with the mail merge functionality.  It appears to me that you could mix the two but would have to have Office Edition installed.  True or false?

The process this person developed requires too many steps and I fear that our sales people will mess it up and thus proclaim it a failure.  The solution I would like to create would prompt the user for information needed to customize the contract language and then create the output in a single step.  Any thoughts on how I could do this in Word or any other technology? 

I have been trying to use the Excel connector to identify opportunity records that have been modified on a particular date.  I keep getting records outside my criteria.   For example, using the criteria of:

Last Modified Date >= 11/15/2004 0:00 Last Modified Date <= 11/15/2004 23:59

returns records having a Last Modified Date of 11/14/2004 19:24 through 11/15/2005 17:59.  The last record has a Last Modified Date of 11/17/2004 16:06.  Is there some sort of logical business day at work here?

 

I am sort of posting this question twice - my apologies.  I have done a bit more research and think I am on the right track but have hit a wall.  

I am trying to obtain the key of a new opportunity created by my sforce control..  The code I am using was initially posted by DevAngel and demonstrated how to calculate a field and perform an update using javascript and msxml.  I have modified the code to do clone operation from an existing opp.

The problem is that I can't seem to get to the id that is returned in the response from the create call per the API.  I can see the key when I display the msxml.responseText.   For some reason the selectNodes isn't working because objNodeList is undefined. 

Here is the code I am using to attempt to retrieve the "id" node that is returned per the API doc.  Any guidance would be greatly appreciated. 

if (status == 200)
{
  xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
  xmlDoc.loadXML(msxml.responseText);
  xmlDoc.setProperty("SelectionNamespaces", "xmlns:sf='urn:sobject.enterprise.soap.sforce.com'");
  var objNodeList = xmlDoc.documentElement.selectNodes("//sf:id");
  var newoppid = objNodeList.item(0).text;
  document.write("<br><strong><center>Opportunity successfully cloned.");
  //window.parent.parent.location.href="https://na1.salesforce.com/" +  newoppid;

I am attempting to write an sforce control / WIL that will create a copy of an existing opportunity.  We are looking at using record types to "lock down" our closed opportunities.  This control will be used when sales needs to handle a contract renewal.  The control would insert a new opportunity using some of the fields on the locked opportunity and reset the record type so the new opp can be edited. .  

The problem I am having is in setting the Close Date on the opportunity.  Javascript's Date object doesn't seem to work nor does passing the date as a string.  I saw one message on this board regarding the use of the primitive datatypes but haven't been able to figure out how to incorporate that into the xml.   I am using the Enterprise WSDL. 

Anyone have any ideas? 

(The script I am using came from a message on this board regarding how to perform a calculation and udpate the opportunity record from a WIL.)

 

I am working on a contract generator that takes the output of the mail merge process and customizes it based on data extracted from Salesforce as well as options selected by the user.  The generator is simply a Word document that contains nothing but a couple of forms and VBA script.  We have stored the generator on the Documents tab (to manage change control).  The mail merge file contains bookmarked text that the generator uses to build the contract.  (Note:  I inherited this from a prototype someone created so I'm stuck with this design for now.)

The process for using the generator was that the user would run the mail merge (keeping the output displayed in IE) and then run the generator.   When the generator starts it finds all the open Word documents (Documents.Count) and loads a list box with the document names.  The problem is that the output of the mail merge isn't listed as a document in the list box.  I now understand that the file created out of the mail merge is just a view of a Word document running inside IE.  Word is not running as an application - IE is the application.  What I don't understand is why when I view the VBA file located in Documents, it starts and runs the VBA script in IE just like it was running as a Word application.  I'm not a MS developer type so maybe this is my ignorance.  

Is there a way that I could add code in the generator to obtain a list of all the open IE windows and load them into the list box?   I don't like the idea of requiring the user to save the mail merge document prior to running the generator.   

We need to create a calculated field where (custom_field_A ) - (custom_field_B) = (custom_field_C).  Further, custom_field_A is on a different tab than custom_field_B.  Can anyone out there supply me with some sample code and/or suggestions on how to go about accomplishing this?  Any help is much appreciated.

Thanks

  • December 27, 2005
  • Like
  • 0

I have been trying to use the Excel connector to identify opportunity records that have been modified on a particular date.  I keep getting records outside my criteria.   For example, using the criteria of:

Last Modified Date >= 11/15/2004 0:00 Last Modified Date <= 11/15/2004 23:59

returns records having a Last Modified Date of 11/14/2004 19:24 through 11/15/2005 17:59.  The last record has a Last Modified Date of 11/17/2004 16:06.  Is there some sort of logical business day at work here?