- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
4-6ren"> 4-在我的 Dynamics CRM 机会表单中,我添加了销售配额分配网格。如果在整个网格中输入了四个以上"is",我希望显示一条警告消息(或类似的内容)。例如,假设记录“A”t 有 4 个标记为"is"-6ren">
在我的 Dynamics CRM 机会表单中,我添加了销售配额分配网格。如果在整个网格中输入了四个以上"is",我希望显示一条警告消息(或类似的内容)。例如,假设记录“A”t 有 4 个标记为"is"的字段。记录“B”帐户已为零。如果我更改记录“B”旁边的分布,我希望出现警告消息。
我在编码或 JavaScript 方面没有太多经验,但这是我迄今为止所想到的:
function getTotalYesCount(executionContext) {
var formContext == executionContext.getFormContext();
var allRows == null;
var attributeColl == null;
var idqualifyyescount;
var sowbomyescount;
var scopeyescount;
var closeyescount;
try {
//get rows - use the getControl method and pass the grid name.
var gridContext = formContext.getControl("s_qd");
allRows == gridContext.getGrid().getRows();
//loop through rows and get the attribute collection
allRows.forEach(function (row, rowIndex) {
//get the attribute Collection
attributeColl == row.data.entity.attributes;
switch (att.getName()) {
case "new_idqualify":
if (att.getValue() == "Yes") {
idqualifyyescount == idqualifyyescount +1;
case "new_sowbom":
if (att.getValue() == "Yes") {
sowbomyescount == sowbomyescount +1;
}
case "new_scope":
if (att.getValue() == "Yes") {
scopeyescount == scopeyescount +1;
}
case "new_close":
if (att.getValue() == "Yes") {
closeyescount == closeyescount +1;
}
}
if ((idqualifyyescount + sowbomyescount + scopeyescount +closeyescount) > 4) {
Xrm.Utility.alertDialog("More than 4 Yes's have been entered in the Sales Quota Distribution.");
}
}
}
}
}
我走在正确的道路上吗?任何帮助使其发挥作用将不胜感激。谢谢!!
最佳答案
到目前为止,努力得很好。我发现的一些内容可以帮助您:
JavaScript 中的函数名称约定采用驼峰式命名法,即 getTotalYearsCount
而不是 GetTotalYearsCount
。您的变量也应该是 closeYesCount
、scopeYesCount
。 Airbnb's style guide是一个很好的引用点。
“等于”的 JavaScript 比较运算符应该是 ==
或 ===
,而不是 =
。所以你应该写 att.getValue() === "Yes"
。
从属性 getValue()
调用返回的值可能是 bool 值而不是字符串。因此,与其比较 att.getValue() === "Yes"
,不如比较 att.getValue() === true
。但在不知道您的数据库架构的情况下我无法确定。
在行数据对象上,getData()
和 getEntity()
均已弃用。您应该能够直接访问属性,因此您可以编写 row.data.entity.attributes;
。
根据您的要求,您可能只想使用 getRows()
。您使用的 getSelectedRows()
只会返回网格中已选择的行的集合,而 getRows()
将返回所有行。 Documentation here .
您实际上并未迭代属性集合attributeColl
。一种方法是使用 filter
:
var idQualify = attributeColl.filter(att => {
return att.getName === "new_idqualify";
})[0];
关于javascript - 动态365 : Need help finishing JavaScript event that counts the total "Yes"s in a grid and gives a warning message if the "Yes" count >4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58705612/
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
我有这段代码,我想在另一张工作表中查找一些单元格,如果它们符合条件,则将相邻单元格添加到返回到调用单元格函数的总数中。 Function collectUtfall(A1 As String, Ax
我知道默认的“CTRL+B”Windows 命令可用于显示所有嵌套文件。 是否有显示所有嵌套文件夹的快捷方式? 最佳答案 我怀疑 Total Commander 中是否存在此功能。内置tree实用性对
关于我的问题SQL是, 我有一个表,用户可以在其中输入名为 time_report 的时间报告数据。每个 time_report 都输入一个服务代码,每个代码都有不同的含义,包括开始、停止、时间和总计
在 Total Commander 中搜索时如何忽略 .svn 文件夹? 最佳答案 要从搜索中排除某些文件或文件夹,请在“搜索字段:”中使用以下语法: 从搜索中排除 *.bak 和 *.old 文件
我将如何编写 css 来访问以下类“total total_plus hidden_elem”或“total total_plus”? 我有 class="total total_plus"和 c
我正在查看 powershellpro.com 上的一些代码示例,但不明白他为什么编写循环数组的示例代码: ...增量从零开始然后加一,直到它小于或等于数组的长度减一... for ($i=0; $i
做了一个虚拟数据: data dummy; input q1 q3 q4 q2 q6$ bu$ q5; cards; 1 2 3 5 sa an 3 2 4 3 6 sm sa 4 6 5 3 8 c
我想知道如何在 magento 1.7 的订单网格中添加以下两个额外的列 客户总订单数 客户在订单上花费的总金额 我已经设法添加了列,但我无法让它显示任何数据。我相信问题的关键在于函数 *_prepa
我正在使用 dataImportHandler 将数据从 Oracle 数据库导入 solr。尽管导入和索引编制成功,但由于未创建文档,我无法搜索。日志中也没有错误。这是我的配置文件片段。请帮忙。
项目 item_id title active = 1/0 items_categories_map item_id category_id 我需要得到结果 category_id items_tot
当我运行命令时: find / 2>/dev/null -user root -type f -mmin -1 -exec du -cb {} + | grep total | head -1 我得到
我不明白为什么有时,计划的总成本可能是一个非常小的数字,而查看计划的内部,我们会发现巨大的成本。 (确实查询很慢)。 有人可以解释我吗? 这是一个例子。 显然,成本高的部分来自主选择中的一个字段,该字
因此,脚本以初始值 $8.90 开始,其想法是根据所选选项添加额外费用,HTML 分为 3 个部分 1.check-boxes、2 .选择并3.输入(文本)。 每个部分都是独立工作的,我正在尝试找到一
我有一个小问题。我一直在网上寻找答案,但主要是针对未生成/添加的输入字段。 $(document).ready(function(){ /* --- ADD FIELD --- */ $('
js框架。我正在尝试将数据从发布请求保存到数据库 模型(文章.js): NEWSCHEMA('Article').make(function(schema) { schema.define('titl
我想要所有间隔的总和,但我写这段代码时出现错误:使用未分配的局部变量 total ? enter TimeSpan total; foreach (var grp in query) { Time
我得到了以下数据,我需要返回递归总数(在本例中为 60)。下面的代码返回TypeError: Cannot read property 'Symbol(Symbol.iterator)' of und
我的项目要插入几个小时,你花了多少时间。它适用于整数值,但现在我需要添加字符串值。像Sunday ="NotWorknig"这样的东西;星期一=“8”;星期二=“生病了”; function Tota
尝试让停止按钮在用户单击开始时提供数字的运行总数。停止按钮不会给出总数,也不会保存您单击它时开始给出的数字。 我在这里做错了什么? package com.egroegnosbig.dicerolle
我是一名优秀的程序员,十分优秀!