• Itay Maoz
  • NEWBIE
  • 20 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 8
    Replies
I am trying to deploy a lightning flow from a dev sandbox to a fullsandbox. Both are running the most up to date version SFDC. The deployment is failing and I'm getting the following error message: 


Because the TriggerType field has the value "RecordBeforeSave", you also need to set the following fields: SaveType.

I'm unsure how to set "SaveType" in a flow. 
I'm trying to relate all tasks from an account to an opportunity when a contact is added as a contact role to the opportunity. There are 3 elements:

1. Passagetech rollup/lookup that populates most recent opp on a contact when they are added as a contact role on an opp
2. Process builder that kicks off flow when that field is updated
3. Flow to loop through tasks on contact and change whatid from account to opportunity for all tasks that were created after the opportunity create date.


It's worked a few times in sandbox, but in production I am getting this error:

Error element update_task_relation_final (FlowRecordCreate).
This error occurred when the flow tried to create records: FIELD_INTEGRITY_EXCEPTION: You can only add up to one what relation.: Task ID. 

I'm not sure how to get around this. I thought the loop would be enough to get around this.  Any help would be appreciated.

Thanks!

Here is a screenshot of the flow:

In record create I'm creating a new taskrelation

visual flow add tasks to opp

 
How do i create an outbound message upon creation/update of a feed comment? I can do it to a Feed Item through workflow, but it doesn't look like creating a feed comment counts as an update to the parent Feed Item. Open to triggers, but I'm bad at them. 
What is the name of the object that holds the attachments associated with replies on the case feed?

i know that the Feed Attachment is the name of the file that is attached directly to the case feed. My question is, if I reply to a comment with an attachment, how do I find that attachment? I know comments associated with the case feed are feed comments. Feed attachment seems to only be the original file though. Same for Content document with parentid = casefeedid. 

Thanks
I'm trying to populate the close date with the first day of next calendar quarter for all new opps created. I've created a custom button but am having trouble figuring out how to do this. 
Is there a way to generate an email alert to a Contact listed as primary contact in the opportunity contact role list? If not, is there a way to populate that contact in the Opportunity automatically? 
I'm trying to have a date from the account map to all the tasks associated with the account. The Field on Account is Date_Accepted__c and on the Task is also Date_Accepted__c. I currently have a trigger (thanks to help from this board) That populates the Date Accepted on the task when a new task is created, but if I change the date on the account, it doesn't change the date on the task. Is this possible to do with a trigger?  Here is what I have so far, its a trigger on the task. I'm guessing it would have to be a trigger on the account instead:

trigger Triggertask on Task (before insert) {
    
        id accountid ;
  for(Task task: Trigger.new) 
{
       Schema.SObjectType token = task.whatid.getSObjectType();

   if(token.getDescribe().getname()=='Account')
        accountid= task.whatid;
}
  if(accountid!=null)
  {
    account act= [select Date_Accepted__c from account where id=:accountid];
    
    for(Task tsk:Trigger.new)
    {
        tsk.Date_Accepted__c=act.Date_Accepted__c;
    }
  }

}
I'm capturing the date a sales rep accepts a lead into their funnel using a Date_Accepted__c field on the account. I want to map this to a Date_Accepted__c field all tasks associated with the account. I've tried doing this with a formula field and a workflow and was unable to do it because Task is not a child of Account. Is there an apex trigger I could use to map this date from account to task? 
I'm trying to relate all tasks from an account to an opportunity when a contact is added as a contact role to the opportunity. There are 3 elements:

1. Passagetech rollup/lookup that populates most recent opp on a contact when they are added as a contact role on an opp
2. Process builder that kicks off flow when that field is updated
3. Flow to loop through tasks on contact and change whatid from account to opportunity for all tasks that were created after the opportunity create date.


It's worked a few times in sandbox, but in production I am getting this error:

Error element update_task_relation_final (FlowRecordCreate).
This error occurred when the flow tried to create records: FIELD_INTEGRITY_EXCEPTION: You can only add up to one what relation.: Task ID. 

I'm not sure how to get around this. I thought the loop would be enough to get around this.  Any help would be appreciated.

Thanks!

Here is a screenshot of the flow:

In record create I'm creating a new taskrelation

visual flow add tasks to opp

 
How do i create an outbound message upon creation/update of a feed comment? I can do it to a Feed Item through workflow, but it doesn't look like creating a feed comment counts as an update to the parent Feed Item. Open to triggers, but I'm bad at them. 
What is the name of the object that holds the attachments associated with replies on the case feed?

i know that the Feed Attachment is the name of the file that is attached directly to the case feed. My question is, if I reply to a comment with an attachment, how do I find that attachment? I know comments associated with the case feed are feed comments. Feed attachment seems to only be the original file though. Same for Content document with parentid = casefeedid. 

Thanks
Is there a way to generate an email alert to a Contact listed as primary contact in the opportunity contact role list? If not, is there a way to populate that contact in the Opportunity automatically? 
I'm trying to have a date from the account map to all the tasks associated with the account. The Field on Account is Date_Accepted__c and on the Task is also Date_Accepted__c. I currently have a trigger (thanks to help from this board) That populates the Date Accepted on the task when a new task is created, but if I change the date on the account, it doesn't change the date on the task. Is this possible to do with a trigger?  Here is what I have so far, its a trigger on the task. I'm guessing it would have to be a trigger on the account instead:

trigger Triggertask on Task (before insert) {
    
        id accountid ;
  for(Task task: Trigger.new) 
{
       Schema.SObjectType token = task.whatid.getSObjectType();

   if(token.getDescribe().getname()=='Account')
        accountid= task.whatid;
}
  if(accountid!=null)
  {
    account act= [select Date_Accepted__c from account where id=:accountid];
    
    for(Task tsk:Trigger.new)
    {
        tsk.Date_Accepted__c=act.Date_Accepted__c;
    }
  }

}
I'm capturing the date a sales rep accepts a lead into their funnel using a Date_Accepted__c field on the account. I want to map this to a Date_Accepted__c field all tasks associated with the account. I've tried doing this with a formula field and a workflow and was unable to do it because Task is not a child of Account. Is there an apex trigger I could use to map this date from account to task?