• sfunston
  • NEWBIE
  • 5 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 13
    Replies
Hi, can someone tell me what happens when a trigger fails?  I have a requirement to report the failure to my users.

Thanks
    Hi

I am trying to figure out if there is something like the virtural inserted table from mssql in SalesForce.

What I want to do is create a trigger on a Custom  Object (CustObject) that has a master detail relationship with Opportunity.  So when a record is inserted into CustObject I want to find all the other records in CustObject that have the same Opportunity__c and update only those records.



Any ideas would be appreciated.
I am trying to determine a method to export a "report" that was created using an scontrol to excel. 

So this control is not accessible from the reports tab.  As it is an scontrol.  The reason that the report was not created using salesforce.com "Reports" is because "Reports" is not flexible enough.

Thanks for any help.

-Steven
Can someone tell me how to open the apex explorer in Eclipse.

Thanks
Greetings.

I have a report that I generate using an scontrol.  The report has to be printable and made available for excel and or pdf.

Is there some way that someone knows of that I can make the generated report available to the user in excel.

I am also going to need to produce a PDF version.  Excel or PDF will be dependent on the user.

I thought that I would be able to use a pdf printer driver, but the problem is that the reports spans past the right of the screen (which you can scroll to) but when I print the print function is only grabbing the content from the left side of the screen to the scroll bar.

I appreciate any ideas.

Thanks
Greetings.

I just added a custom field to the Account Object.  When I download my Enterprise WSDL the new custom field that I just created is not in the wsdl.

Shouldn't the WSDL be updated immediately?  Can someone offer some suggestions?

Thanks
I am having a problem with the following query, but the query below works.  I am not sure what the problem is here as I am certain that the date value I am using is properly constrcted.

SELECT
   mc.CreatedById, mc.CreatedDate, mc.CurrencyIsoCode, mc.Id, mc.LastModifiedById, mc.LastModifiedDate, mc.Name, mc.Opportunity__c,
   mc.SystemModstamp, o.Name, o.AcceptStatus__c, o.AccountId, Opportunity__r.CloseDate
FROM
   Manager_Commit_v2__c  mc, mc.Opportunity__r o WHERE o.CloseDate > 2007-01-01T05:00:00Z


Here is the error info:
An error has occurred: {faultcode:'sf:INVALID_FIELD', faultstring:'INVALID_FIELD: value of filter criterion for field 'CloseDate' must be of type date and should not be enclosed in quotes', detail:{fault:{exceptionCode:'INVALID_FIELD', exceptionMessage:'value of filter criterion for field 'CloseDate' must be of type date and should not be enclosed in quotes', row:'1', column:'274', }, }, }

Here is the working query.
SELECT
   mc.CreatedById, mc.CreatedDate, mc.CurrencyIsoCode, mc.Id, mc.LastModifiedById, mc.LastModifiedDate, mc.Name, mc.Opportunity__c,
   mc.SystemModstamp, o.Name, o.AcceptStatus__c, o.AccountId, Opportunity__r.CloseDate
FROM
   Manager_Commit_v2__c  mc, mc.Opportunity__r o WHERE o.CloseDate > TODAY


Thanks
I have been trying to migrate a grid control from beta to 07 release and am having serious difficulties.  Can anyone provide me with sample code?

Thanks.
Hi, can someone tell me what happens when a trigger fails?  I have a requirement to report the failure to my users.

Thanks
    Hi

I am trying to figure out if there is something like the virtural inserted table from mssql in SalesForce.

What I want to do is create a trigger on a Custom  Object (CustObject) that has a master detail relationship with Opportunity.  So when a record is inserted into CustObject I want to find all the other records in CustObject that have the same Opportunity__c and update only those records.



Any ideas would be appreciated.
hi all:
   I wrote a s-control report calculating some fields this is why this is a custom report... now, the thing is the users want to be able to export this custom report to excel...
does anyone have any suggestions?
Thanks
Shan
I am trying to determine a method to export a "report" that was created using an scontrol to excel. 

So this control is not accessible from the reports tab.  As it is an scontrol.  The reason that the report was not created using salesforce.com "Reports" is because "Reports" is not flexible enough.

Thanks for any help.

-Steven
Can someone tell me how to open the apex explorer in Eclipse.

Thanks
Greetings.

I just added a custom field to the Account Object.  When I download my Enterprise WSDL the new custom field that I just created is not in the wsdl.

Shouldn't the WSDL be updated immediately?  Can someone offer some suggestions?

Thanks
I'm finding this error occurs when I include fields of type DateTime (for example, LastModifiedDate) on an outbound message.  I've posted a snippet of the output from YATT stack trace below.  BTW, I'm running Win2k3, IIS 6.0, .NET 2.0.


HTTP/1.1 500 Internal Server Error
Date: Fri, 02 Feb 2007 08:32:49 GMT
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 2584


System.Web.Services.Protocols.SoapException: Server was unable to read request.
---> System.InvalidOperationException: There is an error in XML document (21, 73).
---> System.FormatException: String was not recognized as a valid DateTime.
   at System.DateTimeParse.ParseExactMultiple(String s, String[] formats, DateTimeFormatInfo dtfi, DateTimeStyles style)
   at System.DateTime.ParseExact(String s, String[] formats, IFormatProvider provider, DateTimeStyles style)
   at System.Xml.XmlConvert.ToDateTime(String s, String[] formats)
   at System.Xml.Serialization.XmlCustomFormatter.ToDateTime(String value, String[] formats)
   at System.Xml.Serialization.XmlCustomFormatter.ToDate(String value)
   at System.Xml.Serialization.XmlSerializationReader.ToDate(String value)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read2_NullableOfDateTime(Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read5_MY_CUSTOM_SOBJECT__c(Boolean isNullable, Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read7_MY_CUSTOM_SOBJECT__cNotification(Boolean isNullable, Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read8_notifications(Boolean isNullable, Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read10_notifications()
   at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer.Deserialize(XmlSerializationReader reader)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   --- End of inner exception stack trace ---
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
   at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
   --- End of inner exception stack trace ---
   at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
   at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()



Now, I was able to work around this by 1) removing the DateTime field(s) from the outbound message--which enables the serialization to work and let the web service code proceed to execute--and then 2) using "retrieve" to get the field when its needed in runtime.  Alas, this results in an extra round-trip, which is unfortunate.  At least it works for now. 

Any other suggestions?  I'm sure others will encounter this at some point. 


  • February 02, 2007
  • Like
  • 0
I am having a problem with the following query, but the query below works.  I am not sure what the problem is here as I am certain that the date value I am using is properly constrcted.

SELECT
   mc.CreatedById, mc.CreatedDate, mc.CurrencyIsoCode, mc.Id, mc.LastModifiedById, mc.LastModifiedDate, mc.Name, mc.Opportunity__c,
   mc.SystemModstamp, o.Name, o.AcceptStatus__c, o.AccountId, Opportunity__r.CloseDate
FROM
   Manager_Commit_v2__c  mc, mc.Opportunity__r o WHERE o.CloseDate > 2007-01-01T05:00:00Z


Here is the error info:
An error has occurred: {faultcode:'sf:INVALID_FIELD', faultstring:'INVALID_FIELD: value of filter criterion for field 'CloseDate' must be of type date and should not be enclosed in quotes', detail:{fault:{exceptionCode:'INVALID_FIELD', exceptionMessage:'value of filter criterion for field 'CloseDate' must be of type date and should not be enclosed in quotes', row:'1', column:'274', }, }, }

Here is the working query.
SELECT
   mc.CreatedById, mc.CreatedDate, mc.CurrencyIsoCode, mc.Id, mc.LastModifiedById, mc.LastModifiedDate, mc.Name, mc.Opportunity__c,
   mc.SystemModstamp, o.Name, o.AcceptStatus__c, o.AccountId, Opportunity__r.CloseDate
FROM
   Manager_Commit_v2__c  mc, mc.Opportunity__r o WHERE o.CloseDate > TODAY


Thanks

This is a sample scontrol that takes the query results and renders in a grid widget. This sample uses a grid widget from TurboWidgets. The widget is essentially a dojo widget. With a little more effort, the grid could be editable as the grid supports this.

Cheers and good luck!

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>TurboWidgets, presented by TurboAjax Group</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script type="text/javascript" src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js—browser=true"></script>
<!--<script language="JavaScript" type="text/javascript" src="../turbowidgets_beta_1.0.9/turbo/turbo.js"></script>-->
<script language="JavaScript" type="text/javascript" src="http://turboajax.com/turbo/turbo.js"></script>
<link href="style.css" rel="stylesheet" type="text/css" />
<style>
 pre, code {
  margin: 8px 0 12px 0;
  padding: 6px 0 6px 0;
  background-color: #F6F6F6;
 }
 pre {
  font-family: "Courier New", Courier, mono;
  font-size: 11px;
  border-top: 1px solid blue;
  border-bottom: 1px solid blue;
 }
 code {
  display: block;
  white-space: nowrap;
  border-top: 1px solid green;
  border-bottom: 1px solid green;
 }
 .module-body {
  font-size: 12px;
  padding-left: 16px;
  padding-right: 16px;
 }
 .panel
 {
  background-color: #EEE;
  border: 1px dotted silver;
  padding: 2px;
 }
 .panel .turbo-splitter-h {
  border-left: 1px solid #CCC;
  border-right: 1px solid #CCC;
 }
 .panel .turbo-splitter-v {
  border-top: 1px solid #CCC;
  border-bottom: 1px solid #CCC;
 }
 #highlightbox ul {
  margin-bottom: 6px;
  margin-left: 0px;
  padding-left: 26px;
  margin-top: 6px;
  font-size: 11px;
 }
</style>
<script>
 turbo.debug('-- starting TurboWidgets example viewer ---');
</script>
<script>
    var gridController;
    var dataStore;
    
    function initPage() {
        sforceClient.useCookies = true;
        sforceClient.init("{!API_Session_ID}", "{!API_Partner_Server_URL_70}", true);
    }
    function setup() {
        var soql = document.getElementById("txtSOQL").value;
        sforceClient.query(soql, loadData);
    }
    function loadData(qr){
        data = new Array();
        for (var i=0;i<qr.records.length;i++) {
            data.push(qr.records[i].getData());
        }
        fields = new Array();
        fields = qr.records[0].getFields(); 

        columns = qr.records[0].getColumns(); 
        dataStore = new turbo.data.store();
        dataStore.setData(data, fields);
     gridController = new turbo.grid.controller("grid", dataStore, columns);
    }

    Sforce.Dynabean.prototype.getData = function() { 
     this.data = new Array();
     this.fields = new Array();
     this.columns = new Array();
     for (key in this.getKeys()) { 
      var prop = this.getItem(key); 
      if (prop && prop.className != undefined && prop.className == "Property") { 
       var fldDef = this.definition.fieldMap.getItem(prop.name.toLowerCase());
       if (fldDef != null) { 
           var fieldName = fldDef.name;
           var fieldLabel = fldDef.label;
           var value = this.get(fieldName.toLowerCase());
           
           
           var c = typeToColumnType(fldDef)
           
           this.columns.push(c);
           this.fields.push({name: fieldName});
           this.data.push(value);
           
       } 
      } 
     }
     
     return this.data; 
     
     function typeToColumnType(fldDef) {
         var c = {};
         switch (fldDef.type) {
       case "boolean": 
        c = [ turbo.grid.columns.bool, {name: fldDef.label, width: 58, align: 'center' } ];
        break;
       case "int":
        c = [ turbo.grid.columns.integer, {name: fldDef.label } ];
        break;
       case "currency":
                    c = [ turbo.grid.columns.money, { name: fldDef.label, width: 60, digits: 3} ];
           break;
       case "double":
       case "percent":
        c = [ turbo.grid.columns.decimal, { name: fldDef.label }];
        break;
       case "date":
       case "datetime":
        var ret = [ turbo.grid.columns.date ];
        ret[1] = {};
        ret[1].name = fldDef.label;
        ret[1].width = 150;
        c = ret;
        break;
       case "picklist":
       case "multiselectpicklist":
       case "combobox":
        var plv = fldDef.picklistValues;
        var optionsArray = new Array();
        var valuesArray = new Array();
                 for (var i=0;i<plv.length;i++) {
                  if (plv[i].label != null && plv[i].label != "") {
                   optionsArray.push(plv[i].label);
                   valuesArray.push(plv[i].value);
                  } else {
                   optionsArray.push(plv[i].value);
                   valuesArray.push(plv[i].value);
                  }
                 }
           var ret = [ turbo.grid.columns.enumerated ];
           ret[1] = {};
           ret[1].width = 80;
           ret[1].options = optionsArray;
           ret[1].values = valuesArray; //, { width: 80, options: optionsArray, values: valuesArray } ],
           c = ret;
           break;
       default:
           var ret = [ turbo.grid.columns.basic ];
           ret[1] = {};
        ret[1].name = fldDef.label;
        ret[1].width = 78; // = { name: fldDef.label, width: 78 }, 
        c = ret;
        c = ret;
        break;
      }
      return c;
     }
    };
    Sforce.Dynabean.prototype.getFields = function() { 
        return this.fields;
    }
    Sforce.Dynabean.prototype.getColumns = function() { 
        return this.columns;
    }


    var data;
    var fields;
    var columns;

 selectTheme = function() {
  grid.setTheme(turbo.$("themeselect").value);
 }
function btnRun_onclick() {
    setup();
}

</script>
</head>
<body>

<div class="banner"></div>
<div class="page">
<div class="text bigText outline">If you need a high-level grid with tons of features, here it is. &nbsp; Enter an
    arbitray, but syntactically correct SOQL<br />
    statement, then click Run Query.&nbsp; Try a SOQL that returns a picklist field.&nbsp;
    Although the grid is editable, the<br />
    code for persisting edits back to salesforce.com has not been implemented (any changes
    to the values won't<br />
    permanently change your data).<br />
    <br />
    <textarea id="txtSOQL" style="width: 587px; height: 56px">Select Id, FirstName, LastName From Contact</textarea>&nbsp;
    <input id="btnRun" style="width: 86px" type="button" value="Run Query" onclick="return btnRun_onclick()" /><br />
 <!-- Grid must have a dimensioned container for IE6 -->
 <div style="width: 702px; height: 323px; overflow: hidden; border: 1px solid silver;">
  <div id="grid" autosize="true" dojoType="TurboGrid" oninit="initPage"></div>
 </div>
</div>

</body>

</html>
 
 
Cheers and good luck!
 

Message Edited by DevAngel on 03-24-2006 05:07 PM