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
sreekanth vallepusreekanth vallepu 

what is ment by params what is the purpose to use the params

what is ment params could pls explain that at the same time suggest any vidoes about params  (easily understand)
PriyaPriya (Salesforce Developers) 

Hi Sreekanth,

<apex:param> tag is use to pass values from JavaScript to an Apex controller,it can only be used with the folloing parent tags : - 
  • <apex:actionFunction>
  • <apex:actionSupport>
  • <apex:commandLink>
  • <apex:outputLink>
  • <apex:outputText>
  • <flow:interview>

For example refer this article :- 
https://www.xgeek.net/salesforce/the-usage-of-apexparam-in-visualforce-page/

https://webkul.com/blog/use-apexparam-tag-visualforce/

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_param.htm

These above documetns have clearly explained the usage of param attributes. 

Please mark it as best answer if the above information helps you. It can help others in future.

Regards,

Priya Ranjan

Suraj Tripathi 47Suraj Tripathi 47

Hi Sreekanth,

You are asking about params in which context.

params in aura Lightning??

sreekanth vallepusreekanth vallepu
in development bro and aura also
Suraj Tripathi 47Suraj Tripathi 47

you can take reference from the below code

aura:method name="sampleMethod" action="{!c.doAction}" 
  description="Sample method with parameters"> 
    <aura:attribute name="param1" type="String" default="parameter 1"/> 
    <aura:attribute name="param2" type="Object" /> 
</aura:method>
({
    doAction : function(cmp, event) {
        var params = event.getParam('arguments');
        if (params) {
            var param1 = params.param1;
            // add your code here
        }
    }
})


Youtube Link : https://www.youtube.com/watch?v=sTzoJocW9-s

Thank You

sreekanth vallepusreekanth vallepu
What is the purpose brother to write params
Suraj Tripathi 47Suraj Tripathi 47

Brother, params are basically parameters Like  if I am talking about "setParams" then

action.setParams({
            FN:component.get("{!v.FirstName}"),
            LN:component.get("{!v.LastName}"),
            Eml:component.get("{!v.Email}"),
            Phn:component.get("{!v.Phone}"),
        });

Here component.get("{!v.FirstName}") is a single parameter that contain FirstName from AuraComponent and then this parameter "component.get("{!v.FirstName}")" is setted in apex controller of FN.

Here All these params: component.get("{!v.FirstName}"),component.get("{!v.LastName}"),component.get("{!v.Email}"),component.get("{!v.Phone}"),

setted into Apex controller : FN,LN,Eml,Phn

 

 

CharuDuttCharuDutt
HiiSreekanth vallepu
Params  Are The Parameter You Pass In The Apex Class Like Example Below
Parameter In This Apex Class 
searchKey ,lmt


public class AccRelatedConC {
  @AuraEnabled(cacheable=true)
    public static List<Account> fetchAcc (String searchKey ,integer lmt){
       list<Account> lstAcc = [Select id,Name From Account Where Name =:Searchkey limit :lmt];
        return lstAcc;
    }  
}

And To Pass These Parameters From Lightning Component We Use  (action.setParams) to set Parameters From Lightning Component To Apex Class   Like Example Below.
SearchHelper : function(component, event, helper) {
        var action = component.get('c.fetchAcc');
         action.setParams({ searchKey : component.get("v.searchKeyword"),
                          lmt : component.get("v.NumberRecords")});
        action.setCallback(this, function(response){
            var state = response.getState();
            if(state === "SUCCESS"){
               /*code if success*/
            }
            else if(state === "ERROR") {
               /*code if error*/ 
            }
        });
        $A.enqueueAction(action);
    }
Please Mark It As Best Answer If It Helps
Thank You!