• Dr. Thomas Miller
  • NEWBIE
  • 199 Points
  • Member since 2015
  • Atos

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 24
    Questions
  • 31
    Replies
Hi,
my challenge when doing the above mentioned module fails with the following error:

"The test method doesn’t insert an opportunity with the correct fields. Double check the Name, StageName, and CloseDate and try again."

The requirement is as follows:
In the test method, create an opportunity with the following fields.
Name: 'Sell 100 Widgets'
StageName: 'Prospecting'
CloseDate: Date.today().addMonths(3)


And the code is this:
    Opportunity opp =  new Opportunity(Name='Sell 100 Widgets',
           CloseDate=System.Date.today().addMonths(3),
           StageName='Prospecting');
    insert opp;


Any idea what could be wrong?

 
How can I change the digital signature of a connected app after it is created?
Is it possible to map one APEX class to urlmapping='/Users/.search' and a second one to urlmapping = '/Users/*' ?
or do I have to define one entry class, parse the URL and then switch to the appropriate code?

Some examples in the net seem to suggest that urlmapping supports kind of regular expressions - but nothing like that is mentioned in the documentation.
When you try to create a user and send
 
    "phoneNumbers":[
        {
            "type": "work",
            "value": "02111234567"
        },
        {
            "type": "mobile",
            "value": "01721234567"
        }
    ]
 
you get an error
 
{
    "schemas": "[\"urn:ietf:params:scim:api:messages:2.0:Error\"]",
    "detail": "INVALID:only_a_single_phone_is_allowed",
    "status": 409
}
 
This happens although you can send either a work number (stored in Phone) or a mobile number (stored in MobilePhone) - and a GET call returns both numbers when the are set.
So the create (POST) or full update (PUT) request should be able to accept two numbers as well.
The SCIM schema (as returned from a /Schemas call) contains

        {
            "id": "urn:salesforce:schemas:extension:2.0",
            "name": "urn:salesforce:schemas:extension:2.0",
            "type": "complex",
            "description": "Salesforce User extensions",
            "schema": "urn:salesforce:schemas:extension:2.0",
            "endpoint": "/Individuals",

            "attributes": [
                {
                    "name": "alias",
                    "type": "string",
                    "description": "8 character nickanme",
                    "mutability": "readWrite",
                    "required": false,
                    "caseExact": false
                }
            ],
            "meta": {
                "location": "https://{Server Name}/services/scim/v2/Schemas/urn:salesforce:schemas:extension:2.0",

                "resourceType": "Schema"
            }
        }


but calling

https://{{Server Name}}/services/scim/v2/Individuals


returns


    {
        "errorCode": "NOT_FOUND",
        "message": "Could not find a match for URL"
    }


How do I get access to the alias attribute?
I call (from SSJS)

api.updateBatch('Subscriber',updateObjects,options)

with options set to

options = {

       RequestType: 'Asynchronous',
    SendResponseTo: [{ResponseType:'email',
                     ResponseAddress:'myemailaddress',
                     RespondWhen:'Always',
                     IncludeResults:true,
                     IncludeObjects:true,
                     OnlyIncludeBase:false}]
 }


but the result of the call says

{"Status":"OK","RequestID":"34b5be92-18ff-4480-925a-23a5fb3e79b6","Results":[{"Object":{"SubscriberKey":"0036E00000YgkZsQAJ",...},...,"StatusCode":"OK","StatusMessage":"Updated Subscriber.",...,"RequestType":"Synchronous",...

Does this mean that asynchronous processing is not supported when you do SOAP calls via WSProxy?
I am firing a SOAP request to Marketing Cloud to update a subscriber, and get back a "400 Bad request" error.
The call is modeled against the example from , except that is used an OAuth token - but the username/password version doesn't work either.
Any idea what is wrong?
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:par="http://exacttarget.com/wsdl/partnerAPI">
   <soapenv:Header>
   <fueloauth>authtoken</fueloauth>
   </soapenv:Header>soapenv:Header>
   <soapenv:Body>
      <par:UpdateRequest>
         <par:Options/>
         <par:Objects xsi:type="Subscriber">
           <PartnerKey xsi:nil="true"/>
           <ObjectID xsi:nil="true"/>
            <par:Attributes>
                <par:Name>First Name</par:Name>
                <par:Value>Updated</par:Value>
            </par:Attributes>
            <par:SubscriberKey>0036E00000V1YtyQAF</par:SubscriberKey>
         </par:Objects>
      </par:UpdateRequest>
   </soapenv:Body>
</soapenv:Envelope>
If a formula field value on a record changes without the record being modified itself (last modification date), will the getUpdated() call of the replication API include this record's ID?
We are uploading test contacts (all for the same account) with Dataloader. There is a process builder flow which updates a count on account whenever a contact is added.
The upload runs successfully when 10 contacts are uploaded - but fails with ALL_OR_NONE_OPERATION_ROLLED_BACK when 20 contacts are uploaded. As all contacts are copies of the same the issue cannot be on the contact.
Looking into debug logs it seems that the flow engine defers the account record types to the very end (which makes sense) but then fails without any clear reason. Detailed error message is
"FLOW_ELEMENT_ERROR|The flow tried to update these records: 001D000000yg0j4IAA. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the <a href='https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_concepts_core_data_objects.htm#'>SOAP API Developer Guide</a>."

Is there any undocumented restriction on the maximum of processes accessing the same object at the same time?
The Secret Secure Storage - Named Credentials code that you are asked to inject into APEX is incorrect. Rather than

public string getOpenPortal() { HttpRequest req = new HttpRequest(); req.setEndpoint('callout:MagicPortal'); req.setMethod('GET'); Http http = new Http(); HTTPResponse res = http.send(req); return res.getBody(); }

it should be

public void openPortal() {  HttpRequest req = new HttpRequest();  req.setEndpoint('callout:MagicPortal');  req.setMethod('GET');  Http http = new Http();  HTTPResponse res = http.send(req);  portalStatus = res.getBody() ;  }

I.e. do not return the body but put it into portalStatus.
I would like to create a new child object and link it to the parent object during an insert trigger of the parent.
A similar situation is described in https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_dml_foreign_keys.htm so I tried the following:

trigger TestTrigger on Account (before insert)  {
    Account acc = Trigger.new[0];
    Contact ct = new Contact(LastName = 'Smith');
        // Create the child reference.
        // Used only for foreign key reference
        // and doesn't contain any other fields.
        Contact contactReference = new Contact(MyExtID__c='SAP111111');                
        acc.primaryContact__r = contactReference;
        ct.MyExtID__c='SAP111111'; 
        insert ct;
}

Result: the contact is created but the account is not linked to the contact.

Is there a good way to do this?
(The alternative to call a future method in an after insert trigger which then links the two records is not really elegant.)
If I create an EMailMessage record via SOAP API, the SF system automatically creates an associated task record which is shown in the activity history or open activities related list.
Now, if I did something wrong and delete the EMailMessage record (as I cannot update it) the task record is left.
It can be deleted from the related list UI but doesn't show up in a SOQL query nor in a Data Loader export.
Is there any programmatic way to get rid of these task records?
There seems to be an issue in this trailhead module when running it on Windows. Unencrypting the encrypted server key on the Travis server doesn't work.
This seems to be a known issue (https://github.com/travis-ci/travis-ci/issues/4746) and this alternative (https://docs.travis-ci.com/user/encrypting-files/#Using-OpenSSL) didn't work for me as well.
Bulk API, contrary to data loader, allows to write the polymorphiy WhatId and WhoId fields of an activity.
However, contrary to all documentation, this doesn't work when the object I want to write into WhatId is a custom object - even if this object has activities enabled.
When is this going to be fixed?
I try to upsert events using the Bulk API. The csv file looks like this:

---------------------------------
"Invoice__c:What.ExtId__c","Subject","OwnerId","Type__c","ExtId__c"
"INV_686850","xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","00558000001bxV8","EMail","MSG_10022339"
----------------------------------
Invoice__c is a custom object - it has a field ExtId__c which is defined as unique external id.
Track Activities is enabled, and I can create new events related to an Invoice__c record.

Activity has a custom field ExtId__c added which again is a unique external id.

However, when I run a bulk job with the csv above, i get the error message

 <state>Failed</state>
 <stateMessage>InvalidBatch : Entity type for the polymorphic foreign key reference: What didn't match the supplied type: Invoice__c</stateMessage>
There seems to be a defect in SAML Single Sign-On settings, at least in conjunction with JIT.
We had a a SAML integration working with two IDP providers and using JIT, retrieving the federation id from the subject.
To avoid duplicates between these two providers we changed this to retrieve the federation id from an extra attribute (whose value was designed to differentiate the two IDPs).
-> SAML validator throughs an error "Unable to map the subject to a Salesforce.com user" - note that it talks about subject"
-> no debug logs are created for the JIT handler, so it seems that the JIT handler is not even called
I have read through the (quite inconsistent) documentation on how to attach a custom domain name to my Salesforce org, and I think that I now know how to attach a custom domain name to my community(!):

- create a domain (e.g. www.example.com)
- publish a DNS CNAME which maps www.example.com to www.example.com.00dxx0000001ggxeay.live.siteforce.com
- create a custom URl with domain = www.example.com, site = my community, path as desires

However I do not understand how to proceed if I want to map my Salesforce app (which has a mydomain URL xxx-dev-ed.my.salesforce.com/00dxx0000001ggxeay ) to a custom domain. can I do this? And if yes how?
I am doing a test run of some steps to set up a custom domain name. I created a fresh developer org and enabled communities.
When going to Domain management / Domains there is no way to select "Add a domain".
I do have the relevant permissions (as documented in help section) in the system Administrator profile.
What am I missing?
The DebuggingHeader in the SOAP API is specified in
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/sforce_api_header_debuggingheader.htm. The page says that debugLevel attribute is deprecated and categories attribute should be used instead.
The latest partner WSDL however defines
           <element name="DebuggingHeader">
                <complexType>
                    <sequence>
                        <element name="debugLevel" type="tns:DebugLevel"/>
                    </sequence>
                </complexType>
            </element>

So what is the correct way to use this header?
 
Does anyone know under which conditions a DebuggingInfo response header is returned from Salesforce, e.g. from a create call in Partner WSDL?
I haven't been able to create such a condition.
Some tools, like SAP webMethods, regard output soap:headers as required and complain when not present. I tend to disagree and regard these as optional, but the specs aren't too clear on this point. I could remove the header from the WSDL, but this might be disadvantageous if the header is returned in some cases.
Hi,
my challenge when doing the above mentioned module fails with the following error:

"The test method doesn’t insert an opportunity with the correct fields. Double check the Name, StageName, and CloseDate and try again."

The requirement is as follows:
In the test method, create an opportunity with the following fields.
Name: 'Sell 100 Widgets'
StageName: 'Prospecting'
CloseDate: Date.today().addMonths(3)


And the code is this:
    Opportunity opp =  new Opportunity(Name='Sell 100 Widgets',
           CloseDate=System.Date.today().addMonths(3),
           StageName='Prospecting');
    insert opp;


Any idea what could be wrong?

 
How can I change the digital signature of a connected app after it is created?
The SCIM schema (as returned from a /Schemas call) contains

        {
            "id": "urn:salesforce:schemas:extension:2.0",
            "name": "urn:salesforce:schemas:extension:2.0",
            "type": "complex",
            "description": "Salesforce User extensions",
            "schema": "urn:salesforce:schemas:extension:2.0",
            "endpoint": "/Individuals",

            "attributes": [
                {
                    "name": "alias",
                    "type": "string",
                    "description": "8 character nickanme",
                    "mutability": "readWrite",
                    "required": false,
                    "caseExact": false
                }
            ],
            "meta": {
                "location": "https://{Server Name}/services/scim/v2/Schemas/urn:salesforce:schemas:extension:2.0",

                "resourceType": "Schema"
            }
        }


but calling

https://{{Server Name}}/services/scim/v2/Individuals


returns


    {
        "errorCode": "NOT_FOUND",
        "message": "Could not find a match for URL"
    }


How do I get access to the alias attribute?
I am firing a SOAP request to Marketing Cloud to update a subscriber, and get back a "400 Bad request" error.
The call is modeled against the example from , except that is used an OAuth token - but the username/password version doesn't work either.
Any idea what is wrong?
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:par="http://exacttarget.com/wsdl/partnerAPI">
   <soapenv:Header>
   <fueloauth>authtoken</fueloauth>
   </soapenv:Header>soapenv:Header>
   <soapenv:Body>
      <par:UpdateRequest>
         <par:Options/>
         <par:Objects xsi:type="Subscriber">
           <PartnerKey xsi:nil="true"/>
           <ObjectID xsi:nil="true"/>
            <par:Attributes>
                <par:Name>First Name</par:Name>
                <par:Value>Updated</par:Value>
            </par:Attributes>
            <par:SubscriberKey>0036E00000V1YtyQAF</par:SubscriberKey>
         </par:Objects>
      </par:UpdateRequest>
   </soapenv:Body>
</soapenv:Envelope>
If a formula field value on a record changes without the record being modified itself (last modification date), will the getUpdated() call of the replication API include this record's ID?
Hi,
The SCMI document is too simple and I cannot understand how to call it in details.....So how to do with that?
E.g:

How can I create a User with SCMI and an Account?
How to link them together?
I am trying to create a validation rule within a opportunity object after entering the formula per the Object Manager Challenge
ISPICKVAL( StageName ,"Closed Lost") && ISBLANK( Close_Reason__c ) .I Keep getting the following error:
 Error: Field Close_Reason__c is a picklist field. Picklist fields are only supported in certain function 
Trail head wont allow me to get past he challenge with out the above formula


 
I would like to create a new child object and link it to the parent object during an insert trigger of the parent.
A similar situation is described in https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_dml_foreign_keys.htm so I tried the following:

trigger TestTrigger on Account (before insert)  {
    Account acc = Trigger.new[0];
    Contact ct = new Contact(LastName = 'Smith');
        // Create the child reference.
        // Used only for foreign key reference
        // and doesn't contain any other fields.
        Contact contactReference = new Contact(MyExtID__c='SAP111111');                
        acc.primaryContact__r = contactReference;
        ct.MyExtID__c='SAP111111'; 
        insert ct;
}

Result: the contact is created but the account is not linked to the contact.

Is there a good way to do this?
(The alternative to call a future method in an after insert trigger which then links the two records is not really elegant.)
Hi,

We have a process builder which triggers on the quote line item object and updates a field on Opportunity based on criteria. the conditions work fine however it errors out (usually when there is a lof of quote line items). Since the error is ALL_OR_NONE_OPERATION_ROLLED_BACK., we cannot identify the actual error.

I read the article below and it suggested to try debug log but even with that we did not have much luck with finding the error.
 
https://help.salesforce.com/articleView?id=000247671&type=1
 
My assumption is that the when multiple Quote line records are getting saved at the same time (Steel Brick CPQ saves all the line item records at the same time) and that is triggering multiple update on the same Opportunity with the Fleet_Current_System process. That error is most likely making the Operation to Rollback.
 
There is an idea related to it but it was delivered. From users comments it seems like even though they have bulkified the process builder there are still issues with similar errors.
 
https://success.salesforce.com/ideaView?id=08730000000DhBlAAK&swol=true
 
Not sure if there is anything else we can try to debug the issue. Any suggestion is appreciated.

This report lists the elements that the flow interview executed. The report is a beta feature.
We welcome your feedback on IdeaExchange.
Flow Details
Flow Name: Fleet_System_Current
Type: Workflow
Version: 1
Status: Active
Flow Interview Details
Interview Label: Fleet_System_Current-20_InterviewLabel
Current User: John Crane (00536000000LP9p)
Start time: 10/17/2017 11:46 AM
Duration: 6 seconds
How the Interview Started
John Crane (00536000000LP9p) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = null
myVariable_current = a1N36000006awqCEAQ
ASSIGNMENT: myVariable_waitStartTimeAssignment
{!myVariable_waitStartTimeVariable} Equals {!Flow.CurrentDateTime}
Result
{!myVariable_waitStartTimeVariable} = "10/17/2017 11:46 AM"
DECISION: myDecision
DECISION: myDecision2
DECISION: myDecision4
DECISION: myDecision6
Executed this outcome: myRule_7
Outcome conditions: and
1. {!myVariable_current.SBQQ__Quote__r.SBQQ__Opportunity2__r.Type} (Back-to-Base) Does not equal New Client
2. {!myVariable_current.SBQQ__Quote__r.SBQQ__Opportunity2__r.RecordTypeId} (012360000002xjuAAA) Equals 012360000002xjuAAA
3. {!myVariable_current.SBQQ__Quote__r.SBQQ__Opportunity2__r.Current_Fleet_System2__c} (null) Is null true
4. {!myVariable_current.SBQQ__Quote__r.SBQQ__Opportunity2__r.Current_Fleet_System__c} (Other- see notes) Is null false
Logic: All conditions must be true (AND)
RECORD UPDATE: myRule_7_A1
Find all Opportunity records where:
Id Equals {!myVariable_current.SBQQ__Quote__r.SBQQ__Opportunity2__c} (0063600000TOF7AAAX)
Update the records’ field values.
Current_Fleet_System2__c = {!formula_8_myRule_7_A1_1693834058} (Other- see notes)
Result
Failed to update records that meet the filter criteria.

Error Occurred: The flow tried to update these records: 0063600000TOF7AAAX. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: Record rolled back because not all records were valid and the request was using AllOrNone header. For details, see API Exceptions.
 
If I create an EMailMessage record via SOAP API, the SF system automatically creates an associated task record which is shown in the activity history or open activities related list.
Now, if I did something wrong and delete the EMailMessage record (as I cannot update it) the task record is left.
It can be deleted from the related list UI but doesn't show up in a SOQL query nor in a Data Loader export.
Is there any programmatic way to get rid of these task records?
I've got a bug in my Admin Intermediate trail. It's complete, but shows as 97%. The Efficient Deployments module, where the challenge is complete, shows as not complete. (See screenshot.) Help?

User-added image
There seems to be a defect in SAML Single Sign-On settings, at least in conjunction with JIT.
We had a a SAML integration working with two IDP providers and using JIT, retrieving the federation id from the subject.
To avoid duplicates between these two providers we changed this to retrieve the federation id from an extra attribute (whose value was designed to differentiate the two IDPs).
-> SAML validator throughs an error "Unable to map the subject to a Salesforce.com user" - note that it talks about subject"
-> no debug logs are created for the JIT handler, so it seems that the JIT handler is not even called
I am not able to complete the che challenge "Set Up and Manage Shield Platform Encryption". Everytime it shows "The Case Description field does not appear to be encrypted. Make sure you have records with data in this field." Although I encrypted the Case description filed. Anyone have any idea how to get rid of it. Please help me. I am stucked in this step for two days.
I am trying to generate AWS Cloudfront singed url using apex but every time get Access Denied.

public url is working fine. i.e. jueh890044563.cloudfront.net/test.pdf

But I need a singed url of cloudfront.

I have already done following things in AWS.

S3 bucket is private.
test.pdf is private.
Created cloudfront Distribution (domain name is : jueh890044563.cloudfront.net)

Apex code

String keyPairId = 'YTEHJLKFHHRKF';
Datetime now = DateTime.now();
Datetime expireson = now.addDays(2);
Long Lexpires = expireson.getTime()/1000;

String policyStatement = '{"Statement":[{"Resource":"jueh890044563.cloudfront.net/test.pdf","Condition":{"DateLessThan":{"AWS:EpochTime":'+Lexpires+'}}}]}';

policyStatement = EncodingUtil.base64Encode(Blob.valueOf(policyStatement));

String privateKey = 'dfgdfgtgdfgdfgdfsgdfgdfsgdfgdfgdfgsdf'+
'dfgdfgdfgdfgdfgdfgdfgdfgdfgfgdfgdfsdf'+
'dfdfgdfgdfgdfgdfgfdgdfg/i0AB1Jz20QlGy'+
'dsfgdfgdfgdfgdfgdfgdsfgdfgdfgffdfgdfg';

Blob mac = Crypto.generateMac('HmacSHA1', blob.valueof(policyStatement),blob.valueof(privateKey));
String signed = EncodingUtil.base64Encode(mac);

String downloadUrl = 'jueh890044563.cloudfront.net/test.pdf?Policy='+policyStatement+'&Signature='+signed+'&Key-Pair-Id='+keyPairId;

Is downloadUrl is singedUrl? When we run this url then return Access Denied.

Thanks in advance.
I want to retrieve all the users on Salesforce through SCIM API, at present when we try to fetch more user than 2200
( URL = .....&startIndex=2201&count=200 ) the target throws the exception as below
                     {
                       "Errors": [
                                         {
                                           "description": "Start index too big. Consider filtering down your result set, e.g. id gt \"(the last id in the result set)\"",
                                           "code": 400
                                         }
                                       ]
                    }
                   I need to enquire if there is any way to fetch more number of users without using filters in SCIM.
I can update the user roles using :

{
    "schemas": [
        "urn:scim:schemas:core:1.0",
        "urn:scim:schemas:extension:enterprise:1.0"
    ],
    "id": "00528000001EhgD",
   "displayName": "Changed Name",
    "nickName": "NickName",
"roles": [{
                              "value": "00E28000000p0XaEAI",
                              "display": "CEO"
               }]
}

URL : https://ap2.salesforce.com/services/scim/v1/Users/00528000001EhgD

But I am not able to fetch the roles as I could not find the resource url for fetching the roles.
I want to fetch role ids using role name
Can anybody please help here?
I can't find the option to "Add New Domain" under Domain Management in DE Org. I have another DE org where I can...but the Setup looks different in that DE org.

What could I be missing? I have all the perms turned on listed here: https://help.salesforce.com/HTViewHelpDoc?id=domain_mgmt_add.htm&language=en_US

 and am using the System Admin profile. Thanks for help!