LoginSignup
0
0

More than 1 year has passed since last update.

Salesforce URL Hack in Lightning 3

Last updated at Posted at 2020-11-05

主従関係、参照関係の項目へのデフォルト値のセット

/lightning/o/JucyuMeisai__c/new?defaultFieldValues=Account__c={!JucyuMeisai__c.Account__c}

新しくレコードを作る時に、得意先(取引先)を引用したいと思っています。

Account__cにJucyuMeisai__c.Account__cをセットしようとするのですが上記式ではできません。
テキストの別の項目に値を入れてみると 何故か得意先(取引先)のNameが入っています。

試しに

/lightning/o/JucyuMeisai__c/new?defaultFieldValues=Account__c=001N000001vh5RiIAI

と、得意先(取引先)のIdをセットすると、ちゃんとデフォルト値がセットされます。
このIdは15桁、18桁のどちらでも機能しました。(2022/05/27確認)

どうも、JucyuMeisai__c.Account__cはIdを引用できてない感じ。

仕方ないので、新たに得意先(取引先)のIdである数式項目を作って、その数式項目をセットします。

/lightning/o/JucyuMeisai__c/new?defaultFieldValues=Account__c={!JucyuMeisai__c.AccountId__c}

これだと、きちんとセットできました。

何だろうなぁ。

アイデアに挙がっています。

Allow URL hacking feature is missing in Lightning

これを読んでいると
Salesforce had released URl hacking feature in Spring 20 for lightning. We are using it in our project, however, it has stopped working after Winter 21 release. Winter 21 release notes has no mention about the feature. This is impacting our all users.

@Salesforce Product Team, Do you have any plans to resolve the issue?

Winter21のリリース後に機能しなくなりましと... これってバグかな?

#式に改行があると動かない?

Lightning Navigate to Create Record with Default Values not working

backgroundContext

Auraでナビゲーションを使用している場合、backgroundContextは、「新規」アクションをオーバーライドするときに背景が空白になるという古い問題を解決します。

var pageReference = {
                "type": "standard__objectPage",
                "attributes": {
                    objectApiName: "Event",
                    actionName: "new",
                    additionalParams: ""
                },
                "state": {
                    navigationLocation: "LIST_VIEW",
                    backgroundContext: "/lightning/o/Event/home",
                    count: "1",
                    nooverride: '1',
                    defaultFieldValues: encodedValues,
                    recordTypeId: eventRecordTypeId
                }
            };

Spring 20 - Navigate to a Record’s Create Page with Default Field Values - Return URL not working

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