• rmcubed
  • NEWBIE
  • 0 Points
  • Member since 2005

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies
first post to this forum! I am seeing some odd behaviour when trying to create a contract. Basically, a whole bunch of fields do not show up with values, even though no error is generated, and I can see the values prior to the create call.

For example, the contract created by my test case below does not end up having a start date or an end date or a contract term. In more complex examples, it also applies to some of my custom fields. Can anyone verify this on their set-up, and/or suggest any solutions?

Here's the code:

Private Sub btnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTest.Click
Dim sfSession As sforce.SforceService
Dim sfcs(0) As sforce.Contract
Dim sfR(0) As sforce.SaveResult
sfcs(0) = New sforce.Contract
sfcs(0).Name = "Test contract"
sfcs(0).StartDate = #1/1/2004#
sfcs(0).ContractTerm = 24
'use any known AccountID here
sfcs(0).AccountId = "001200000022brN"
'use your own values for the login
sfSession = Login(txtSFUsername.Text, txtSFPassword.Text)
sfR = sfSession.create(sfcs)
If sfR(0).success Then
Trace.WriteLine("Success - ID " & sfR(0).id)
Else
Trace.WriteLine("Failure: " & sfR(0).errors(0).message)
End If
MsgBox("Complete")
End Sub
Private Function Login(ByVal Username As String, ByVal Password As String) As sforce.SforceService
Dim sfSession As New sforce.SforceService
Dim objSFloginRes As sforce.LoginResult
objSFloginRes = sfSession.login(Username, Password)
sfSession.SessionHeaderValue = New sforce.SessionHeader
sfSession.SessionHeaderValue.sessionId = objSFloginRes.sessionId
sfSession.Url = objSFloginRes.serverUrl
Return sfSession
End Function

If I assign a Lead to a queue using the API, by assigning its OwnerID to the Id of the queue, no email notification seems to be fired which is annoying. Is this expected behaviour?

 

If I created a lead using the API but instead of assigning its ownerID to a queue, I specified a specific assignment rule, so that the lead is put into the right queue rather than directly, could I expect the email notification then?

 

It would be tedious to have to generate my own notification messages.

 

 

first post to this forum! I am seeing some odd behaviour when trying to create a contract. Basically, a whole bunch of fields do not show up with values, even though no error is generated, and I can see the values prior to the create call.

For example, the contract created by my test case below does not end up having a start date or an end date or a contract term. In more complex examples, it also applies to some of my custom fields. Can anyone verify this on their set-up, and/or suggest any solutions?

Here's the code:

Private Sub btnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTest.Click
Dim sfSession As sforce.SforceService
Dim sfcs(0) As sforce.Contract
Dim sfR(0) As sforce.SaveResult
sfcs(0) = New sforce.Contract
sfcs(0).Name = "Test contract"
sfcs(0).StartDate = #1/1/2004#
sfcs(0).ContractTerm = 24
'use any known AccountID here
sfcs(0).AccountId = "001200000022brN"
'use your own values for the login
sfSession = Login(txtSFUsername.Text, txtSFPassword.Text)
sfR = sfSession.create(sfcs)
If sfR(0).success Then
Trace.WriteLine("Success - ID " & sfR(0).id)
Else
Trace.WriteLine("Failure: " & sfR(0).errors(0).message)
End If
MsgBox("Complete")
End Sub
Private Function Login(ByVal Username As String, ByVal Password As String) As sforce.SforceService
Dim sfSession As New sforce.SforceService
Dim objSFloginRes As sforce.LoginResult
objSFloginRes = sfSession.login(Username, Password)
sfSession.SessionHeaderValue = New sforce.SessionHeader
sfSession.SessionHeaderValue.sessionId = objSFloginRes.sessionId
sfSession.Url = objSFloginRes.serverUrl
Return sfSession
End Function
Hi again,

I'm trying to use a query to determine if any new Accounts where created over a certain date range. I keep getting a "MALFORMED QUERY" exception for my datetime value. Looking at the API docs, it says I need to use the date format "2005-10-24" or "2005-10-24T12:11:00" (which is what I'm using).

I think the problem is when I pass the DateTime object into the query string, the API calls ToString() on it and ToString() always formats the date to "10/24/2005" which causes the exception.

I'm using .NET C# environment.

Here's a code snippet:

DateTime startDate = DateTime.ParseExact("2005-10-24T00:00:00", "s", cultureInfo);
QueryResult result = _sforceService.query("select FirstName, LastName, CreatedDate from Contact where CreatedDate >= " + startDate);

Thanks!
  • October 24, 2005
  • Like
  • 0