首页 \ 问答 \ 如何确保salesforce中的工作流程没有触发电子邮件模板中没有记录/(How to make sure workflow in salesforce does not fire of there are no records in the email template/)

如何确保salesforce中的工作流程没有触发电子邮件模板中没有记录/(How to make sure workflow in salesforce does not fire of there are no records in the email template/)

我要求向一群人发送电子邮件。 但是,如果没有符合我标准的记录,我不想发送任何邮件。 目前我正在使用基于时间的工作流程来发送电子邮件。 但问题是它发送的电子邮件也没有记录。 我想让工作流程足够智能化。 我正在寻找一些使用配置而不是以编程方式的选项。


I have a requirement to send an email to a group of people. However I do not want to send any mail if there are no records matching my criteria. Currently I am using Time based workflow to send the emails. But the problem is it sends an email with zero records as well. I want to make the workflow intelligent enough. I am looking for some option which uses configuration and not programmatically.


原文:https://stackoverflow.com/questions/29536347
更新时间:2022-01-26 14:01

最满意答案

如果你只想添加文字,你可以做到这一点

 string AddedText;
 private void textbox_TextChanged(object sender, TextChangedEventArgs e)
 {
     var changes = e.Changes.Last();
     if (changes.AddedLength > 0)
     {
         AddedText = textbox.Text.Substring(changes.Offset,changes.AddedLength);
     }
 }

编辑

如果你想全部添加和删除文本,你可以做到这一点

    string oldText;
    private void textbox_GotFocus(object sender, RoutedEventArgs e)
    {
        oldText = textbox.Text;
    }

    string AddedText;
    string RemovedText;
    private void textbox_TextChanged(object sender, TextChangedEventArgs e)
    {
        var changes = e.Changes.Last();
        if (changes.AddedLength > 0)
        {
            AddedText = textbox.Text.Substring(changes.Offset, changes.AddedLength);
            if (changes.RemovedLength == 0)
            {
                oldText = textbox.Text;
                RemovedText = "";
            }
        }
        if (changes.RemovedLength > 0)
        {
            RemovedText = oldText.Substring(changes.Offset, changes.RemovedLength);
            oldText = textbox.Text;
            if (changes.AddedLength == 0)
            {
                AddedText = "";
            }
        }
    }

If you want only text added you can do this

 string AddedText;
 private void textbox_TextChanged(object sender, TextChangedEventArgs e)
 {
     var changes = e.Changes.Last();
     if (changes.AddedLength > 0)
     {
         AddedText = textbox.Text.Substring(changes.Offset,changes.AddedLength);
     }
 }

Edit

If you want all added and remove text you can do this

    string oldText;
    private void textbox_GotFocus(object sender, RoutedEventArgs e)
    {
        oldText = textbox.Text;
    }

    string AddedText;
    string RemovedText;
    private void textbox_TextChanged(object sender, TextChangedEventArgs e)
    {
        var changes = e.Changes.Last();
        if (changes.AddedLength > 0)
        {
            AddedText = textbox.Text.Substring(changes.Offset, changes.AddedLength);
            if (changes.RemovedLength == 0)
            {
                oldText = textbox.Text;
                RemovedText = "";
            }
        }
        if (changes.RemovedLength > 0)
        {
            RemovedText = oldText.Substring(changes.Offset, changes.RemovedLength);
            oldText = textbox.Text;
            if (changes.AddedLength == 0)
            {
                AddedText = "";
            }
        }
    }

相关问答

更多
  • 我猜测你正在创建一个其他开发人员将使用的UserControl,因此“最终用户”程序员可以通过程序设置文本。 我认为最简单的事情就是遵循@ jzworkman的建议并制作一个覆盖Text属性设置器的类。 正如@vulkanino所指出的那样,尽管如此,您应该可以提出并捕获验证事件。 public class TextBoxPlus : TextBox { public event CancelEventHandler ProgrammerChangedText; protected void ...
  • 如果AutoSuggestBox有一个事件来处理建议单词的选择,例如“ SuggestionChosen ”,则可能的解决方案是使用在各种处理程序之间管理的私有标记。 设置私有字段: private bool _isSelectingSuggestion; 将像OnSuggestionChosen这样的方法处理程序OnSuggestionChosen到事件SuggestionChosen并像这样实现它: private void OnSuggestionChosen(object sender, Rout ...
  • 我相信它不起作用,因为当您从“后退”按钮更新文本时,它会将其添加到堆栈中,以便看起来后退按钮不起作用,但确实如此。 您只需评估是否应将文本更改添加到堆栈中。 这是一个例子。 using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using System.Drawing; namespace TextBox { class Revision { public strin ...
  • 我认为问题是你的所有文本框和标签都是静态的。 使它们成为您的Page实例的一部分。 I fixed the problem apparently the problem was that there wasn't a Id so i added information[i].ID = "information" + i; and that fixed the problem
  • 要取消Keydown事件,您可以添加一个PreviewKeyDown: private void TextBox_PreviewKeyDown(object sender, KeyEventArgs e) { if(e.Key == Key.Delete) e.Handled = true; } To cancel Keydown event you can add a PreviewKeyDown: private void TextBox_PreviewKeyDown(object se ...
  • 如果你只想添加文字,你可以做到这一点 string AddedText; private void textbox_TextChanged(object sender, TextChangedEventArgs e) { var changes = e.Changes.Last(); if (changes.AddedLength > 0) { AddedText = textbox.Text.Substring(changes.Offset,chang ...
  • 在jQuery中.val()不会触发onchange你必须触发它