function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
B kldB kld 

Open a case record in Salesforce 1 app, when i click a button in the Component.(I my example i mentione a static ID for testing, but the ID is dynamic)

I have developed a lightning component as below.
I have a Lightning Component Navigate.cmp.
In that a Button is there.
When i click that button it should open a record of case there itself means in Salesforce1 app itself.(in my example i mentioned one satic ID)

But it's not opening the record. Can any one guide me how to open a record when button clicks.

Here is my Component and .js code

Component
<aura:component >
        <ui:button press="{!c.navigate}" label="NavigateURL" ></ui:button>
</aura:component>
.js
({
    navigate : function(component, event, helper) {
        var urlEvent = $A.get("e.force:navigateToURL");
        var myUrl = '#/sObject/' + '50028000002MXyV'+ '/view';
        urlEvent.setParams({
          "url": myUrl
        });
        urlEvent.fire();
        }
})

please guide me. I have stuck here.
Thanks in advance.
SonamSonam (Salesforce Developers) 
When using navigateToURL, you can directly use the relative URL for the record - that is : 
   var myUrl = '/50028000002MXyV';

reference: https://developer.salesforce.com/docs/atlas.en-us.salesforce1.meta/salesforce1/salesforce1_dev_jsapi_sforce_one.htm