コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
1106 ビュー

I am looking to create a filter that will let me reference the current logged-in user and show records that belong to them? 

アバター
破棄
著作者 最善の回答

This would depend on the model on which you are working, but the field to reference in such cases would be the " user_id". Please check if the user_id field exists in the model before creating the filter for the model.

As an example let's take the CRM app and create a filter that will display the opportunities that belong to the logged in user: 

So the filter will be created as follows: 

[("user_id", "=", uid)]

Where user_id is the Salesperson field on the opportunity and "uid" refers to the id of the logged in user. 

This filter will only show opportunities that belong to the logged-in salesperson. 

Similarly, if you have a user_id field in other models, we can create a similar filter referencing it. 

アバター
破棄
関連投稿 返信 ビュー 活動
1
9月 24
811
1
9月 24
1074
2
5月 25
3619
1
4月 25
606
1
4月 25
761