0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Salesforceフローエラー「フローを実行中に種別の変換エラーが発生しました。」

0
Posted at
  • 画面フローにlwcを入れている。
  • lwcに画面フローへの出力がある。
lwc.js-meta.xml
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>67.0</apiVersion>
    <isExposed>true</isExposed>
    <masterLabel>xx</masterLabel>
    <description>xx</description>
    <targets>
        <target>lightning__FlowScreen</target>
        <target>lightning__AppPage</target>
    </targets>
    <targetConfigs>
        <targetConfig targets="lightning__FlowScreen">
            <property name="xxxOut" type="apex://XxxType" label="アウトプット" role="outputOnly" description="See apex XxxType"/>
        </targetConfig>
    </targetConfigs>
</LightningComponentBundle>    
XxxType.cls
/**
 * Order__c に Date型のカスタム項目 mDate__c がある
 */
public with sharing class XxxType {
    @AuraEnabled public Order__c orderToUpdate { get; set; } // 更新対象ー注文ヘッダ
}

掲題のエラーが起き得る実装:

lwc.js
let shippingDate = (this.shippingDate || "").trim();
const orderToUpdate = {
    Id: this.headerId
    , mDate__c: shippingDate    // 出荷日
};
this.dispatchEvent(new FlowAttributeChangeEvent('xxxOut', orderToUpdate));

掲題のエラーを解消できる実装:

lwc.js
let shippingDate = this.shippingDate || null;
const orderToUpdate = {
    Id: this.headerId
    , mDate__c: shippingDate    // 出荷日
};
this.dispatchEvent(new FlowAttributeChangeEvent('xxxOut', orderToUpdate));

エラー回避仕組み:
this.shippingDateが空白の場合は、nullをセット

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?