Loading
Nonprofit Cloud
目錄
選取篩選

          沒有結果
          沒有結果
          以下是搜尋小祕訣

          檢查關鍵字的拼字。
          使用較常見的搜尋字詞。
          選取較少篩選條件以擴大您的搜尋。

          搜尋所有 Salesforce 說明
          非營利組織的禮物項目網格中的自訂 Lightning Web 元件

          非營利組織的禮物項目網格中的自訂 Lightning Web 元件

          瞭解自訂 Lightning Web 元件如何將資料從「禮物項目網格」移動到「禮物項目網格」中。

          所需版本
          提供版本:Lightning Experience

          提供版本:具備 Education Cloud 的 EnterprisePerformanceUnlimitedDeveloper Edition

          提供版本:具備 Nonprofit Cloud 的 EnterpriseUnlimitedDeveloper Edition

          從禮物項目網格傳送至元件的內容

          「禮物項目網格」會透過儲存格元件的 params 內容,以及 modals 的 rowData 內容,將資料列資料傳送至自訂 Lightning Web 元件。

          所需版本
          提供版本:Lightning Experience

          提供版本:具備 Education Cloud 的 EnterprisePerformanceUnlimitedDeveloper Edition

          提供版本:具備 Nonprofit Cloud 的 EnterpriseUnlimitedDeveloper Edition

          內容 描述
          參數
          • 適用於「儲存格編輯」和「儲存格顯示」元件。
          • 包含「禮物項目網格」內目前列的內容以及基本網格服務。
          • params.data 包含對應至 GiftEntry 物件欄位的欄位值,以及對應和選項清單欄位的物件表示。尚未填入新列的欄位不會包含在資料集合中。
          • 資料列欄位值可使用 params.data.{giftEntryfieldName} 取得。
          rowData
          • 適用於資料欄模式和後續處理模式。
          • 除了對應和選項清單欄位的物件表示外,包含對應至 GiftEntry 物件欄位的欄位值。尚未填入新列的欄位不會包含在 rowData 集合中。
          • 您可以使用 rowData.{giftEntryfieldName} 取得列欄位值。
          • 在「後續處理強制回應」中,rowData 也會包含產生的記錄識別碼,例如「禮物項目識別碼」(作為 rowData.Id) 和「禮物交易識別碼」(作為 rowData.GiftTransactionId)。

          將資料傳送回禮物項目網格

          資料欄強制回應和儲存格編輯元件使用不同的機制將資料傳回至「禮物項目網格」。

          所需版本
          提供版本:Lightning Experience

          提供版本:具備 Education Cloud 的 EnterprisePerformanceUnlimitedDeveloper Edition

          提供版本:具備 Nonprofit Cloud 的 EnterpriseUnlimitedDeveloper Edition

          資料欄強制回應

          「欄模型」會在包含強制回應標題 (如範本中定義) 以及「繼續」和「取消」按鈕的包裝 Lightning Web 元件中呈現。

          「繼續」按鈕是使用者按一下以關閉自訂強制回應的按鈕。它會呼叫這些必要的公開函數:

          函數 描述
          @api validate()

          傳回具有兩個內容的物件:

          • isValid:true 或 false,表示強制回應的內容會通過您的驗證規則。如果為 true,則欄位值會透過呼叫 getComponentValues(),並關閉強制回應。
          • invalidFields:如果 isValid 為 false,則此項目包含 key:value 欄位的 API 名稱集,其中包含相關聯的錯誤。此資訊用於在強制回應內呈現訊息。
          @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” 
                }
            }

          對應欄位考量事項:

          • 非「禮物項目網格」中資料欄的對應欄位只能在回應物件中作為識別碼字串傳回。例如,{MyLookupFieldId__c: ‘xxx00000000’}
          • 「禮物項目網格」中欄位欄位的對應欄位 (例如行銷活動和拓展來源程式碼) 應從物件表單中的自訂 Lightning Web 元件傳回,以確保其在網格中正確呈現。範例如下:
            Campaign: {
               Id: {campaignId},
               Name: {campaignName}
            }
            
           
          正在載入
          Salesforce Help | Article