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?

Custom Metadata Types Basics > Use Custom Metadata Types in Formulas, Default Values, and Validation Rules

Last updated at Posted at 2023-05-09

最近よくこの質問を見かけます

こうやってエラーを集めてみると過去の設定が影響している感じですね。

I think the settings for the previous challenge remain.

For example, if the field's required option was enabled, disable it.
Setup-->Object Manager --> Choose (Opportunity)-->Fields-->Edit(Discount_Percent__c) and uncheck required

If you don't know the old settings, I recommend using the new playground.

We can't check your work because something in your org prevents creating and updating account and opportunity records. Chec

I can see that the challenge "Create and Manage Custom Metadata Types" already passed successfully and the error you are seeing is in the next unit "Use Custom Metadata Types in Formulas, Default Values, and Validation Rules" and it's due to the incorrect validation formula.

I have replaced the "Revenue_Validation" validation rule formula as below and it worked successfully.

課題「カスタム メタデータ タイプの作成と管理」はすでに成功しており、表示されているエラーは次の単元「式、デフォルト値、および検証ルールでのカスタム メタデータ タイプの使用」にあり、検証が正しくないことが原因であることがわかります。方式。

以下のように「Revenue_Validation」検証ルール式を置き換えたところ、正常に機能しました

IF(

  (ISPICKVAL( Support_Tier__c , "Gold")

    &&

  ( AnnualRevenue <

  20*$CustomMetadata.Support_Tier__mdt.Gold.Minimum_Spending__c

  )

 ), TRUE, FALSE

)

I had to deactivate a validation rule that required the account number to be 8 characters, which I must have set up in a previous tutorial.

同じ質問

We can't check your work because something in your org prevents creating and updating account and opportunity records. Check the settings and configuration of your org. Make sure you can create and update account and opportunity records. Then click Check Challenge again.

Please check if there is any validation rule or may be trigger are prevent you from create and update account and opportunity records.

Check the permission set also.

I found out there is an required field (Discount_Percent__c) I created in Opportunity object (for another Trailhead module) so I must fill in this field whenever I create an oppt record (for any exercise or challenge). So I modified the setting of this field to make it NOT required. Then I verified the hands-on challenge and it passed.

Opportunity オブジェクト (別の Trailhead モジュール用) に作成した必須フィールド (Discount_Percent__c) があることがわかりました。そのため、(演習またはチャレンジ用に) oppt レコードを作成するたびに、このフィールドに入力する必要があります。そこで、このフィールドの設定を変更して必須ではないようにしました。次に、ハンズオン チャレンジを検証したところ、成功しました。

Please try to deactivate trigger, validation rule on object if any

I can see that the challenge "Create and Manage Custom Metadata Types" already passed successfully and the error you are seeing is in the next unit "Use Custom Metadata Types in Formulas, Default Values, and Validation Rules" and it's due to the incorrect validation formula.

I have replaced the "Revenue_Validation" validation rule formula as below and it worked successfully.

IF(
  (ISPICKVAL( Support_Tier__c , "Gold")
    &&
  ( AnnualRevenue <
  20*$CustomMetadata.Support_Tier__mdt.Gold.Minimum_Spending__c
  )
 ), TRUE, FALSE

https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000PkpZ0SAJ

「カスタム メタデータ タイプの作成と管理」という課題はすでに成功していることがわかります。表示されているエラーは次の単元「数式、デフォルト値、および検証ルールでカスタム メタデータ タイプを使用する」にあり、誤った検証が原因です。式。

「Revenue_Validation」検証ルール式を以下のように置き換えたところ、正常に機能しました。

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?