• Singer-Clark
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 5
    Likes Given
  • 8
    Questions
  • 9
    Replies
I get this error in the results of a Bulk API upsert:

'NUMBER_OUTSIDE_VALID_RANGE:Normalized Score: value outside of valid range on numeric field: 100.0:normalized_score__c --'

The metadata for that custom object uses 'type': 'Number', 'precision': 10, 'scale': 8.

Is range referring to the value, as in a minimum and maximum value, that 100.0 is not between?

Or does it have to do with 'scale' or 'precision' (which seem plenty high to incorporate the number 100.0)?

More generally, how does one resolve this? I don't even know what "valid range" is in play here, so any help is much appreciated.
I'm trying to interact with Metadata API from Python, for multiple different Salesforce accounts / organizations.

I'm using OAuth flow so nobody needs to give me their username + password, and can just reuse the OAuth process we went through for use with REST API.

The docs say that the login request (which uses username + password) is how you get the sessionID and Metadata API server url in order to make subsequent requests. The docs (e.g. [here](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_quickstart_java_sample.htm)) say you can use OAuth instead, and replace sessionID with the access token you get from OAuth.

But what about the other part, the server url? If OAuth replaces that login request, how can I get this Metadata API server url (or make requests without it, or whatever)?
I'm using Python [zeep](http://docs.python-zeep.org/en/master/) to use SOAP to interact with Salesforce's Metadata API.

I'm attempting to start with the simplest thing possible, just log in and read a metadata object.


    from zeep import Client as zClient
    
    client = zClient('sf_config/sf_metadata_40.xml')
    
    // readMetadata method exists, prints <zeep.client.OperationProxy object at ...>
    print client.service.readMetadata

    // errors because login method does not exist
    print client.service.login

I know the zeep client reads the XML because it correctly knows that `readMetadata` exists, but I'm confused about how I am supposed to log in with my Salesforce username and password. I expected a `login` method to exist.

Additionally, I tried adding username and password to the construction of the `client` object:

    from zeep.wsse.username import UsernameToken

    client = zClient('sf_config/sf_metadata_40.xml',
                     wsse=UsernameToken('bub@bob.com', 'scary_secretPassW*rd'))

but it was unsuccessful, in that, executing the `readMetadata` method caused this error:  
`Fault: UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService`

(The Java examples in Salesforce docs use a `connection` object that I'm not really sure what the Python zeep equivalent would be, so I don't have an example to go off of.)

UPDATE:  
That error brings this to mind, from the [docs](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_calls_intro.htm):
> Retrieve the metadataServerUrl from the LoginResult returned by your SOAP API login() call.

But I'm not sure what the `login()` call is, since such a method does not exist on the `client.service`.
There is another question about uniqueness of Salesforce ID's globally across all organizations, but the answers are conflicting (one says yes, another says no). So I'm asking here again, and also wondering if there is a source (documentation, further explanation, etc.) to confirm it?
The documentation at https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_emailmessage.htm says there is a ContentDocumentIds field on the EmailMessage which could be used to go through a ContentDocumentLink object, then (using the ContentDocumentId field) through a ContentDocument object, and finally (using the
LatestPublishedVersionId field) to a ContentVersion object which holds the attached file's data.

The problem is that when I make a describe call to EmailMessage, "ContentDocumentIds" is not one of the fields listed.

Additionally, when I use SOQL to grab EmailMessages that have HasAttachment = True, and I SELECT the ContentDocumentIds field, while it doesn't error (surprising, since it's not listed as a field in the describe call), the value is None every time. So there is a few pieces of evidence that my approach is wrong.

Is there a way to get attachment data associated with an EmailMessage?

Querying the API using SOQL, I'm seeing a Case object with a non-empty Description field ("Return box is ..."), but when I look at the list of CaseHistory objects for this Case, the latest (and only) update to the Description field has

{... 'OldValue': None, 'NewValue': None, ...}

I have a couple questions, in trying to understand this:

1) Are there fields (like Description) for which CaseHistory objects don't show the old and new values (perhaps because they can be large)?
2) Could this be a bug in Salesforce, and if so is there a process for getting it resolved?
3) Am I actually misunderstanding something and this behavior is actually expected?

Thank you!

I'm making an app for Service Cloud users. Wondering about Salesforce's API with regard to voice solutions, i.e. call centers.

Seems that there's not a voice solution built-in to Salesforce, but that users have the option of integrating Apps such as Five9 and TalkDesk (and anything else here: https://appexchange.salesforce.com/category/telephony).

For accounts using one of these call center apps,
1) how are voice calls represented in the API (which objects represent the call recording, with which connections to other objects)?
2) how do they relate to Case objects, and User/Contact objects?
3) is it different depending on the voice solution (Five9 vs. TalkDesk vs. InContact), or is it standardized at all?

As a non-advanced Service Cloud user (only just set up, and set up Email-To-Case), but also a developer trying to accommodate more advanced Service Cloud users, I'm trying to understand how customers interact with Cases; in the dashboard, as well as how it gets stored in the API objects.

I know a customer can Email an address (like mysupport@mycompany.com) and that will create a Case, a CaseFeed of type 'EmailMessageEvent', and an associated EmailMessage.

But are there other ways besides emails (e.g. direct replies/posts in a dedicated support website)?

(I'm creating an app, part of which involves collecting CaseFeeds in order to display the Case conversations, but I need to know if I need to display anything else for customers, besides emails. I am currently displaying other things a user can do, because I know of them from seeing the Service Cloud dashboard and seeing the buttons for Reply, Post, Upload File, etc. But not sure what options customers have.)
I get this error in the results of a Bulk API upsert:

'NUMBER_OUTSIDE_VALID_RANGE:Normalized Score: value outside of valid range on numeric field: 100.0:normalized_score__c --'

The metadata for that custom object uses 'type': 'Number', 'precision': 10, 'scale': 8.

Is range referring to the value, as in a minimum and maximum value, that 100.0 is not between?

Or does it have to do with 'scale' or 'precision' (which seem plenty high to incorporate the number 100.0)?

More generally, how does one resolve this? I don't even know what "valid range" is in play here, so any help is much appreciated.
I'm using Python [zeep](http://docs.python-zeep.org/en/master/) to use SOAP to interact with Salesforce's Metadata API.

I'm attempting to start with the simplest thing possible, just log in and read a metadata object.


    from zeep import Client as zClient
    
    client = zClient('sf_config/sf_metadata_40.xml')
    
    // readMetadata method exists, prints <zeep.client.OperationProxy object at ...>
    print client.service.readMetadata

    // errors because login method does not exist
    print client.service.login

I know the zeep client reads the XML because it correctly knows that `readMetadata` exists, but I'm confused about how I am supposed to log in with my Salesforce username and password. I expected a `login` method to exist.

Additionally, I tried adding username and password to the construction of the `client` object:

    from zeep.wsse.username import UsernameToken

    client = zClient('sf_config/sf_metadata_40.xml',
                     wsse=UsernameToken('bub@bob.com', 'scary_secretPassW*rd'))

but it was unsuccessful, in that, executing the `readMetadata` method caused this error:  
`Fault: UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService`

(The Java examples in Salesforce docs use a `connection` object that I'm not really sure what the Python zeep equivalent would be, so I don't have an example to go off of.)

UPDATE:  
That error brings this to mind, from the [docs](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_calls_intro.htm):
> Retrieve the metadataServerUrl from the LoginResult returned by your SOAP API login() call.

But I'm not sure what the `login()` call is, since such a method does not exist on the `client.service`.

Querying the API using SOQL, I'm seeing a Case object with a non-empty Description field ("Return box is ..."), but when I look at the list of CaseHistory objects for this Case, the latest (and only) update to the Description field has

{... 'OldValue': None, 'NewValue': None, ...}

I have a couple questions, in trying to understand this:

1) Are there fields (like Description) for which CaseHistory objects don't show the old and new values (perhaps because they can be large)?
2) Could this be a bug in Salesforce, and if so is there a process for getting it resolved?
3) Am I actually misunderstanding something and this behavior is actually expected?

Thank you!

As a non-advanced Service Cloud user (only just set up, and set up Email-To-Case), but also a developer trying to accommodate more advanced Service Cloud users, I'm trying to understand how customers interact with Cases; in the dashboard, as well as how it gets stored in the API objects.

I know a customer can Email an address (like mysupport@mycompany.com) and that will create a Case, a CaseFeed of type 'EmailMessageEvent', and an associated EmailMessage.

But are there other ways besides emails (e.g. direct replies/posts in a dedicated support website)?

(I'm creating an app, part of which involves collecting CaseFeeds in order to display the Case conversations, but I need to know if I need to display anything else for customers, besides emails. I am currently displaying other things a user can do, because I know of them from seeing the Service Cloud dashboard and seeing the buttons for Reply, Post, Upload File, etc. But not sure what options customers have.)
We have two orgs within our company and they both send Case data to a legacy Application. Are the Case Ids unique across both the Orgs?

From http://wiki.developerforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com#Token_Refresh:

In this situation, the client application can use the refresh token to obtain a new access token. The refresh token represents the user's access grant to the application, and is valid until explicitly revoked by the user, via Setup ➤ My Personal Information ➤ Remote Access.

This is untrue.

I have a remote application that uses the OAuth web server flow. After I generate refresh and access tokens for a user, I fetch that user's data (accounts, contacts, leads, etc.) periodically. When the access token expires I generate a new one using the refresh token. This all happens in a long running process.

If I kill this process and start it up the next day or a few hours later, I receive an error message from the API telling me that the access token / refresh token has expired. If I try to refresh the token, I receive the same error message from the refresh token API endpoint. I take this to mean that the refresh token has also expired.

The user has not revoked access to the application nor has logged into any salesforce related applications or created any new salesforce browsing sessions. So nothing has happened except the passing of time.

Why is this happening? Can I prevent this in any way? As it stands now, this totally defeats the purpose of the refresh token schema.

Update:

Since there are no replies and many views: Does anyone periodically fetch data from salesforce accounts without storing a user's username and password, and without having the user's constantly reauthorize your external application? What does your workflow look like?

Hello Guys,
I am inserting a record for "Account" object and I am getting error "Geolocation1: value outside of valid range on numeric field:". I have lat value "
104.8789". I have cheked Accoumt Object details and "precision"  value is "13" and "scale" value is "10".

Any help would be much appreciated.

Thanks

Hi there,

 

After few hours trying to make it works, I find myself stuck and need your advice. I'm trying to implement the oauth2 workflow for our app, but I'm stuck with the redirect_uri...

 

We have 2 issues here:

 1 - Our redirect uri looks like the following

https://domain.com/rest/<user_id>/user/connect/salesforce?at=<credentials>

 

Where user_id is the id of  current user (obvious) and at=<credentials> is mandatory because our endpoint is secured and the call will fail without this value.

 

The problem here is that the redirect uri is different from one user to another because it contains the user_id. 

 

So I managed to change the previous url into

https://domain.com/rest/~/user/connect/salesforce?at=<credentials>&user_id=<user_id>

 in order to make the uri the same for all the user and be able to configure the application oauth callback.

 

2 - The second problem is that after the user authorized our application Salesforce redirect it to the specified redirect uri... But it has removed the query string parameters at and user_id... so we got stuck because our endpoint fails because the at param is missing and we're unable to determine who is the current user without the user_id param.

 

any idea?

 

I saw that people usually use the state parameters to pass data accross the steps, but I'm not a big fan Why do you remove the query string parameters from the redirect uri instead of just adding yours?

 

Regards,

 

Philippe

Hi I am getting the error: "There is already a Child Relationship named" for the following fields for ANT script migration.

 

Error: objects/Bid_Request__c.object(658,13):There is already a Child Relationship named RFPs on User.
Error: objects/Bid_Request__c.object(681,13):There is already a Child Relationship named Bid_Requests on Opportunity.
Error: objects/Bid_Request__c.object(713,13):There is already a Child Relationship named Bid_Requests1 on User.
Error: objects/Bid_Request__c.object(725,13):There is already a Child Relationship named Bid_Requests on Contact.
Error: objects/Bid_Request__c.object(748,13):There is already a Child Relationship named Bid_Requests on Account.
Error: objects/Bid_Request__c.object(952,13):There is already a Child Relationship named Bid_Requests on User.

 

This is basically parent child relationship between, standard objects (Opportunity,User,Contact,Account) and new custom object "BidRequest".


When i first deployed from dev to sandbox the deployment worket fine.Then i deleted all the deployed custom objects.
Later when i again did a new deployment it failed.


What is really strange is on the target environment(sandbox) no custom fields exists with the above mentioned "relationshipLabel" but still i keep getting the error.

From http://wiki.developerforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com#Token_Refresh:

In this situation, the client application can use the refresh token to obtain a new access token. The refresh token represents the user's access grant to the application, and is valid until explicitly revoked by the user, via Setup ➤ My Personal Information ➤ Remote Access.

This is untrue.

I have a remote application that uses the OAuth web server flow. After I generate refresh and access tokens for a user, I fetch that user's data (accounts, contacts, leads, etc.) periodically. When the access token expires I generate a new one using the refresh token. This all happens in a long running process.

If I kill this process and start it up the next day or a few hours later, I receive an error message from the API telling me that the access token / refresh token has expired. If I try to refresh the token, I receive the same error message from the refresh token API endpoint. I take this to mean that the refresh token has also expired.

The user has not revoked access to the application nor has logged into any salesforce related applications or created any new salesforce browsing sessions. So nothing has happened except the passing of time.

Why is this happening? Can I prevent this in any way? As it stands now, this totally defeats the purpose of the refresh token schema.

Update:

Since there are no replies and many views: Does anyone periodically fetch data from salesforce accounts without storing a user's username and password, and without having the user's constantly reauthorize your external application? What does your workflow look like?

I'm looking to find the object types of the WhatId/WhoId fields of the Task and Event objects, so I can query these objects and get more information about them and perform certain automated tasks based on the type.

I found this tech article, which uses the first 3 digits as a marker, but the article also says that this may change at any time:

http://www.sforce.com/us/resources/tn-1.jsp

Is there a better way of getting the object types of WhatId/WhoId fields or querying them based on Id only (no type)?

Thanks!