Panel Pane visibility rule based on users in entity reference field - drupal-7

I have a content type called 'company' with an entity reference field called 'company_managers' referencing users who will be allowed to add and edit other content types relating to this company.
The company node is displayed using panels. What I am struggling with is to create a visibility rule which will only show a panel-pane if the logged in user is referenced in the entity field 'company_managers' this will allow me to show panel panes specific to users in the 'company_managers' field.
So the psudo logic for the visibility rule would be:
Check if logged in user is contained in 'company_managers'
If yes show panel-pane
if no
dont show pane.
This seems such a simple use case that i dont want to create custom code it must be achievable 'out the box' I just cant seem to get to the answer. So after two days of researching am asking for help.
NOTE: have spoofed this behavior using the visibility rule content manager and manually selecting a user on this site. All I would need is to put in the logged in user but I dont think you can put in dynamic variables or tokens.
Help much appreciated.

Related

Need to have a custom field in salesforce object that will combine two other fields

We have a requirement where we need to combine two separate fields into one in the salesforce object and then removed those separate fields from the page layout but when the edit option is enabled in the salesforce portal to edit the object the eliminated fields should be there for edit. If further clarification is required, I can also do that
Click here to see the screenshot
I have tried the formula custom field type where I have to write a formula of concatenating the two fields like this given below:Text(Rent_Start_Date_Actual__c) & ","& Text(Rent_Start_Date_Type__c). I have also removed these two separate fields from salesforce page layout but it also gets removed when object window is in edit mode and we do not want that.
Rather than potentially messing with the edit page, have you considered using a simple screen Flow and an action to achieve this? For example, an action to 'Edit Rent Details' added to the page header, and then when clicked it presents the individual fields on a screen flow for editing? Once saved, the page would refresh and update the formula field as required.

How to show more fields on custom object tabs in Salesforce?

Ok so this problem is probably easily solvable, but since I am a beginner in Salesforce and I didn't find anything useful on Google, I am asking if someone can please help me.
So, as you can see, I have created a custom object called Students, and added some fields to it.
Next, I have created a custom object tab, called Student, as you can see on the following image and added some records.
On the custom object tab, only field 'Student Name' is shown. Does anybody know how to display all (or some) of the fields that were added to the object Student?
Thank you so much for your answers and have a great day :)
On the far right of the 2nd screenshot there's a gear/cog icon. Use it for o create new "list view". Or click that "recently viewed", change it to "all" (there should be an auto-generated one for you) and use that gear icon to select which fields to display.
You can even pin the list view to be your default if you don't want "recently viewed".
As for recently viewed itself - it's special, the gear icon won't work. Follow this article: https://help.salesforce.com/s/articleView?id=sf.customize_recent_records_list_lex.htm&type=5

PowerBI: Giving users the option to include or exclude a type of data

I'm creating my first PowerBI report, analysing staff absence data. The data contains a field of 'Absence Type', which categorises the type of absence the each record refers to.
I would like my users to be able to view my report both with and without the Absence Type of 'Pandemic'. I can hard-filter this on all pages by Excluding it but that gives the users no control.
I thought about using a slicer with a new custom column but I think that would be too confusing. If the column put a 'Yes' or 'No' as to whether the Absence Type was 'Pandemic', that would allow users to view the data without 'Pandemic' entries or just the 'Pandemic' entiries, but give no combined option. Even with a multiselect slicer they could easily deselect everything and see no results at all.
Ideally what I need is either an 'Include Pandemic?' slider where they can choose Yes or No (with Yes being everything and No being everything minus Pandemic records) or a button they can click to toggle the Pandemic records in or out of the visuals.
Apologies if this is has an obvious answer, I'm pioneering PowerBI for my organisation so don't really have anyone to ask here!
There's a way to do this, but it's a bit painful. So you'll want to consider just putting a slicer on AbsenseType and letting the user figure it out.
The extensibility point you can use here is Buttons and Bookmarks.
You can create two buttons, each associated with a Bookmark. Each bookmark can activate set of filters, so one can exclude pandemic AbsenseType and the other can include it. Bookmarks can also toggle the visibility of visuals (see eg here). So when the "ExcludePandemic" bookmark is active, the appropriate filter is active, and the "Include Pandemic" button is visible. When the "IncludePandemic" bookmark is active, the "Exclude Pandemic" button is visible.
In my opinion, the best solution would be tocreate a custom column that will have 2 values:
Pandemic - if the type is Pandemic
Non Pandemic - if the type is different than pandemic
You would then use this new column + Absence Type as a hierarchical slicer.
This would give the user the abilty to pick and choose between:
Select all (If the user deselects everything a select all will also be applied)
Non pandemic only
Pandemic only
Any one or more absence type

Is there any way to force "View as Visitor Group" to show in edit mode?

The "View as Visitor Group" option only shows in the EPiServer editor when there is content for visitor groups added to the rich text areas. If you have code based customisations then this makes it hard to preview your changes.
Is it possible to trigger this to show all the time or based on some decision in code?
Currently the workaround is to temporarily add some visitor group content to a text area, save & view, then "View as Visitor Group", then delete the temporary content in the text area before saving which isn't ideal.
This is EPiServer 6R2 (aka 6.1)
Original question: http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=74864 (lifeless forum, ugh). Posted here as I also want to know the answer as I'm working on similar functionality to the original author.
There is an interface IPersonalizedRoles that makes the View as visitor group menu appear if it is implemented on a property. However I think you have to create a custom property to use the interface yourself.
The SDK for the interface: http://world.episerver.com/Documentation/Class-library/?documentId=cms/7/68f4d6ca-e9a5-884d-4ca8-e5431a345112
You implement GetRoles() and return an IEnumerable with the visitor group GUID ID:s that you want to show up in the list.
Maybe you can create a custom dummy property and return your groups there?

Visualforce Custom lookup visualforce page

I was wondering if there is a way to override the native functionality of the lookup field in Salesforce and replace it with a visualforce page. The reason I'm trying to override this button is because when the user does a look up, the look up returns everybody with that name. What we want to return is a list of all the contacts by account for the contact being searched.
Here's what I'm trying to achieve:
When the user clicks the lookup button my visualforce page will launch and allow the user to see the account and all the contacts of that account.
Is this even possible? What other ways would you suggest going about this?
Here's a screen shot of what I'm trying to change:
Thanks for all your help!
It sounds really like you just need to customise the columns on the lookup to make it better suited to your needs. If you go to Setup -> Customize -> Contacts -> Search Layouts, you'll see entries for Lookup Dialogs and Lookup Phone Dialogs, there you can edit the columns displayed in the lookup windows.
If you really need a custom solution:
You can't override the lookup page itself, but you could create a new visualforce page for your account, using <apex:detail> and other similar tags to make your life simpler. Then you could include a search section underneath, where a user can enter various search terms which you put into a dynamic SOQL query and then render the results for them to choose from.
yeah its possible by javascript as i did by visual force page that will show the records of related lists and upon selection id of that record passed to parent window by jscipt. and performed same functionality ..
As far as I know - NO.
As a workaround you can use JavaScript.
What we did in our situation? We implement everything in JavaScript. We created an inputText and right on the right of this inputText we placed image with this lookup icon. On image click we create ExtJS popup window (I think you can simply create VF page and show this page in popup window). After window was closed you fill in the inputText field.
There's no out-of-the-box override for this button, last I checked, so something custom would be required. If you're set on having a popup and do not want an inline solution, I'd recommend reviewing this tutorial to get familiar with some of the issues with popups in Visualforce.
But considering what you are looking to accomplish, you could also have your account and filtered list of all contacts associated with that account appear inline on your page when the user clicks a new, custom search button. Of course that page would itself be in Visualforce (or inline Visualforce in a standard page layout) - which you may or may not want to have to code and maintain.
The AJAX Toolkit might also be a good place to start if you want to go with a custom JavaScript button placed on a standard page layout.

Resources