function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

cannot create accounts

Newbie here again. I�ve managed to get my program to update to the DEV site, however, my production level code does not seem to update on Salesforce�s side. I do not get any errors when I run, and even get the final message I have built in saying X files written. I have generated a wsdl for our enterprise and have each of the needed fields referenced properly (I think). Any suggestions? Thanks in advance




SQL statements and login statements above this section



Dim account1 As Enterprise.Assets__c

Dim account As Enterprise.Account

Dim accs(1) As Enterprise.sObject

account1 = New Enterprise.Assets__c

account = New Enterprise.Account

If accounts Is Nothing Then

account.AccountNumber = "0000000"


account.AccountNumber = "000000" & (accounts.Length & 1)

End If

account1.Name = "test" 'r1("model")

account1.Type__c = "copier"

account1.Customer_Number__c = R1("CUSTOMER_NUMBER")

account1.Make__c = "sharp"

account1.Vendor__c = "ABS"

account1.Contract__c = "1ch"

account1.Model__c = "DR5020"

account1.OwnerId = "BBSJAX"

accs(0) = account1


Catch ex As Exception

Console.WriteLine(vbCrLf & "Failed to create account, error message was: " & vbCrLf & ex.Message)

End Try

End If


Catch statements for me below here


Hmm... not sure what is happening here.  Can you remove the unused sample code from you post and just put the code that you want executed in?  It's a little difficult to determine what you are doing.  If you are not create an Account, remove the lines that reference the account variable.

Also, what are you expectiing to see (how are you determining that it is not working)?

Curtis ParisCurtis Paris

I couldn't execute your code, but, the one thing that stands out is your OwnerId.  Normally your ID's are an "ID" object.

The string value normally would look something like: "00530050000cmhmABA"

By default the OwnerId will be set to the current user.  Try just removing that line and see if it works.