Update Records機能もよくご存知でしょうか。
パターン①:
リストビューの検索は、検索できないデータ型の項目がありますよね。
リストビュー検索の制限:
https://help.salesforce.com/articleView?id=000318115&language=ja&type=1&mode=1
以下のデータ型は検索できません:
- 参照関係項目
- 派生項目
- 数式項目
- 非テキスト型項目 (数値型や通貨型など)
例えば、この前、Account Owner数式項目を作成致しましたので、今のところ、この項目を検索できるようにしたいと思います。
こちら⇒
直接検索とは確かにできないから、提案として、このAccount Owner値はテキストにコピーして、また再検索してみて、できるかなと思ています。
実はAccount Owner値:OwnerのLastNameとFirstNameでしょう。これがわかると、問題ないと思います。
1、
Object:Account
Start the process:when a record is created or edited
2、
Criteria Name:Account Owner
Criteria for Executing Actions:No criteria—just execute the actions!
3、
Update Records
Action Name:Account Owner Text
Record:[Account]
Criteria for Updating Records:No criteria—just update the records!
Set new field values for the records you update:
Account Owner Text:Formula:[Account].Owner.LastName + ” ” + [Account].Owner.FirstName
(Activite)有効化を忘れないように。
例えば、「Edge Communications」というAccount Nameを検索したいのですが、Account Ownerが「zhang chao」で、
何も更新しな場合:
zhang chaoで検索して、ヒットなかったので。
簡単に「Edge Communications」を更新しよう
Saveを押下します。
再度検索してみて、Account Owner Text項目の値もあるはずだ。
検索できました。Account Owner項目は関係なし、Account Owner Text項目のおかげで、Account Owner Text項目は非表示の場合も検索できるようにする。
パターン②:
■AccountのBillingの住所をShippingにコピーしたい
⇒【制御案】
Billingに値が入っている状態で保存時、Shippingの各項目 がすべて空欄の場合のみBillingの値をShippingにコピーする
※Billingのデータを変更した場合もShippingに値が入力されている場合はコピーされません。
1、
Object:Account
Start the process:when a record is created or edited
2、
Criteria Name:Shippingの各項目 がすべて空欄
Criteria for Executing Actions:Conditions are met
[Account].ShippingCountry : Is null : ture
[Account].ShippingState : Is null : ture
[Account].ShippingCity : Is null : ture
[Account].ShippingStreet : Is null : ture
[Account].ShippingPostalCode : Is null : ture
Conditions:All of the conditions are met (AND)
3、
Update Records
Action Name:住所(請求先)を住所(納入先)にコピー
Record:[Account]
Criteria for Updating Records:No criteria—just update the records!
Set new field values for the records you update
Shipping City:Field Reference:[Account].BillingCity
Shipping Country:Field Reference:[Account].BillingCountry
Shipping Zip/Postal Code:Field Reference:[Account].BillingPostalCode
Shipping State/Province:Field Reference:[Account].BillingState
Shipping Street:Field Reference:[Account].BillingStreet
有効化にします。
Billing AddressとShipping Addressも空の場合、
Billing Addressを記入します。
Saveを押下します。
Shipping Addressも自動生成致しました。
Billing AddressとShipping Addressも変更する場合、お互いに影響なしの確認します。
Saveを押下します。
パターン③:
パターン②大体同じです。二つオブジェクトです。
■Contact作成時に関連するAccountのBillingをContactのMailingの住所に自動入力したい
⇒【制御案】
Mailing の各項目 がすべて空欄の場合のみ保存時にBillingの値をMailingにコピーする
※Billingのデータを変更した場合もMailingに値が入力されている場合はコピーされません。
1、
Object:Contact
Start the process:when a record is created or edited
2、
Criteria Name:AccountのBillingをMailingにコピー
Criteria for Executing Actions:Conditions are met
[Contact].MailingCountry : Is null : ture
[Account].MailingState : Is null : ture
[Account].MailingCity : Is null : ture
[Account].MailingStreet : Is null : ture
[Account].MailingPostalCode : Is null : ture
Conditions:All of the conditions are met (AND)
3、
Update Records
Action Name:AccountのBillingをMailingにコピー
Record:[Contact]
Criteria for Updating Records:No criteria—just update the records!
Mailing City:Field Reference:[Contact].Account.BillingCity
Mailing Country:Field Reference:[Contact].Account.BillingCountry
Mailing Zip/Postal Code:Field Reference:[Contact].Account.BillingPostalCode
Mailing State/Province:Field Reference:[Contact].Account.BillingState
Mailing Street:Field Reference:[Contact].Account.BillingStreet
実際に見てみましょう。
新規Contactの場合、Account Nameは先の「C1」を選択します。
Mailing Addressは何も記入していない。
Saveを押下します。C1と同じ値を表示されることです。
Billing AddressとMailing Addressも変更する場合、お互いに影響なしの確認します。
Mailing Address
Billing Address
Mailing Addressを保存します。
Billing Addressを保存します。
これで完了です。
以上となります。
ご参考になれば幸いです。
Latest posts by zchao (see all)
- Auraでアクションボタン作成して画面のチェックボックス項目一括処理 - 2021年4月12日
- デフォルト項目値を含むレコード作成実例説明(defaultFieldValues) - 2021年1月9日
- Salesforce のノーコード・ローコード開発 - 2020年12月31日