[SalesForce] sObjectName and lightning quick action

I have a lightning quick action that needs to check the sObjectName to trigger a conditional action that will fill some fields depending on it.

The problem that I encounter is that when using the implements for the lightning quick action and the hasSObjectName the value is empty but I can get the recordId using the same method and there's no error.

<aura:component description="ClonePricebook"
<p>{!v.recordId}</p> //Filled
<p>{!v.sObjectName}</p> // Empty

According to the release notes of Summer 17 (https://releasenotes.docs.salesforce.com/en-us/summer17/release-notes/rn_lightning_force_hassobjectname.htm) I should be able to use it inside a quick action.

Why can't I get the sObjectName in this case ?

Best Answer

Can you re-check this please. Because I tried the exact same code in my org and its working fine.

Please check the screen shots -


Adding action button

Click on actin button

Note - Can you check your component version number once. Mine is 40 and it works fine.