How to get metadata value from Apex controller to JS?
Always have StaticFactory class for your organization, its the best practice to use one method in different place to get value based on passing string parameter. so when ever you pass the strDeveloperName from js, on click of a button it returns the value in to the result, which I’m passing to this.passquerymdt, which will hold the value from metadata type.
import getMetadataValue from "@salesforce/apex/StaticFactory.getMetadataValue";
1.Manually enter Client Id and Client secret in Input field.
Every Time user has to Manually Generate RefreshToken
2.Using Custom Label or Custom settings.
when the client Id/secret is placed in custom label, client Id/secret is not editable while Installing as managed package .
when the client Id/secret is placed in Custom settings, client Id/secret is editable while Installing as managed package.
The use case is to generate Refresh token manually inorder to track who is asking for Refresh Token and when the data comes in to salesforce,so inorder track all this information refresh token is generated manually.
In This Example I have used Input field to manually enter Client Id and Client Secret to get the Refresh Token.
In the above HTML code, there are two parameters onsuccess and onerror which work as similar as standard controller in visualforce page for saving record and throwing error details before saving record.
When we click Save&New standard save functionality should work, but it shouldn’t redirect to any page, instead it should withstand in same page and clear the field values. so we have a parameter (this.redirect = false;) to stop the redirection to record page or list page.
There is one more parameter to handle the reset, only when we click save & New (this.resetpage = true;)
When you develop Lightning web components, while clicking cancel it has to take you back to the previous page,but in lightning there is no direct way to go back to previous page.
Scenario: Assume there is a New Button which is available in parent object Record page and the same button is available in Related list,In both scenarios it has to navigate different pages.but as of now in salesforce there is no parameter to hold the previous page data, so we are now directly hard coding in js file to navigate to record page or List page like below,
From Spring’20, When you click on button, you can navigate to a Record’s Create Page with Default Field Values. After clicking Save or Quick save be patient for few seconds and refresh the page using Ctrl + F5.
Hey - Do you like Salesforce and funny stories of a life that rarely stands still? You've come to the right place. This blog's run by a cheeky woman in Tech, who's an ENFP, a Salesforce MVP, a single mummy, a cancer survivor...whatever next? Oh yeah....#JourneytoCTA, Ladies Be Architects, some more cancer and the biggest exam in Salesforce. They gave me a golden hoodie, some awards and some new breasts that won't try to kill me. Once a Blezard, always a Blezard.