Loading
Nonprofit Cloud
目录
选择筛选器

          没有结果
          没有结果
          以下是一些搜索提示

          检查关键字的拼写。
          使用更普遍的搜索词。
          选择更少的筛选器,并扩大搜索范围。

          搜索所有 Salesforce 帮助
          非营利组织礼品条目网格中的自定义 Lightning Web 组件

          非营利组织礼品条目网格中的自定义 Lightning Web 组件

          了解自定义 Lightning Web 组件如何将数据从礼品条目网格移出和移入礼品条目网格。

          所需版本
          适用于:Lightning Experience

          适用于:带 Education Cloud 的 EnterprisePerformanceUnlimitedDeveloper Edition

          适用于:带 Nonprofit Cloud 的 EnterpriseUnlimitedDeveloper Edition

          从礼品条目网格发送到组件的属性

          礼品条目网格通过单元格组件的 params 属性和模态的 rowData 属性,将行数据传输到自定义 Lightning Web 组件。

          所需版本
          适用于:Lightning Experience

          适用于:带 Education Cloud 的 EnterprisePerformanceUnlimitedDeveloper Edition

          适用于:带 Nonprofit Cloud 的 EnterpriseUnlimitedDeveloper Edition

          属性 备注
          params
          • 在单元格编辑和单元格显示组件中可用。
          • 包含礼品条目网格和基础网格服务中当前行的属性。
          • 除了查找和选项列表字段的对象表示之外,params.data 还包含与 GiftEntry 对象字段对应的字段值。尚未在新行中填充的字段不包括在数据收集中。
          • 可以使用 params.data.{giftEntryfieldName} 检索行字段值。
          rowData
          • 适用于列模式和后处理模式。
          • 除了查找和选项列表字段的对象表示之外,还包含与 GiftEntry 对象字段对应的字段值。尚未在新行中填充的字段不包括在 rowData 集合中。
          • 使用 rowData.{giftEntryfieldName} 检索行字段值。
          • 在后期处理模式中,rowData 还将包含生成的记录的 ID,例如礼品条目 ID(作为rowData.Id)和礼品交易 ID(作为rowData.GiftTransactionId)。

          将数据发送回礼品输入网格

          列模式和单元格编辑组件使用不同的机制将数据返回到礼品条目网格。

          所需版本
          适用于:Lightning Experience

          适用于:带 Education Cloud 的 EnterprisePerformanceUnlimitedDeveloper Edition

          适用于:带 Nonprofit Cloud 的 EnterpriseUnlimitedDeveloper Edition

          列模式

          列模态呈现在包装 Lightning Web 组件中,该组件包括模态标题(如模板中定义)以及继续和取消按钮。

          继续按钮是用户单击以关闭自定义模式的内容。它将调用这些必需的公开函数:

          函数 描述
          @api validate()

          返回具有两个属性的对象:

          • isValid:true 或 false,表示模态的内容通过了您的验证规则。如果为真,则通过调用 getComponentValues() 检索字段值,并关闭模态。
          • invalidFields:如果 isValid 为 false,则包含字段 api 名称的 key:value 集,并带有关联错误。此信息用于在模态中呈现消息。
          @api getComponentValues()

          返回要应用到行的 key:value 属性集:

          • { FieldApiName : value, … }
          • 每个字段必须引用 GiftEntry 对象中存在的字段。这些将在保存时保留在行中。

          单元格编辑组件

          要从单元格编辑组件将数据返回到礼品条目网格:

          • 构建对象作为消息,以返回到礼品条目网格。
          • 将事件发布到lightning__giftEntryGridComponentAction消息渠道。

          消息正文的内容很严格。按照此示例的结构:

          // Build the "message" object to send back to 
          // Gift Entry Grid following the documented contract
          const message = {
          
              // Required properties (do not change the values below)
              action: "ColumnEdit",
              componentName: this.tagName,
              colId: this._params?.colDef?.colId,
          
              // 'details' is an optional property:
              // - include if there is data to write to the row 
              //   in Gift Entry
              details: {
          
                  // rowId and rowIndex must be included in details
                  rowId: this.params?.data?.id,           // Required
                  rowIndex: this.params?.data?.rowIndex,  // Required
          
                  // All GiftEntry fields to write to rowData
                  // and as object in a key:value collection.
                  // To clear the value of a field on the GiftEntry rowData
                  // object, return null instead of undefined
                  giftEntryFields : { key: value, ... },
          
                  // rowProperties is optional, but if passed can be
                  // referenced by other custom components. Data in this
                  // object are not persisted to the GiftEntry record.
                  rowProperties: { key : value, ... },
          
                  // Special Use: If your custom column component is 
                  // forcing a matched gift transaction, use these
                  // properties to send the matching transaction ID 
                  // and NAME back to grid for proper handling:
                  matchingGiftTransactionId: {giftTransactionId},
                  matchingGiftTransactionName: {giftTransactionName}
              }
          }
          
          备注
          备注 没有属性从列组件(显示)或单元格显示组件返回到网格。

          返回数据的注意事项

          在将数据返回礼品条目网格时,请考虑选项列表和查找字段的这些规则。

          所需版本
          适用于:Lightning Experience

          适用于:带 Education Cloud 的 EnterprisePerformanceUnlimitedDeveloper Edition

          适用于:带 Nonprofit Cloud 的 EnterpriseUnlimitedDeveloper Edition

          选项列表字段注意事项:

          • 如果选项列表字段作为简单字符串返回,则该值应代表标签和 API 名称不同时选项列表 API 名称。
          • 选项列表字段也可以以{ value: xx, displayValue: zz }形式返回为对象。以下示例:
            { 
              giftType: 
                { value: “Organizational”, 
                  displayValue: “Organizativo/Doméstico” 
                }
            }

          查找字段注意事项:

          • 不是礼品条目网格中的列的查找字段只能在响应对象中作为 ID 字符串返回。例如,{MyLookupFieldId__c: ‘xxx00000000’}
          • 作为礼品条目网格中的字段列的查找字段,例如市场活动和推广源代码,应该从对象表单中的自定义 Lightning Web 组件返回,以确保它们在网格中正确呈现。以下是示例:
            Campaign: {
               Id: {campaignId},
               Name: {campaignName}
            }
            
           
          正在加载
          Salesforce Help | Article