Create Validation Rulesでの質問 Rule Name: Contact_must_be_in_Account_ZIP_Code

[Trailhead関係　個別の課題別](https://qiita.com/Keiji_otsubo/items/56eb7a90bb72138ece1f)


このトレイルヘッドの質問が多いんですよね。何でだろうなぁ。

[Formulas and Validations > Create Validation Rules](https://trailhead.salesforce.com/en/content/learn/modules/point_click_business_logic/validation_rules)


Set it to the **Contact** object.


```
AND(
NOT(ISBLANK(AccountId)),
MailingPostalCode <> Account.ShippingPostalCode
)
```


最近エラーメッセージの出る条件が変わったかもしれません

このエラーでも単純に上記設定ができてないだけみたいです。以前は他の条件もあったのですがね。

:::note alert
We can't create a contact by itself (without an associated account). Make sure the validation rule applies ONLY when the contact has an associated account.
:::


+ [Issue with the Trailhead challenge - Create Validation Rule](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007clRCv)

個人取引先がある？

----------------------------------
Winter 24 から上記設定だけでは解決しない不思議な現象

+ [Issue with Validation Rules](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007UrnjF)

:::note
 I was able to get this to work by exiting the playground and closing out of Chrome. I came back in and relaunched the playground and tried again. I copy/pasted the code, saved, then reloaded/refreshed the page. I then hit "submit" to check the challenge and it worked!

It finally worked after creating a new playground and switching browsers.
:::

---------------------------------

このエラーコードも同じらしい
**We can't create a contact by itself (without an associated account). Make sure the validation rule applies ONLY when the contact has an associated account.**

上記コードの続報。やはり前のチャレンジの設定が邪魔してたみたい。

**You were right, fields created in Contacts for other trailhead activities were holding me back. Deleted them all and I got my badge!**
あなたは正しかった、他のトレイルヘッド活動のために連絡先に作成されたフィールドは私を妨げていた。それらをすべて削除して、バッジを取得しました。

+ [Creating Validation rules](https://trailhead.salesforce.com/en/trailblazer-community/feed/0D54S00000H1jNhSAJ)

:::note
I think the settings for the previous challenge remain. Please deactivate.
If you don't know the old settings, I recommend using the new playground.
:::


上記回答をしたけど、よくわからないですね。

+ [Validation Rule](https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000JgClf)

:::note
New playground helped and also I had to do Account.Id not AccountId. I was not selecting the account Id associated with the contact when inserting the field.
:::

**英語でないとエラーになる？**

+ [Ayuda](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007LnSdB)

# We created a contact with a 'MailingPostalCode' that's different from the associated account's 'ShippingPostalCode'. We expected the validation rule to prevent that, but it didn't. Make sure the validation rule returns true and prevents creating a contact if its 'MailingPostalCode' is not equal to 'Account.ShippingPostalCode'.

+ [Whats happening? Am i missing anything?](https://trailhead.salesforce.com/trailblazer-community/feed/0D5KX00000KCXrs)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/e1b94c14-559c-f3e1-cfbc-874f900e5ebd.png)


:::note
関係ない項目に必須の設定があった

I found the issue and its not an issue according to me but trailhead doesn't like it.  

I was checking a IsNotblank on mailingpostalcode but its not required and after removing it the challenge passed.  
:::





# キャッシュの問題？

+ [Create A Validation Rule](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007ifvPy)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/1721f0f1-6c48-0752-c8f1-461edd4e323e.png)


:::note
Since it has been changed so many times, the cache may be a problem.

Please try logging out and logging in again.
If the problem still persists, try the following

Try your browser's incognito mode.Or try it in a different browser.
:::

# コンタクトオブジェクトに設定していないことにも注意する必要あり

+ [I have an error received,while completing a task on "Admin Intermediate", Validation Rules](https://trailhead.salesforce.com/en/trailblazer-community/feed/0D54S00000BsdmySAB)

+ [We can't find a reference to the account 'ShippingPostalCode' field in the validation rule.](https://trailhead.salesforce.com/en/trailblazer-community/feed/0D54S00000KduswSAB)

:::note
Make sure you set it on the Contact object.
I think you have it set on the account object.
:::

# Whoops, looks like there was a problem. Please try again

これが正解っぽい

+ [Whoops, looks like there was a problem. Please try again.](https://trailhead.salesforce.com/trailblazer-community/feed/0D5KX00000SXlqo)

+ [Error occured at Create Validation Rules](https://trailhead.salesforce.com/en/trailblazer-community/feed/0D54S00000DeRfy)

:::note
  I solved my problem.  there s two same name valiation rules each account and contracts so I deleted one rule, and i got my badge 

問題を解決しました。アカウントと契約ごとに 2 つの同じ名前の検証ルールがあるため、1 つのルールを削除してバッジを取得しました
:::

+ [Create Validation Rules](https://trailhead.salesforce.com/trailblazer-community/feed/0D5KX00000Tk6x6)

:::note
I think you have a validation rule with the same name on your account object. Try deleting it.
:::


+ [In Validation Rules Fields ,I completed my task but it show error like"Whoops, looks like there was a problem. Please try again.".I can't understand what is the problem so can any one suggest me.](https://trailhead.salesforce.com/en/trailblazer-community/feed/0D54S00000DxPHqSAN)

+ [Keep getting this error](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V000076BVZP)

:::note
The duplicate named rule I created in error on the wrong object was throwing it off


間違ったオブジェクトに対して誤って作成した重複した名前付きルールが原因で失敗していました
:::

# ルール名が違っていたようです。　MailingPostalCode does not match the associated Account ShippingPostalCode

Go to Object Manager > select CONTACT > Validation Rules > create New

Rule Name: Contact_must_be_in_Account_ZIP_Code

[Create Validation Rules : Challenge not yet complete Error](https://trailhead.salesforce.com/en/trailblazer-community/feed/0D54S00000El5Us)



# 何の課題だったか？
SFのお姉さんの回答。　う～ん、本当にこれかなぁ？
```
1. Login in to Trailhead 
2. Click on your profile image 
3. Click on "Hands-on Orgs" 
4. Remove the Trailhead playgrounds by clicking on the "Disconnect" button beside the playground name for which you are seeing this issue. 
5. Once you do step 4 please click on the "Connect a org" button 
6. Enter username and new password 
7. Click on "Allow" 
8. Click on "Yes! save it"   Here's an article that'll help you in finding your credentials: 

https://trailhead.salesforce.com/help?article=Find-the-username-and-password-for-your-Trailhead-Playground

Please try to verify the challenge, once you reconnect back the org to your Trailhead.
```

# ISPICKVAL( StageName ,"Closed Lost") && ISBLANK(Close_Reason__c) という別のチャレンジ

基本的にはフィールドタイプを間違えている。
しかし、言語設定が英語でなかった例もある。

+ [I can't finish the Creating Validation Rule challenge... help](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007UtVfRSAV)

https://trailhead.salesforce.com/content/learn/projects/customize-a-salesforce-object/picklists-field-dependencies

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/429f3d0b-5abe-d29c-3a5d-ab3652a6519e.png)

[No puedo superar el reto CREAR REGLAS DE VALIDACION](https://trailhead.salesforce.com/en/trailblazer-community/feed/0D54S00000EoDbf)

I think the Close_Reason__c field is a multi-select picklist.
Check the field type.

+ [変更するときのデフォルト値は4](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007GHQA5)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/39d64093-5871-d919-47d1-1ce7e7813bb6.png)



# Couldn't Load Plugin 何のことかはさっぱり分からん

+ [The Data Import Trailhead Won't Allow me to Download the File](https://trailhead.salesforce.com/en/trailblazer-community/feed/0D54S00000KgjET)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/022cc361-67de-0718-af2b-b1ed9f79a108.png)