• WebNX
  • NEWBIE
  • 0 Points
  • Member since 2011
  • System Developer
  • Numerix LLC

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 6
    Replies
Help!!!!! I keep receiving the following error message from Salesforce when I click on a custom JavaScript button that I built.
A problem with the OnClick JavaSecript for this button or link was encountered:
Expected ';'
I have created a custom Salesforce button using JavaScript to populate two custom fields in a custom object. The JavaScript queries all the related record’s counters and adds them up then updates the current record along with refreshing the web page. Below is JavaScript code that I am using, thanks in advance.
Clyde


{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}

var qyRecords = sforce.connection.query("Select Billable_Hours_NX__c, Non_Billable_Hours_NX__c From Project_Line__c Where Project__c = '" + "{!ProjectConnection__c.Project__c}" + "'", {onSuccess : success, onFailure : log});


functiion success(qyRecords){
var billHours = 0;
var nonbillHours = 0;
var records = new sforce.getArray("records");
for(var i=0; i<records.length; i++){
var record = records[i];
billHours += record.Billable_Counter__c;
nonbillHours += record.Non_Billable_Counter__c;
}
var precord = new sforce.SObject("ProjectBillableConnection__c");
precord.id = {!ProjectBillableConnection__c.Id};
precord.TotalLBH__c = billHours;
precord.TotalLNonBH__c = nonbillHours;

sforce.connection.update([precord]);
window.location.reload();
}
  • March 14, 2014
  • Like
  • 1

I am trying to do a Mail Merge from a Salesforce into MS Word 2010.  I am able to get field(s) that I want from the Mail Merge I just cannot display the format that I want. For instance I want to change the date format from 05/1/2013 into May 1, 2013.  Here is the mail merge code that I have in word {MERGEFIELD  createddate
\@ "MMMM d, yyyy}. I have also tried to use words format to put the equal sign in front then the switch formatting like so { = {MERGEFIELD  createddate } \@ "MMMM d, yyyyy"} but I show a syntax error in word. Someone any one HELP!!!!!

 

Thanks.

  • April 19, 2013
  • Like
  • 0

I am have created a dynamic visualforce email template that  will give a person/lead an email accuring to the clients picklist inofrmation.

The error message that I am getting states;

"Error occurred trying to load the template for preview: List has no rows for assignment to SObject. Please try editing your markup to correct the problem."

 

Does any one know what this means, or what is causing the problem? Here is my code below:

 

Apex code:

 

public class ListWhitePapers {

            public Id thisLeadId { get; set; }

            public List<String> WhitePapers = new List<String>();

            public List<String> getWhitePapers(){

Lead leadRequest = [Select Requested_Research_Papers__c From Lead Where Id =: thisLeadId limit 1];

 List<String> requestWhites = leadRequest.Requested_Research_Papers__c.split(';');

for(String request : requestWhites){

if(request.equals('Analytical formulas')){

WhitePapers.add('Analytical Formulas <br />');

}else if(request.equals('Analytic techniques’)){

WhitePapers.add('Analytical Techniques <br />');

}else if(request.equals('Dynamic model’)){

WhitePapers.add('Dynamic Model <br />');

}else if(request.equals('Generalized Method')){

WhitePapers.add('Generalized Method  <br />');

}else if(request.equals('Projection-Displaced Diffusion')){

WhitePapers.add('Projection onto a Displaced Diffusion<br />');

}else if(request.equals(' Projection onto a Heston model')){

WhitePapers.add('Projection to a Heston Model <br />');

}else if(request.equals('Credit Portfolios')){

WhitePapers.add('Credit Portfolios <br />' );

                                    }//End of if-else statement.

                         }//End of for loop.

                         return WhitePapers;

            }//End of public list string

}//Enod of apex class.

 

 

Component Code:

 

<apex:component controller="ListWhitePapers" access="global">

<apex:attribute name="LeadId" description="This is the requesting Lead's Id." type="Id" assignTo="{!thisLeadId}"/>

<apex:repeat value="{!WhitePapers}" var="paper" id="theRepeat">

<apex:outputText value="{!paper}"/><br />

</apex:repeat>

</apex:component>

 

VisualForce Email Template:

 

<messaging:emailTemplate subject="Here is the URL for the Research Paper you Requested" recipientType="Lead" relatedToType="Lead">

<messaging:htmlEmailBody >

<html>

<body>

Dear {!recipient.FirstName} {!recipient.LastName}: <br /><br />

 

Thank you for your interest in Numerix! <br /><br />

 

As you probably already know, Numerix, an independent software company, is the recognized leader in multi-platform, cross-asset

derivatives pricing and risk management software for fixed income, credit, foreign exchange and equity. More than 200 clients across

25 countries rely on NumeriX for speed and accuracy in valuating and pricing their vanilla and exotic derivatives. <br /><br /> 

 

With the ability to quickly design and price new derivative products, Numerix CrossAsset combines robust analytics with maximum

flexibility. Traders, marketers, quantitative analysts and portfolio managers can quickly assemble and price deals. Numerix CrossAsset

is a generic derivative pricing software package, designed to be fast and simple to use inside of Excel or within an integrated

solution, where heavy use is expected and high accuracy demanded, such as trading and risk management systems. <br /><br /><br /> 

 

 

For your interest the following are papers written by members of the NumeriX Quantitative team. If you wish to access this work done by our world renowned analytics department please follow the links provided below:<br />

 

To download click the links below: <br /><br />

<c:RequestWhitePaper LeadId="{!relatedTo.Id}"/>

<br />

If you wish any further information please contact us at : <br /><br />

Thank you

  • February 16, 2012
  • Like
  • 0

Hello Everyone,

 

I am have problems querying User's Task by using the following formula below. I just want to view task that the user(s) may have for today, but I am getting a error message stating Invalid Type.

 

Select Id, Name, Email,

(Select Subject, ReminderDateTime From Task Where ReminderDateTime = TODAY)

From User

 

Can someone please help me with this problem? Thanks in advance.

  • December 12, 2011
  • Like
  • 0

I am try to create a visualforce template to display all the task that a user(s) may have open the following day, but I am receiving this error inside salesforce when I save my code. Here is the error message:

Error: Invalid field Task for SObject Task 

Can some body please help me, and tell me where I am going wrong in visualforce. Thanks, also below is my visualforce code:

 

<messaging:emailTemplate subject="Task For Today" recipientType="User" relatedToType="Task">
<messaging:htmlEmailBody>
<html>
<style type="text/css">
    body{font-family: Courier; size: 12pt;}
        table{
        border-width: 5px;
        border-spacing: 5px;
        border-style: line;
        border-color: #FF0000;
        background-color: #FFFFFF;
        }
        
    td {
            border-width: 1px;
            padding: 4px;
            border-style: solid;
            border-color: #000000;
            background-color: #FFEECC;
        }

    th {
            color: #000000;
            border-width: 1px ;
            padding: 4px ;
            border-style: solid ;
            border-color: #000000;
            background-color: #FFFFF0;
        }
</style>
<body>
    <p>Dear {!recipient.name},<br />
    Below is a list of task(s) that are assign to you, for today!
    </p>
        <table border="0" >
            <tr>
                <th>Subject</th><th>Name of Lead</th>
                <th>Name of Contact</th><th>Phone #</th>
                <th>Lead's Email</th><th>Contact Email</th>
            </tr>
            <apex:repeat var="cx" value="{!relatedTo.Task}">
            <tr>
                <td>{!cx.Subject}</td>
                <td>{!cx.Lead.Name}</td>
                <td>{!cx.Contact.Name}</td>
                <td>{!cx.Phone}</td>
                <td>{!cx.Lead.email}</td>
                <td>{!cx.Contact.email}</td>
            </tr>
                </apex:repeat>
        </table>
    </body>
    </html>
    </messaging:htmlEmailBody></messaging:emailTemplate>

  • December 07, 2011
  • Like
  • 0

I am trying to insert a custom object into another custom object which is its master. I cannot get salesforce's php toolkit to insert into any object. I can query the master custom object along with querying the child custom object. I am using salesforce enterprise, below is my code in which I am trying to do the insert.

 

Can someone, any one can help me. Thanks in advance.

 

 

$sObject = new stdClass();
$sObject->CurrencyIsoCode = 'USD';
$sObject->Downloader__c = 'PHP Test';
$sObject->Package__c = 'Test PHP';
$sObject->Product_Trial__c = 'XXXXXXXXXXXXXXX';

$upsertResponse = $this->_mySforceConnection->upsert('NSP_Trial_Download__c', array($sObject),$objectType);
echo "Upserting New NSP_Trial_Download__c\(existing)r\n";
print_r($upsertResponse);

catch (Exception $e) {
echo $mySforceConnection->getLastRequest();
echo $e->faultstring;

}

 

  • November 02, 2011
  • Like
  • 0

Can some please help me. I am trying to code an apex trigger to email, whenever there is an attachment to a contract. Also, inside the body of the trigger email have a link to the contract that has the insert attachment, as well as having the name and contract id information in the body and subject line of the email. I get an error message on line 24, stating that; "Save error: Initial term of field expression must be a concrete SObject: MAP<Id,Contract>." Here is the my code below:

 

trigger NoteAttachmentTrigger on Attachment (after insert) {
 
 List<Id> contIds = new List<Id>();
 
 for (Attachment att : trigger.new){
  contIds.add(att.parentId);
 }
 
 Map<Id, Contract> contracts = new Map<Id, Contract>();
 contracts.putAll([Select c.Id, c.Name, c.Contract_ID__c, c.ContractNumber From Contract c Where Id IN:contIds]);
 
 Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
 
 String[] toAddresses = new String []{'email@example.com'};
 
 mail.setToAddresses(toAddresses);
 mail.setReplyTo('email@example.com');
 mail.setSenderDisplayName('Email Example');
 mail.setSubject(contract.Name + ' has A New Note & Attachments: ' + contract.Contract_ID__c);
 mail.setUseSignature(false);
 mail.setPlainTextBody('A new Note & Attachments was posted to a contract name ' + contracts.Name
      + ', the contract id is ' + contracts.Contract_ID__c + '.');
 mail.setHtmlBody('Here is the link to the contract:<b> ' + contracts.ContractNumber +' </b>has been created<p>'+
     ' View case <a href=https://cs4.salesforce.com/' + contracts.Id + '>click here</a>');
 Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });

}

 

Thanks in advance,

  • September 08, 2011
  • Like
  • 0
Help!!!!! I keep receiving the following error message from Salesforce when I click on a custom JavaScript button that I built.
A problem with the OnClick JavaSecript for this button or link was encountered:
Expected ';'
I have created a custom Salesforce button using JavaScript to populate two custom fields in a custom object. The JavaScript queries all the related record’s counters and adds them up then updates the current record along with refreshing the web page. Below is JavaScript code that I am using, thanks in advance.
Clyde


{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}

var qyRecords = sforce.connection.query("Select Billable_Hours_NX__c, Non_Billable_Hours_NX__c From Project_Line__c Where Project__c = '" + "{!ProjectConnection__c.Project__c}" + "'", {onSuccess : success, onFailure : log});


functiion success(qyRecords){
var billHours = 0;
var nonbillHours = 0;
var records = new sforce.getArray("records");
for(var i=0; i<records.length; i++){
var record = records[i];
billHours += record.Billable_Counter__c;
nonbillHours += record.Non_Billable_Counter__c;
}
var precord = new sforce.SObject("ProjectBillableConnection__c");
precord.id = {!ProjectBillableConnection__c.Id};
precord.TotalLBH__c = billHours;
precord.TotalLNonBH__c = nonbillHours;

sforce.connection.update([precord]);
window.location.reload();
}
  • March 14, 2014
  • Like
  • 1

I am trying to do a Mail Merge from a Salesforce into MS Word 2010.  I am able to get field(s) that I want from the Mail Merge I just cannot display the format that I want. For instance I want to change the date format from 05/1/2013 into May 1, 2013.  Here is the mail merge code that I have in word {MERGEFIELD  createddate
\@ "MMMM d, yyyy}. I have also tried to use words format to put the equal sign in front then the switch formatting like so { = {MERGEFIELD  createddate } \@ "MMMM d, yyyyy"} but I show a syntax error in word. Someone any one HELP!!!!!

 

Thanks.

  • April 19, 2013
  • Like
  • 0

I am have created a dynamic visualforce email template that  will give a person/lead an email accuring to the clients picklist inofrmation.

The error message that I am getting states;

"Error occurred trying to load the template for preview: List has no rows for assignment to SObject. Please try editing your markup to correct the problem."

 

Does any one know what this means, or what is causing the problem? Here is my code below:

 

Apex code:

 

public class ListWhitePapers {

            public Id thisLeadId { get; set; }

            public List<String> WhitePapers = new List<String>();

            public List<String> getWhitePapers(){

Lead leadRequest = [Select Requested_Research_Papers__c From Lead Where Id =: thisLeadId limit 1];

 List<String> requestWhites = leadRequest.Requested_Research_Papers__c.split(';');

for(String request : requestWhites){

if(request.equals('Analytical formulas')){

WhitePapers.add('Analytical Formulas <br />');

}else if(request.equals('Analytic techniques’)){

WhitePapers.add('Analytical Techniques <br />');

}else if(request.equals('Dynamic model’)){

WhitePapers.add('Dynamic Model <br />');

}else if(request.equals('Generalized Method')){

WhitePapers.add('Generalized Method  <br />');

}else if(request.equals('Projection-Displaced Diffusion')){

WhitePapers.add('Projection onto a Displaced Diffusion<br />');

}else if(request.equals(' Projection onto a Heston model')){

WhitePapers.add('Projection to a Heston Model <br />');

}else if(request.equals('Credit Portfolios')){

WhitePapers.add('Credit Portfolios <br />' );

                                    }//End of if-else statement.

                         }//End of for loop.

                         return WhitePapers;

            }//End of public list string

}//Enod of apex class.

 

 

Component Code:

 

<apex:component controller="ListWhitePapers" access="global">

<apex:attribute name="LeadId" description="This is the requesting Lead's Id." type="Id" assignTo="{!thisLeadId}"/>

<apex:repeat value="{!WhitePapers}" var="paper" id="theRepeat">

<apex:outputText value="{!paper}"/><br />

</apex:repeat>

</apex:component>

 

VisualForce Email Template:

 

<messaging:emailTemplate subject="Here is the URL for the Research Paper you Requested" recipientType="Lead" relatedToType="Lead">

<messaging:htmlEmailBody >

<html>

<body>

Dear {!recipient.FirstName} {!recipient.LastName}: <br /><br />

 

Thank you for your interest in Numerix! <br /><br />

 

As you probably already know, Numerix, an independent software company, is the recognized leader in multi-platform, cross-asset

derivatives pricing and risk management software for fixed income, credit, foreign exchange and equity. More than 200 clients across

25 countries rely on NumeriX for speed and accuracy in valuating and pricing their vanilla and exotic derivatives. <br /><br /> 

 

With the ability to quickly design and price new derivative products, Numerix CrossAsset combines robust analytics with maximum

flexibility. Traders, marketers, quantitative analysts and portfolio managers can quickly assemble and price deals. Numerix CrossAsset

is a generic derivative pricing software package, designed to be fast and simple to use inside of Excel or within an integrated

solution, where heavy use is expected and high accuracy demanded, such as trading and risk management systems. <br /><br /><br /> 

 

 

For your interest the following are papers written by members of the NumeriX Quantitative team. If you wish to access this work done by our world renowned analytics department please follow the links provided below:<br />

 

To download click the links below: <br /><br />

<c:RequestWhitePaper LeadId="{!relatedTo.Id}"/>

<br />

If you wish any further information please contact us at : <br /><br />

Thank you

  • February 16, 2012
  • Like
  • 0

Hello Everyone,

 

I am have problems querying User's Task by using the following formula below. I just want to view task that the user(s) may have for today, but I am getting a error message stating Invalid Type.

 

Select Id, Name, Email,

(Select Subject, ReminderDateTime From Task Where ReminderDateTime = TODAY)

From User

 

Can someone please help me with this problem? Thanks in advance.

  • December 12, 2011
  • Like
  • 0

I am try to create a visualforce template to display all the task that a user(s) may have open the following day, but I am receiving this error inside salesforce when I save my code. Here is the error message:

Error: Invalid field Task for SObject Task 

Can some body please help me, and tell me where I am going wrong in visualforce. Thanks, also below is my visualforce code:

 

<messaging:emailTemplate subject="Task For Today" recipientType="User" relatedToType="Task">
<messaging:htmlEmailBody>
<html>
<style type="text/css">
    body{font-family: Courier; size: 12pt;}
        table{
        border-width: 5px;
        border-spacing: 5px;
        border-style: line;
        border-color: #FF0000;
        background-color: #FFFFFF;
        }
        
    td {
            border-width: 1px;
            padding: 4px;
            border-style: solid;
            border-color: #000000;
            background-color: #FFEECC;
        }

    th {
            color: #000000;
            border-width: 1px ;
            padding: 4px ;
            border-style: solid ;
            border-color: #000000;
            background-color: #FFFFF0;
        }
</style>
<body>
    <p>Dear {!recipient.name},<br />
    Below is a list of task(s) that are assign to you, for today!
    </p>
        <table border="0" >
            <tr>
                <th>Subject</th><th>Name of Lead</th>
                <th>Name of Contact</th><th>Phone #</th>
                <th>Lead's Email</th><th>Contact Email</th>
            </tr>
            <apex:repeat var="cx" value="{!relatedTo.Task}">
            <tr>
                <td>{!cx.Subject}</td>
                <td>{!cx.Lead.Name}</td>
                <td>{!cx.Contact.Name}</td>
                <td>{!cx.Phone}</td>
                <td>{!cx.Lead.email}</td>
                <td>{!cx.Contact.email}</td>
            </tr>
                </apex:repeat>
        </table>
    </body>
    </html>
    </messaging:htmlEmailBody></messaging:emailTemplate>

  • December 07, 2011
  • Like
  • 0

I am trying to insert a custom object into another custom object which is its master. I cannot get salesforce's php toolkit to insert into any object. I can query the master custom object along with querying the child custom object. I am using salesforce enterprise, below is my code in which I am trying to do the insert.

 

Can someone, any one can help me. Thanks in advance.

 

 

$sObject = new stdClass();
$sObject->CurrencyIsoCode = 'USD';
$sObject->Downloader__c = 'PHP Test';
$sObject->Package__c = 'Test PHP';
$sObject->Product_Trial__c = 'XXXXXXXXXXXXXXX';

$upsertResponse = $this->_mySforceConnection->upsert('NSP_Trial_Download__c', array($sObject),$objectType);
echo "Upserting New NSP_Trial_Download__c\(existing)r\n";
print_r($upsertResponse);

catch (Exception $e) {
echo $mySforceConnection->getLastRequest();
echo $e->faultstring;

}

 

  • November 02, 2011
  • Like
  • 0