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

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 36
    Questions
  • 36
    Replies
I am seeing an extremely strange behavior:

I am creating a task from a case's activity timeline. After the creation (or during the creation, doesn't matter) I am changing the task's WhatId to an account.
Now, if in workbench or dev console I look at the FeedItem record its ParentRecordId is the task, and the task's WhatId is the account. So, looking at all data in workbench, there isn't any more any reference to the case.
Nevertheless, when looking at the same FeedItme in the SF UI, it still shows that the FeedItem is related to the case.
Where is this reference coming from (i.e. how is the link between FeedItem and Case represented in the database)?
If you look at the activity timeline you would think that it shows activity records. However this cannot be really true:
If I create a task in the activity timeline of a case and relate it to an account then the created task has NO reference to the case. Nevertheless it is shown in the case's activity timeline - even after refreshs. So there must be another object making the connection.

That object must support links to activities but also links to FeedComments (as I can add comments to the timeline.)

What is its name - and can I query it with SOQL?
Does anybody know a lightning component which does the following:
  • I have a field "rel_record" on account which is a lookup to another record X (e.g. owner)
  • I would like to show a related list showing records related to X on the lightning page for my account

I have a flow which first creates a custom record A, then creates a second record B which contains a lookup to the first record.

When I run this flow as administrator, everything is fine. When I run it as a normal user, I get an INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY  error.

When I place a screen between the two Create Record elements the flow runs fine even for the normal user.

 

Debugging the flow shows that the ID of A is available directly after the first Create Records - but the debugger also tells me that A will only be created after the next pause. So it seems that the lookup from B to A is only possible after the screen pauses the flow and A is truely written to the database.

But why is this different when I run the flow as an admin?
Two ideas:
I) there is a trigger on A that changes the owner and the normal user's access is through a sharing rule. That rule might be applied delayed or even asynchronously. That however would make the flow outcome indeterminate
Ii) Some optimization in the flow engine delays DML execution. Text in the debugging screens indicates this. However this would not explain why the behaviour is user specific.
I want to do something whenever a list email is sent to the members of a campaign.
How do I detect that this has happened?
I do not know how to override the "Send List Email" button (and then call the original functionality after doing my stuff) - nor does a trigger fire when list emails or tasks of subtype ListEmail are created.
I have installed CLI via npm and VS Code.
When installing the Salesforce Extension Pack the installation is stuck with installing Salesforce CLI Integration.
Where do I find logs which can help to identify the issue?
as part of the "Build an Automated CI/CD Pipeline with GitLab" trail I have successfully deployed the Dreamhouse package to a dev org using SFDX.
When trying to uninstall the package the system complains about flows which are still active.
However, when trying to deactivate the flows, you run into an error "Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details. Error ID: 274510908-1219834 (2076307982)"

Is this a problem of the SFDX methodology? Packages which you deploy using SFDX should be uninstallable!
I am working on a custom REST API and therefore need to define a connected app. I am using the new Salesforce DX model, hence I want to define the connected app once and then deploy it to scratch orgs.

I know that each time a new client ID and client secret will be created. However there are some more data in the connectedapp.xml which are not or not correctly deployed to the scratch org:
- isAdminApproved
is not deployed correctly

- IP relaxation
- session timeout 
are not deployable at all

Is this correct or am I missing something?
I have an org based project set up in VS Code and connected to a sandbox.
Package.xml contains
    <types>
        <members>*</members>
        <name>Profile</name>
    </types>
When I run sfdx source:force:retrieve the system creates profile-meta.xml data which contain applicationVisibilities, classAccesses, fieldPermissions (only for User custom fields), layoutAssignments, pageAccesses, tabVisibilities and userPermissions. Missing however are fieldLevelSecurities,loginHours, loginIpRanges, objectPermissions,recordTypeVisibilities.

Is there a way to retrieve these data as well? And which settings determine this selection?
I have an issue with APEX Replay Debugger in VS Code. While it successfully debugs a tiny class in my dev org, it fails to even start when loading a 360KB log file produced from a sandbox when creating a new contact.
What should I do to get debugging working in such a real world environment?
This question has been asked 1 1/2 years ago (and not answered)  - but given the changes that Salesforce DX has gone through I think that it is worth to ask it again.

If you want to start using Salesforce DX with scratch orgs in an already customized environment you need an automated way to configure your scratch org to contain the same custom objects, fields, code etc. as your production or sandbox. Otherwise you cannot use the Salesforce DX process to make modifications to your existing system.

Does such a process exist? Or can you use the Salesforce DX methodology only when you start customizing an out-of-the-box org?
I have a user which has Read access to Account but field level access only to the minimal set of fields, i.e. the ones which you cannot deselect in the profile config (e.g. Name, Record Type, Owner, Created By, ...)
When I try to create a contact with workbench and pass an accountid workbench throws an error "not enough rights in this account id".

So what is the minimum set of account fields that a user needs to see in order to be able to create a contact?
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?
If you look at the activity timeline you would think that it shows activity records. However this cannot be really true:
If I create a task in the activity timeline of a case and relate it to an account then the created task has NO reference to the case. Nevertheless it is shown in the case's activity timeline - even after refreshs. So there must be another object making the connection.

That object must support links to activities but also links to FeedComments (as I can add comments to the timeline.)

What is its name - and can I query it with SOQL?
Inline Edit and Territory Assignment Rules
When you inline edit an account and save, territory assignment rules cannot be enforced. Unfortunately even in an APEX trigger you cannot trigger the rules.
A possible solution seems to be to fire a web service call from the trigger which does a second update and requires territory assignment rules to be run.
 
Has anyone written working APEX code for this scenario and can share the relevant code snippets?
I am working on a custom REST API and therefore need to define a connected app. I am using the new Salesforce DX model, hence I want to define the connected app once and then deploy it to scratch orgs.

I know that each time a new client ID and client secret will be created. However there are some more data in the connectedapp.xml which are not or not correctly deployed to the scratch org:
- isAdminApproved
is not deployed correctly

- IP relaxation
- session timeout 
are not deployable at all

Is this correct or am I missing something?
I have an org based project set up in VS Code and connected to a sandbox.
Package.xml contains
    <types>
        <members>*</members>
        <name>Profile</name>
    </types>
When I run sfdx source:force:retrieve the system creates profile-meta.xml data which contain applicationVisibilities, classAccesses, fieldPermissions (only for User custom fields), layoutAssignments, pageAccesses, tabVisibilities and userPermissions. Missing however are fieldLevelSecurities,loginHours, loginIpRanges, objectPermissions,recordTypeVisibilities.

Is there a way to retrieve these data as well? And which settings determine this selection?
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
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?