• Teodora
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 1
    Questions
  • 2
    Replies
I have created a LWC which uses the @api recordId in order to query some data from the apex controller. It all works properly when using the LWC on the record detail page.
The problem is that I need to open the LWC in a new browser tab. I'm not sure what the right approach is in this case. So far I have created two Lightning components in order to achieve this:
The first one(testContainer) includes the LWC:
<aura:component implements="force:lightningQuickActionWithoutHeader,force:appHostable,flexipage:availableForAllPageTypes,force:hasRecordId"> 
    <c:testLWC name="Test" /> 
</aura:component>

The second one just opens the first one in a new tab and passes over the record id:
<aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId" > 
    <div class="slds-text-align_center">Loading...</div> 
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> 
</aura:component>

and the controller:
({ doInit : function(component, event, helper) { 
    var evt = $A.get("e.force:navigateToComponent");
    evt.setParams({ 
         componentDef : "c:testContainer", 
         componentAttributes: { recordId : component.get("v.recordId") } 
    }); 
    evt.fire(); 
    }
})

Is there a simpler approach to open a LWC in a new tab from a record detail page? If not, then how can I get the record id from the LWC? Using this approach is seems like I cannot retrieve it.

I am a bit of a beginner at formulas, so hopefully one of you will think this is easy, and be able to help. :-)

 

Customer requirement:

 

Create a formula field that displays the Week Number (as Week 1, Week 2, etc), based on the Date entered on a particular record (same object).

 

Ex: 01/01/09 - 01/04/09 would return a value of "Week 1"  

01/05/09 - 01/11/09 = Week 2

01/12/09 - 01/18/09 = Week 3

 

and so on.....

 

Is using the CASE function the way to go, and if so, what's the shortest way to create this formula?

 

Thank you in advance!

S

 

  • April 20, 2009
  • Like
  • 0
Hi,

We used to be able to do this in Aura:
String labelName = 'mylabel';
$A.getReference("$Label.c."+ labelName);



$A is not accessible in LWC

Following the documentation I can only see a way to get access to Label's value through import.
As far as I know import don't work dynamically. You can only write an import if you know the name of the label.

I was hoping for a solution involving Apex and/or SOQL but could not find anything.

Any idea?