I am using the bulk upload code described at http://www.salesforce.com/us/developer/docs/api_asynch/.
The only difference is that i am uploading a custom object type. I can access Employee_c. But now i get a different error
stateMessage='InvalidBatch : Field name not found : First Name'
First Name is the first column in the csv.
While debugging i can see that the temp csv is being created correctly. However i get this error when checkResults executes. The code is exactly the same as in the sample java code for bulk api using REST.
I am using the free developer version of salesforce.
I created a new permission set where i have given following permissions on custom object employee:
Read/create/edit/delete/view all/modify all.
All fields are given edit permissions.
The permission set is associated with salesforce user license.
The programmatic login is with a user associated with System administrator profile , which has sales force user license.
But still the error persists!
Any pointers would be appreciated
Thanks
Sameer
Try "FirstName" without the space.
You can view the API name of any field in Setup > App Setup > Objects > (Select Your Object) > (Select Your Field). Make sure all the fields you are querying have the correct API names.
Related
I have a salesforce query that extracting users time report
SELECT ID,Logged_Date__c ,CreatedBy.Email, CreatedBy.id, CreatedBy.Name, Time_Spent_Hours__c, Activity__c, CaseId__r.CaseNumber, CaseId__r.Account.id, CaseId__r.Account.Name , Utilized__c
FROM Time_and_Placement_Tracking__c
The Activity__c returns with the activity text.
I was trying to use Activity__c.Id, Activity__r etc. but all returns with error.
Is there a way to get the Activity id?
Verify these
You need to get to the object definition and see the field info. You can use workbench or any other API tool if you are familiar with and get the object and field def's.
Check the data type for Activity__c field. It should be a lookup/master relation. If it is not, find the field which ties to Activity object.
Open the field to get the API name and use that in the query with a '__r' extension.
I'm trying to write a SOQL query that will grab one of the Contact object's standard fields "Contact Owner", which is a Lookup(User) field:
The field name is "Owner", but when I try to query
SELECT Contact.Owner FROM Contact
I get an error stating that there is no such field.
SELECT Contact.Owner, Contact.Name, Contact.Rule_Class__c
^
ERROR at Row:1:Column:8
No such column 'Owner' on entity 'Contact'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
How can I grab this field?
Thank you!
That's a normal behavior for Relation fields
You can imagine OwnerId as an alias
SELECT LastModifiedBy.Name, LastModifiedBy.Id, LastModifiedById FROM Contact
SELECT CreatedBy.Name, CreatedBy.Id, CreatedById FROM Contact
Also use Workbench or Developer console or Eclipse to construct your queries instead of using salesforce setup interface
Workbench
Developer Console
This is strange:
"Select c.Owner.Email, c.Owner.Name, c.Owner.Username, c.OwnerId From
Contact c Run the above in Developer Console--Query Editor"
https://developer.salesforce.com/forums/#!/feedtype=SINGLE_QUESTION_DETAIL&dc=General_Development&criteria=OPENQUESTIONS&id=906F0000000AvMHIA0
I wonder why Contact.Owner comes up as non-existent but Contact.Owner.Name is?
I have a visual force page that references my controlling class 'ESWebCaseController.cls'.
The visual force page has a field called 'Company' that runs on an SF site and is accessible by anyone when the form is submitted is used in a SOQL query like:
List account_list = [SELECT Name FROM Account WHERE Name =:company];
This query returns 0 results when company = Acme, however this same query returns 1 result when done using the Eclipse IDE SF Schema. There is defnately a company named Acme in my org.
When I remove the WHERE clause in the query, 10 Accounts are returnted, even if I set LIMIT 100, only 10 accounts are returned. These 10 accounts seem to have one thing in common and that is that they reference the same parent account and/or have a specific field ID that references the parent account.
I want to know if there is anything that would cause the above query in my controlling class to be limited outside of the Query itself.
Below are the debug logs for the Query:
20:28:32.158 (158986000)|POP_TRACE_FLAGS|[163]|01p500000009goT|ESWebCaseController|APEX_CODE,FINEST;APEX_PROFILING,FINEST;CALLOUT,FINEST;DB,FINEST;SYSTEM,FINEST;VALIDATION,FINEST;VISUALFORCE,FINEST;WORKFLOW,FINEST
20:28:32.159 (159879000)|SOQL_EXECUTE_BEGIN|[163]|Aggregations:0|select Name from Account where Name = :tmpVar1
20:28:32.159 (159893000)|LIMIT_USAGE|[163]|SOQL|1|100
20:28:32.159 (159898000)|LIMIT_USAGE|[163]|AGGS|0|300
20:28:32.177 (177286000)|SOQL_EXECUTE_END|[163]|Rows:0
20:28:32.177 (177308000)|LIMIT_USAGE|[163]|SOQL_ROWS|0|50000
20:28:32.177 (177324000)|HEAP_ALLOCATE|[163]|Bytes:4
20:28:32.177 (177337000)|HEAP_ALLOCATE|[163]|Bytes:0
20:28:32.177 (177411000)|HEAP_ALLOCATE|[163]|Bytes:4
20:28:32.177 (177441000)|VARIABLE_SCOPE_BEGIN|[163]|account_list|LIST<Account>|true|false
20:28:32.177 (177488000)|VARIABLE_ASSIGNMENT|[163]|account_list|{"serId":1,"value":[]}|0x14cace14
20:28:32.177 (177504000)|STATEMENT_EXECUTE|[165]
Are you using with Sharing on your controller and do you have access to the account Acme from the user running the query?
By default classes have "with sharing" so they respect the sharing in the parent org, this means that if the user who accesses the page does not have access to the data the data will not be available for the query.
A quick and easy test for this is to get the Id of the record you need access to and log into salesforce then go to the url directly.
So if the record was a01adf20123032 (that's a made up id fyi) and your instance was na1 you'd log into salesforce and navigate to https://na1.salesforce.com/a01adf20123032 if you get insufficient privileges then the person doesn't have access.
Through the IDE you're most likely using a system administrator user with the "view all data" permission so they'll always get all data returned.
I have this problem: we try to authenticate a user against an Active Directory that uses ForeignSecurityPrinciple to map users from different domains.
We have several groups that are stored inside a single domain and users that are coming from different domains.
The problem we have here is that we cannot get the real user name from ForeignSecurityPrinciple.
We tried to use the guidelines from here:
http://www.brandonclaps.com/?p=57
but with no luck.
When we tried to edit the entry for group that had 3 members, we found this next to the member field:
CN = S-1-5-21-other numbers, CN=ForeignSecurityPrinciple; DC=DomainName, DC=local
Do you have other solutions for retrieving the username against Active Directory using ForeginSecurityPrinciple ?
Is there any recommendation for using that?
Thanks a lot in advance
What I am looking to do is Make it the "Account" name field require a unique name.
Basically If one of my reps tries to create an account, and that account all ready exists it tells them no that account all ready exists.
Salesforce tells me this funicality is not build into sales force. Any help or dirrection would we wonderfull.
Make a new text field, call it Name__c. Mark it as unique, length... probably 80, same as Name field length.
Create new Workflow rule with condition ISNEW() || ISCHANGED(Name) || ISBLANK(Name__c) and the action should be a field update that simply has Name in the formula that determines new value.
Remember to activate the workflow and to fill in the newly created field because it will be blank for all your existing accounts!
Your call if you want to show the field on page layouts (it's quite "technical" so could be hidden). If you do - it's a good idea to make it readonly!
You can use this validation:
AND(CONTAINS(VLOOKUP( $ObjectType.Account.Fields.Name , $ObjectType.Account.Fields.Name, Name), Name), OR(ISNEW(), ISCHANGED(Name)) )
Salesforce offers duplication management for this purpose.
You just set up Matching Rules and Duplicate Rules for your Account object in Setup > Administration Setup > Data.com Administration > Duplicate Management.
Link: https://help.salesforce.com/apex/HTViewHelpDoc?id=duplicate_prevention_map_of_tasks.htm&language=en_US
You could write a trigger to prevent duplicates. It'd be a "before insert" trigger that queried for existing accounts with the same name. If an Account name already exists, you'd call addError() on the new Account record, preventing the insert from continuing.
Have you searched the AppExchange for solutions? Might want to check out something like DupeCatcher
You could always make a custom field to contain the account name (something like "Business Name") and then ensure that's required and unique.
You'd need to do some basic Data Loader gymnastics to move your account names to the new field, and come up with a strategy for populating the existing Name field for accounts.
AND(VLOOKUP($ObjectType.Object_Name.Fields.Name, $ObjectType.Object_Name.Fields.Name, Name) = Name, OR(ISNEW(), ISCHANGED(Name)))