Skip to main content

Latest Post

Record Types & Page Layout Strategy

  Record Types & Page Layout Strategy 💬 In plain words:   Record Types let one object act like different forms for different teams. Different picklist values, page layouts, and processes — same Account object. Use them for truly different business processes. Not for cosmetic layout changes. 📌 Example:   One Account object, two businesses: 'Retail Customer' record type shows B2C picklist values and layout. 'Enterprise Client' shows contract fields and a different sales process. Same table, two costumes. 🧠 One object, many costumes:   A Record Type is a costume on the same object — different picklists and layouts, same table underneath. Concept Record Types split one object into business variants. •   Each type can carry its own subset of picklist values, its own business process — Lead, Case and Opportunity stages — and its own page layout per profile. •   Lightning has changed the calculus. Dynamic Forms and conditional comp...

Assign value to a apex variable in Visualforce page using javascript or jquery

Some time we need to send a variable value to apex class variable in visualforce page. There are many ways to do this. Here is very simple way to do this.

<apex:actionFunction id="ID" name="javascriptFunction" action="{!valuesUsingJS}">
        <apex:param value="" name="parameterName1"/>
        <apex:param value="" name="parameterName2"/>
</apex:actionFunction>

Yes, you are right. We are using action function here and sending value using parameter's as we do in class functions or javascript function. Here the next is pass values in these parameter. 
javascriptFunction(parameterName1, parameterName2);
Now get these values in apex class.
public void valuesUsingJS() {
        String Value1 = ApexPages.currentPage().getParameters().
                       get('parameterName1');
       String Value1 = ApexPages.currentPage().getParameters().
                       get('parameterName2');
       System.debug(value1);
       System.debug(value2);
}

Popular Posts

Salesforce LWC Code for Multi-Select Lookup

Introduction: In Salesforce Lightning Web Components (LWC), implementing a multi-select lookup field can enhance the user experience and provide greater flexibility for selecting multiple related records. In this blog post, we will walk through the process of creating a multi-select lookup field using LWC. We will cover the required code snippets and provide step-by-step instructions to help you implement this functionality in your Salesforce org.