• scottskiblack
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 18
    Replies
I got the zip code validations from the Salesforce Winter 07 Release notes, that have many USA zip code validations but they do not work anymore.

For instance the below validation on the Lead object does validate for the USA but also tries to validate when other countries are entered as well, like Canada in the Country field.

OR(
AND(
OR(Country = "United States", LEN(Country) = 0),
LEN(PostalCode) <>5, LEN(PostalCode) <>
10),
NOT(CONTAINS("0123456789", LEFT( PostalCode, 1))),
NOT(CONTAINS("0123456789", MID( PostalCode , 2, 1))),
NOT(CONTAINS("0123456789", MID( PostalCode , 3, 1))),
NOT(CONTAINS("0123456789", MID( PostalCode , 4, 1))),
NOT(CONTAINS("0123456789", MID( PostalCode , 5, 1))),
AND(
LEN(PostalCode) = 10,
OR(
MID( PostalCode , 6, 1) <> "-",
NOT(CONTAINS("0123456789", MID( PostalCode , 7,
1))),
NOT(CONTAINS("0123456789", MID( PostalCode , 8,
1))),
NOT(CONTAINS("0123456789", MID( PostalCode , 9,
1))),
NOT(CONTAINS("0123456789", MID( PostalCode , 10,
1))))
)
)


Why do these validations not work anymore?
Hello,

I am trying to sum the amounts from a group of Opportunities.  But I get a NaN (Not a Number) returned when trying to total up the amounts.  See code below.  I have tried to parse to a float, number, etc. but with no luck.  What am I missing?

Thanks!

<html>
<head>
<script src="/soap/ajax/9.0/connection.js"></script>
<script src="/js/dojo/0.4.1/dojo.js"></script>

<script>
dojo.addOnLoad(init);

function init() {
var callback = {
onSuccess : displayResult,
onFailure : displayError
};
sforce.connection.query("SELECT Amount FROM Opportunity WHERE CloseDate = THIS_YEAR AND IsWon = true AND Probability = 100", callback);
}

function displayResult(result) {
var it = new sforce.QueryResultIterator(result);
var html = [];
var totalAmount;

while(it.hasNext()) {
var record = it.next();
totalAmount += parseFloat(record.Amount);
html.push("Amount = " + record.Amount + "<br>");
html.push("<hr>");
html.push("<br>");
}
alert(totalAmount);
document.getElementById("output-div").innerHTML = html.join("");
}

function displayError(error) {
document.getElementById("output-div").innerHTML =
"oops something went wrong ... " + error;
}
</script>


</head>
<body>

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

</body>
</html>
What versions of Dojo does SFDC support? 
Is there a way to use the graphs (bar charts, stacked, etc) that Salesforce reporting already uses?
I am looking for the lightest way to create a dashboard with an s-control using Dojo or SFDC API...

I am creating a new case with the API in ASP.NET with VB.NET, got this to work.  I would like to set the recordType to one of three types I have setup in SFDC.  But with my Case object the recordType can only be set to a sforce.recordType, Error    1    Value of type 'String' cannot be converted to 'sforce.RecordType'.    How do you set the record type of a new case with the API?

Message Edited by scottskiblack on 05-01-2007 02:35 PM

I am trying to create a new case with a form on a web page (ASP.NET with VB.NET).  The code behind to process the form and insert is as follows.  Fails at Try creating the case.

        Dim binding As sforce.SforceService
        binding = Nothing
        Dim SFLogin As New Main
        SFLogin.login()

        'First we will create an account object array, all calls are batch
        'ours is a single element batch
        Dim SFDCcases(1) As sforce.sObject
        Dim SFcase As sforce.Case = New sforce.Case

        'instantiate the new account object
        Dim qr As sforce.QueryResult = Nothing

        'Set several properties
        SFcase.First_Name__c = FirstName.Text
        SFcase.Last_Name__c = LastName.Text
        SFcase.Street_Address__c = Address.Text
        SFcase.City__c = City.Text
        SFcase.State_Province__c = State.Text
        SFcase.Postal_Code__c = Zip.Text
   
        SFDCcases(0) = SFcase

        Dim saveResults() As sforce.SaveResult = Nothing
        Try
            saveResults = binding.create(SFDCcases)  ' ERROR Object reference not set
                                                                                    ' to an instance of an object.)
        Catch ex As Exception
            ERRORTXT.Text = ex.Message
            recordType.Text = ex.Source
            status.Text = ex.StackTrace
        End Try



When a Dashboard is viewed, for instance on the home page when a user signs in, is that report behind the dashboard being run and the last date run updated?  I would like to set up an archiving / delete of old unused reports but do not want to remove any reports used by current dashboards.  This is why I ask if the last date run is updated on reports when a dashboard is viewed.

Thanks!
I have used the API to populate a drop down list for the Contacts, this is in a form that is used for Web-to-Case.   When submitting to the queue, all goes well except the Contact Name is not inserted into the case record.  On the debug page which shows the values passes it does show the Contact Name which was selected from the drop down list.  Also, oddly the email generated populates the Contact Name that was selected on the Web-2-Case form but it does not go into the case record.

Are there any known issues for this web-to-case for the contact field?

Thanks!
I have a web-2-case setup, it works all except passing the contact.  I have a drop down list which pulls the contacts into a drop down list.
When submitted in debug mode it shows the contact that was selected as the value for the name of the contact, eg.
Your request has been queued.
Record Information:
 name: Lauren Boyle

Also, the email template generated to the contact shows the name from the dear line, Dear {!Contact.FirstName}.  This shows that name, Lauren Boyle when emailed on a new case.

However, when I go to the actual case record the contact name is not populated.  why?  any suggestions?  Also, I do not get any errors sent to my email for the debug email, it says it is successful.

Thanks for your help.
I am using a function to get Contacts and return an object (sObject).
I have a drop downlist on the page and I set the dataSource to this function which returns the sObjects.  The drop down list is populated with each value being sforce.Contact.  (sforce is the name of my web reference obviously).

Do I have to iterate thru the sObjects and add them to the drop down list or is it possible to use the objects as the data source directly?  I am working in an ASP.NET website using VB.NET.

Thanks!

Message Edited by scottskiblack on 04-24-2007 10:21 AM

How can you validate against the Active checkbox for the user record?  I would like to have a validation rule that if the Active is not checked (deactivated) then the user status pick list can not equal active.
I got the zip code validations from the Salesforce Winter 07 Release notes, that have many USA zip code validations but they do not work anymore.

For instance the below validation on the Lead object does validate for the USA but also tries to validate when other countries are entered as well, like Canada in the Country field.

OR(
AND(
OR(Country = "United States", LEN(Country) = 0),
LEN(PostalCode) <>5, LEN(PostalCode) <>
10),
NOT(CONTAINS("0123456789", LEFT( PostalCode, 1))),
NOT(CONTAINS("0123456789", MID( PostalCode , 2, 1))),
NOT(CONTAINS("0123456789", MID( PostalCode , 3, 1))),
NOT(CONTAINS("0123456789", MID( PostalCode , 4, 1))),
NOT(CONTAINS("0123456789", MID( PostalCode , 5, 1))),
AND(
LEN(PostalCode) = 10,
OR(
MID( PostalCode , 6, 1) <> "-",
NOT(CONTAINS("0123456789", MID( PostalCode , 7,
1))),
NOT(CONTAINS("0123456789", MID( PostalCode , 8,
1))),
NOT(CONTAINS("0123456789", MID( PostalCode , 9,
1))),
NOT(CONTAINS("0123456789", MID( PostalCode , 10,
1))))
)
)


Why do these validations not work anymore?
Hello,

I am trying to sum the amounts from a group of Opportunities.  But I get a NaN (Not a Number) returned when trying to total up the amounts.  See code below.  I have tried to parse to a float, number, etc. but with no luck.  What am I missing?

Thanks!

<html>
<head>
<script src="/soap/ajax/9.0/connection.js"></script>
<script src="/js/dojo/0.4.1/dojo.js"></script>

<script>
dojo.addOnLoad(init);

function init() {
var callback = {
onSuccess : displayResult,
onFailure : displayError
};
sforce.connection.query("SELECT Amount FROM Opportunity WHERE CloseDate = THIS_YEAR AND IsWon = true AND Probability = 100", callback);
}

function displayResult(result) {
var it = new sforce.QueryResultIterator(result);
var html = [];
var totalAmount;

while(it.hasNext()) {
var record = it.next();
totalAmount += parseFloat(record.Amount);
html.push("Amount = " + record.Amount + "<br>");
html.push("<hr>");
html.push("<br>");
}
alert(totalAmount);
document.getElementById("output-div").innerHTML = html.join("");
}

function displayError(error) {
document.getElementById("output-div").innerHTML =
"oops something went wrong ... " + error;
}
</script>


</head>
<body>

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

</body>
</html>
What versions of Dojo does SFDC support? 
Is there a way to use the graphs (bar charts, stacked, etc) that Salesforce reporting already uses?
I am looking for the lightest way to create a dashboard with an s-control using Dojo or SFDC API...

I am creating a new case with the API in ASP.NET with VB.NET, got this to work.  I would like to set the recordType to one of three types I have setup in SFDC.  But with my Case object the recordType can only be set to a sforce.recordType, Error    1    Value of type 'String' cannot be converted to 'sforce.RecordType'.    How do you set the record type of a new case with the API?

Message Edited by scottskiblack on 05-01-2007 02:35 PM

I am trying to create a new case with a form on a web page (ASP.NET with VB.NET).  The code behind to process the form and insert is as follows.  Fails at Try creating the case.

        Dim binding As sforce.SforceService
        binding = Nothing
        Dim SFLogin As New Main
        SFLogin.login()

        'First we will create an account object array, all calls are batch
        'ours is a single element batch
        Dim SFDCcases(1) As sforce.sObject
        Dim SFcase As sforce.Case = New sforce.Case

        'instantiate the new account object
        Dim qr As sforce.QueryResult = Nothing

        'Set several properties
        SFcase.First_Name__c = FirstName.Text
        SFcase.Last_Name__c = LastName.Text
        SFcase.Street_Address__c = Address.Text
        SFcase.City__c = City.Text
        SFcase.State_Province__c = State.Text
        SFcase.Postal_Code__c = Zip.Text
   
        SFDCcases(0) = SFcase

        Dim saveResults() As sforce.SaveResult = Nothing
        Try
            saveResults = binding.create(SFDCcases)  ' ERROR Object reference not set
                                                                                    ' to an instance of an object.)
        Catch ex As Exception
            ERRORTXT.Text = ex.Message
            recordType.Text = ex.Source
            status.Text = ex.StackTrace
        End Try



How can you validate against the Active checkbox for the user record?  I would like to have a validation rule that if the Active is not checked (deactivated) then the user status pick list can not equal active.