• Stefanie Bayer
  • NEWBIE
  • 25 Points
  • Member since 2014
  • Lead Solution Engineer
  • salesforce.com


  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 8
    Replies
Finishing the last challenge of the picklist administration Trailhead Module results in an error message, I cannot solve - see screenshot. Any ideas? I promoted the field to a global picklist, created the new field based on the global value set as requested...

User-added image
Hi experts,
I have the following challenge I'm struggling with. The requested functionality is when saving an email with attachment from (e.g.) Salesforce App for Outlook to Salesforce and attaching the email to the opportunity, the attachment itself (not only the email) should additionally be attached to the opportunity.
So far, I figured out that 
  • (of course) the email is saved as a task
  • the attachment is saved in the ContentDocument table
  • the link between the email and the attachment is saved in the ContentDocumentLink table (plus the permissions that are applied)
  • additionally the link between the attachment and the opportunity's account (in the task's WhatId) is also saved as an additional entry in the ContentDocumentLink table
What I wanted to achieve with a trigger on the task object is to create a thrid entry in the ContentDocumentLink table between the opportunity itself an the email attachment. (This entry is created when I manually post the file (from Salesforce) to the opportunity feed.)

The problem is - at least that's what I'm thinking - that the entry in the ContentDocumentLink table is created in a separate transaction on the DB. The (after insert) trigger on the task cannot find any entries in the ContentDocumentLink table. If I check via workbench the entry is there.

Here is the trigger (probably not the best code since I'm not a developer - apologies for that :-)):
 
trigger addEmailAttachToWhatId on Task (after insert) {

    ContentDocumentLink doclink= new ContentDocumentLink ();   
    ContentDocumentLink doclinkold= new ContentDocumentLink ();   
    List<Id> tskL = new List<Id>();
    List<ContentDocumentLink> doclinkL = new List<ContentDocumentLink>();
    List<ContentDocumentLink> doclinks = new List<ContentDocumentLink>();

    try{
        for(Task t : Trigger.new){
            tskL.add(t.Id); 
        }    

        doclinks= [SELECT ContentDocumentId, LinkedEntityId FROM ContentDocumentLink WHERE LinkedEntityId in :tskL];
    }catch(Exception e){
    }
            
    for(Task task : Trigger.new){
        
        if(task.whatId != null){
                
            for (ContentDocumentLink dlink : doclinks){
                if (dlink.LinkedEntityId == task.Id){
                    doclink.ContentDocumentId= dlink.ContentDocumentId;
                    doclink.LinkedEntityId = task.WhatId;
                    doclink.ShareType = 'V';
                    doclink.Visibility = 'InternalUsers';
                    doclinkL.add(doclink);
                 }
            }
        }
    }       
    insert doclinkL;       
}

The message in the Debug log is as follows:
 
36.0 APEX_CODE,DEBUG;APEX_PROFILING,DEBUG;CALLOUT,INFO;DB,DEBUG;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,DEBUG;WORKFLOW,DEBUG
12:26:48.0 (585253)|EXECUTION_STARTED
12:26:48.0 (615652)|CODE_UNIT_STARTED|[EXTERNAL]|01q24000000TjWc|addEmailAttachToWhatId on Task trigger event AfterInsert for [00T2400000cMmED]
12:26:48.0 (15796812)|SOQL_EXECUTE_BEGIN|[28]|Aggregations:0|SELECT ContentDocumentId, LinkedEntityId FROM ContentDocumentLink WHERE LinkedEntityId IN :tmpVar1
12:26:48.0 (43505087)|SOQL_EXECUTE_END|[28]|Rows:0
12:26:48.44 (44045805)|CUMULATIVE_LIMIT_USAGE
12:26:48.44 (44045805)|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 1 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

12:26:48.44 (44045805)|CUMULATIVE_LIMIT_USAGE_END

12:26:48.0 (45844070)|CODE_UNIT_FINISHED|addEmailAttachToWhatId on Task trigger event AfterInsert for [00T2400000cMmED]
12:26:48.0 (47962053)|EXECUTION_FINISHED
12:26:48.53 (53178488)|EXECUTION_STARTED
12:26:48.53 (53192920)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:Task
12:26:48.53 (68766665)|WF_RULE_EVAL_BEGIN|Workflow
12:26:48.53 (68822118)|WF_CRITERIA_BEGIN|[Aufgabe:  00T2400000cMmED]|Email in Subject Line|01Q24000000Upow|ON_CREATE_OR_TRIGGERING_UPDATE|0
12:26:48.53 (73895645)|WF_RULE_FILTER|[Aufgabe : Thema beginnt mit Email]
12:26:48.53 (73924226)|WF_RULE_EVAL_VALUE|E-Mail:Test Email mit Attachment
12:26:48.53 (73931095)|WF_CRITERIA_END|false
12:26:48.53 (73962473)|WF_SPOOL_ACTION_BEGIN|Workflow
12:26:48.53 (73971008)|WF_ACTION| None
12:26:48.53 (73974685)|WF_RULE_EVAL_END
12:26:48.53 (74027751)|WF_ACTIONS_END| None
12:26:48.53 (74035366)|CODE_UNIT_FINISHED|Workflow:Task
12:26:48.53 (75452920)|EXECUTION_FINISHED


 
Finishing the last challenge of the picklist administration Trailhead Module results in an error message, I cannot solve - see screenshot. Any ideas? I promoted the field to a global picklist, created the new field based on the global value set as requested...

User-added image
Hello,
context- trailhead module : Quick Start: Quip Live Apps > Run Your Live App in Quip

I Had to install python in order to execute quip-apps in order to success.
Creating a app using a python :
C:\..\quip-apps-sdk-0.91\bin>C:\Users\e371495\AppData\Local\Programs\Python\Python36-32\python .\bin\quip-apps init myApp FCCAjAoobBu
INFO:root:Successfully initialized apps\myapp

I get an OK from npm install and build.
but I am not able to pack the application :
C:\..\quip-apps-sdk-0.91>C:\Users\e371495\AppData\Local\Programs\Python\Python36-32\python bin\quip-apps pack apps\myapp\app
I get the following :
User-added image
 
Thank you,
Christophe
Finishing the last challenge of the picklist administration Trailhead Module results in an error message, I cannot solve - see screenshot. Any ideas? I promoted the field to a global picklist, created the new field based on the global value set as requested...

User-added image
Hi,

I am on wave trailhead "Add Key Metrics to Evaluate Your Business" , While I have done requisite for the trail I am getting below error 

"Could not find the correct dashboard state. Please verify the endpoint and results are correct." 
User-added image
Hello

Trying to verify a challenge but hitting the following error:
Challenge Not yet complete... here's what's wrong: Could not find the correct dashboard state. Please verify the endpoint and results are correct. I have connected Trailhead to my dev org but perhaps since the dev org is in Swedish it is unable to verify the work I did?

Trail:
https://trailhead.salesforce.com/modules/wave_dashboard_designer_basics/units/wave_add_key_metrics_evaluate_business

Dev org:
https://eu11.salesforce.com/analytics/wave/wave.apexp?tsid=02u0Y0000013781
philip@wavey.se

Perhaps something else I can try?
Hi experts,
I have the following challenge I'm struggling with. The requested functionality is when saving an email with attachment from (e.g.) Salesforce App for Outlook to Salesforce and attaching the email to the opportunity, the attachment itself (not only the email) should additionally be attached to the opportunity.
So far, I figured out that 
  • (of course) the email is saved as a task
  • the attachment is saved in the ContentDocument table
  • the link between the email and the attachment is saved in the ContentDocumentLink table (plus the permissions that are applied)
  • additionally the link between the attachment and the opportunity's account (in the task's WhatId) is also saved as an additional entry in the ContentDocumentLink table
What I wanted to achieve with a trigger on the task object is to create a thrid entry in the ContentDocumentLink table between the opportunity itself an the email attachment. (This entry is created when I manually post the file (from Salesforce) to the opportunity feed.)

The problem is - at least that's what I'm thinking - that the entry in the ContentDocumentLink table is created in a separate transaction on the DB. The (after insert) trigger on the task cannot find any entries in the ContentDocumentLink table. If I check via workbench the entry is there.

Here is the trigger (probably not the best code since I'm not a developer - apologies for that :-)):
 
trigger addEmailAttachToWhatId on Task (after insert) {

    ContentDocumentLink doclink= new ContentDocumentLink ();   
    ContentDocumentLink doclinkold= new ContentDocumentLink ();   
    List<Id> tskL = new List<Id>();
    List<ContentDocumentLink> doclinkL = new List<ContentDocumentLink>();
    List<ContentDocumentLink> doclinks = new List<ContentDocumentLink>();

    try{
        for(Task t : Trigger.new){
            tskL.add(t.Id); 
        }    

        doclinks= [SELECT ContentDocumentId, LinkedEntityId FROM ContentDocumentLink WHERE LinkedEntityId in :tskL];
    }catch(Exception e){
    }
            
    for(Task task : Trigger.new){
        
        if(task.whatId != null){
                
            for (ContentDocumentLink dlink : doclinks){
                if (dlink.LinkedEntityId == task.Id){
                    doclink.ContentDocumentId= dlink.ContentDocumentId;
                    doclink.LinkedEntityId = task.WhatId;
                    doclink.ShareType = 'V';
                    doclink.Visibility = 'InternalUsers';
                    doclinkL.add(doclink);
                 }
            }
        }
    }       
    insert doclinkL;       
}

The message in the Debug log is as follows:
 
36.0 APEX_CODE,DEBUG;APEX_PROFILING,DEBUG;CALLOUT,INFO;DB,DEBUG;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,DEBUG;WORKFLOW,DEBUG
12:26:48.0 (585253)|EXECUTION_STARTED
12:26:48.0 (615652)|CODE_UNIT_STARTED|[EXTERNAL]|01q24000000TjWc|addEmailAttachToWhatId on Task trigger event AfterInsert for [00T2400000cMmED]
12:26:48.0 (15796812)|SOQL_EXECUTE_BEGIN|[28]|Aggregations:0|SELECT ContentDocumentId, LinkedEntityId FROM ContentDocumentLink WHERE LinkedEntityId IN :tmpVar1
12:26:48.0 (43505087)|SOQL_EXECUTE_END|[28]|Rows:0
12:26:48.44 (44045805)|CUMULATIVE_LIMIT_USAGE
12:26:48.44 (44045805)|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 1 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

12:26:48.44 (44045805)|CUMULATIVE_LIMIT_USAGE_END

12:26:48.0 (45844070)|CODE_UNIT_FINISHED|addEmailAttachToWhatId on Task trigger event AfterInsert for [00T2400000cMmED]
12:26:48.0 (47962053)|EXECUTION_FINISHED
12:26:48.53 (53178488)|EXECUTION_STARTED
12:26:48.53 (53192920)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:Task
12:26:48.53 (68766665)|WF_RULE_EVAL_BEGIN|Workflow
12:26:48.53 (68822118)|WF_CRITERIA_BEGIN|[Aufgabe:  00T2400000cMmED]|Email in Subject Line|01Q24000000Upow|ON_CREATE_OR_TRIGGERING_UPDATE|0
12:26:48.53 (73895645)|WF_RULE_FILTER|[Aufgabe : Thema beginnt mit Email]
12:26:48.53 (73924226)|WF_RULE_EVAL_VALUE|E-Mail:Test Email mit Attachment
12:26:48.53 (73931095)|WF_CRITERIA_END|false
12:26:48.53 (73962473)|WF_SPOOL_ACTION_BEGIN|Workflow
12:26:48.53 (73971008)|WF_ACTION| None
12:26:48.53 (73974685)|WF_RULE_EVAL_END
12:26:48.53 (74027751)|WF_ACTIONS_END| None
12:26:48.53 (74035366)|CODE_UNIT_FINISHED|Workflow:Task
12:26:48.53 (75452920)|EXECUTION_FINISHED


 
Hello,
context- trailhead module : Quick Start: Quip Live Apps > Run Your Live App in Quip

I Had to install python in order to execute quip-apps in order to success.
Creating a app using a python :
C:\..\quip-apps-sdk-0.91\bin>C:\Users\e371495\AppData\Local\Programs\Python\Python36-32\python .\bin\quip-apps init myApp FCCAjAoobBu
INFO:root:Successfully initialized apps\myapp

I get an OK from npm install and build.
but I am not able to pack the application :
C:\..\quip-apps-sdk-0.91>C:\Users\e371495\AppData\Local\Programs\Python\Python36-32\python bin\quip-apps pack apps\myapp\app
I get the following :
User-added image
 
Thank you,
Christophe