Forum Replies Created

Page 15 of 21
  • Avnish Yadav

    Member
    September 4, 2018 at 7:23 am in reply to: present validation error under inputtext field in Salesforce

    Hi Jos,

    This will help you,

    Controller Page

    public with sharing class Regpagedemo1ctrl {
    public String emailError{get;set;}
    public String email{get;set;}
    public String passwordError{get;set;}
    public String password{get;set;}
    public Boolean shwErrorMail{get;set;}
    public Boolean shwErrorPswd{get;set;}

    public Regpagedemo1ctrl(){
    shwErrorMail = False;
    shwErrorPswd = False;
    }

    public PageReference checkEmail() {
    shwErrorMail = False;
    shwErrorPswd = False;
    if(email == ''){
    emailError ='ENTER EMAIL';
    shwErrorMail = True;
    }

    if(password == ''){
    passwordError = 'ENTER PASSWORD';
    shwErrorPswd = True;
    }

    return null;
    }}

    Vf page:-

    <apex:page controller="Regpagedemo1ctrl" >
    <apex:form id="mnFrmId">
    <apex:pageBlock id="mnPgBlkId">
    <table id="TblId">
    <tr>
    <td>
    <apex:outputText > Email Address: </apex:outputText>
    </td>
    <td>
    <apex:inputText id="myEmlId" value="{!email}"/>
    </td>
    </tr>
    <tr>
    <td></td>
    <td>
    <apex:outputText rendered="{!shwErrorMail}"> <span style="color:red;">{!emailError}</span></apex:outputText>
    </td>
    </tr>

    <tr>
    <td>
    <apex:outputText value="Password: "/>
    </td>
    <td>
    <apex:inputText id="myPswdId" value="{!password}"/>
    </td>
    </tr>
    <tr>
    <td></td>
    <td>
    <apex:outputText rendered="{!shwErrorPswd}"> <span style="color:red;">{!passwordError}</span></apex:outputText>
    </td>
    </tr>
    <tr>
    <td>
    <apex:commandButton value="Click me!" action="{!checkEmail}" reRender="mnFrmId"/>
    </td>
    </tr>
    </table>
    </apex:pageBlock>

    </apex:form>

    Thanks.

  • Avnish Yadav

    Member
    September 3, 2018 at 1:57 pm in reply to: What is SOSL truncation?

    Hi Anjali,

    Truncation is the process of the search for partitions is completed. After the SOSL completes the scanning of all partitions (with whatever limit is being used), we then apply to share and any "WHERE" clauses to the returned rows. This can result in eliminating all returned rows and a possibility of returning 0 records to the end user.

    Thanks.

  • Hi Prachi,

    As a salesforce best practice, if something can be done using Configurations (Declarative) then its preferred over coding. The declarative framework is optimized for the platform and is always preffered.

    Hope this Answer help you.

    Thanks.

  • Avnish Yadav

    Member
    September 3, 2018 at 1:37 pm in reply to: StandardSetController in salesforce

    Hello,

    StandardSetController allows us to create list controllers similar to, or as extensions of, the pre-built Visualforce list controllers provided by Salesforce.

    For e.g-  when you want to override a tab or list view with your custom visualforce page like:-

    Page:-

    <apex:page standardController="Account" recordsetvar="Accounts extension="AccListController">

    <apex:pageBlock>
    <apex:pageBlockTable value="{!accountList}" var="acc">
    <apex:column value="{!acc.Name}"/>
    <apex:column value="{!acc.Amount}"/>
    </apex:pageBlockTable>
    </apex:pageBlock>

    </apex:page>

     

    Controller

    public class AccListController{
    // ApexPages.StandardSetController must be instantiated
    // for standard list controllers
    public ApexPages.StandardSetController setCon {
    get {
    if(setCon == null) {
    setCon = new ApexPages.StandardSetController(Database.getQueryLocator(
    [SELECT Name, Amount FROM Account]));
    }
    return setCon;
    }
    set;
    }

    // Initialize setCon and return a list of records
    public List<Account> getAccountList() {
    return (List<Account>) setCon.getRecords();
    }
    }

    Thanks.

  • Hi Anjali,

    Master-Detail Relationship data types will be converted to look up relationship data types.
    If we undelete any object from recycle bin, then all master-detail relationship will be changed to lookup relationship.

    Thanks.

  • Avnish Yadav

    Member
    August 31, 2018 at 12:57 pm in reply to: Explain Organization wide default (OWD) in Salesforce.

    Hi Anjali,

    OWD stands for Organization-wide defaults. This setting is defined at object level. OWD defined the default record level sharing for objects. All profiles get at least the privileges defined in OWD. OWD takes three different values -

    A. Private
    B. Public Read-only
    C. Public Read-Write

    To find out what should be set as OWD for an object, first find out which user requires least access to an object. OWD is set based upon this users access requirements.
    Most restrictive record access is defined using OWD. Access to additional records is made available through Role hierarchy, Sharing rules, Manual sharing.

    Thanks.

  • Avnish Yadav

    Member
    August 31, 2018 at 12:54 pm in reply to: How to create share table record using apex in Salesforce?

    Hi Anjali,

    Share table contains four columns: ParentId, UserOrGroupId, RowCause, AccessLevel.
    Below is code to create position__share record:
    Position__share p = new Position__share();
    p.parentId = ‘Position Record Id which needs to be shared’;
    p.userOrGroupId= ‘User id or Group id with which we want to share record’;
    p.RowCause=’ apex sharing reason defined for a custom object, here for position__c’;
    p.AccessLevel =’access level for the record’; //can be Read or Edit
    insert p;

    Note: you cannot update share table record. The system only allows insert or delete of records for the share table. So if you have to change access for the user, you have created a new record and can delete an already existing record if you want.

    Hope this will help you.

    Thanks.

  • Avnish Yadav

    Member
    August 31, 2018 at 10:33 am in reply to: How to query an Async method in Salesforce Apex?

    Hello Anurag,

    Use the following snippet to query your async jobs:-

    AsyncApexJob jobInfo = [SELECT Status, NumberOfErrors
    FROM AsyncApexJob WHERE Id = :jobID];

    Thanks.

  • Avnish Yadav

    Member
    August 31, 2018 at 10:28 am in reply to: Please provide some solution i am having this kind of error

    Hi Parul,

    I think, this error: $(...).tablesorter is not a function it makes me think that more than one copy of jQuery is being loaded on the page. Please make sure that only one copy of jQuery is loaded.

    Thanks.

  • Avnish Yadav

    Member
    August 31, 2018 at 10:22 am in reply to: How to insert various values in a field in comma saperated form?

    Hello Chanchal,

    Can you Please elaborate your question.

    Thanks.

     

  • Hi Prachi,

    Person Account is used for B2C & Business Account is a B2B model in Salesforce. In real life, headquarter or head office of business Account can never be person Account. Therefore we cannot choose Person Account as parent Account for Business Account. It will throw an error –Parent Account may not be a person account

    Thanks.

  • Hi Prachi,

    The end user must need to have “Apex Author” permission and this is something should not be granted to end user. Also, while creating a JavaScript button, a user must be aware that its only supported in Salesforce classic and not in Salesforce Lightning.

    Thanks.

  • Avnish Yadav

    Member
    August 29, 2018 at 12:34 pm in reply to: Can we create a field on Person Account directly in Salesforce?

    Hi Prachi,

    No. We need to create a field on contact which will appear for Person Account as well. Fields created on Contact appear on Account with extension __pc.

    Thanks.

  • Avnish Yadav

    Member
    August 29, 2018 at 12:15 pm in reply to: Custom Metadata Types in salesforce

    Hi Shradha,

    Custom Metadata types represent the metadata associated with a custom metadata type.

    A custom metadata type is defined as a custom object and is stored in the objects folder. Custom metadata types have a suffix of __mdt (instead of __c for custom objects). Custom metadata type field names have a suffix of __c, like other custom fields. Custom metadata type field names must be dot-qualified with the name of the custom metadata type to which they belong.

    Names of custom metadata types must be unique within their namespace. All custom metadata types belong to the CustomMetadata namespace and can optionally belong to a second namespace. In your organization, you can use custom metadata types with your namespace and also other organizations’ namespaces.

    Thanks.

  • Avnish Yadav

    Member
    August 29, 2018 at 6:09 am in reply to: How to send " .ICS " file in salesforce?

    Hi Chanchal,

    Please check the below post for the same issue with attachment.
    https://developer.salesforce.com/forums/?id=906F00000008pwTIAQ

    As far as i am concerned we cannot send .ics file from salesforce without an attachment.

    Thanks.

  • Avnish Yadav

    Member
    August 28, 2018 at 8:02 am in reply to: limitations of sending mass emails in salesforce

    Hi Shradha,

    You can send mass email to a maximum of 5,000 external email addresses per day per org based on Greenwich Mean Time (GMT).

    Thanks.

  • Avnish Yadav

    Member
    August 28, 2018 at 7:55 am in reply to: What are the uses of big objects in Salesforce?

    Hi Shradha,

    Big objects let you store and manage massive amounts of data on the Salesforce platform.

    Big objects capture data for use within Lightning Platform and are accessible via a standard set of APIs to clients and external systems. What differentiates big objects is that they have been built to provide consistent performance whether there are 1 million records, 100 million, or even 1 billion records. This scale is what gives big objects their power and what defines the features that are provided.

    There are two types of big objects.

    Standard big objects — Objects defined by Salesforce and included in Salesforce products. FieldHistoryArchive is a standard big object that stores data as part of the Field Audit Trail product.

    Custom big objects — New objects that you create to store information unique to your org. Custom big objects extend the functionality that Lightning Platform provides. For example, if you’re building an app to track product inventory, create a custom big object called HistoricalInventoryLevels to track historical inventory levels for analysis and future optimizations.

    Thanks.

  • Hi Prachi,

    Invocable method will not accept more than one argument as a method parameter
    Only static methods can be invocable methods
    More than one invocable method is not allowed per class

    Thanks.

  • Avnish Yadav

    Member
    August 27, 2018 at 12:44 pm in reply to: Explain the use of an Outbound Message in Salesforce?

    Hi Prachi,

    An outbound message is one automation function that can fire from a workflow rule. They can send a message to external web services which can contain field values, this can subsequently kick off additional processes in external systems.

    Thanks.

  • Hi Anurag,

    Yes and No , no way so far for multiple apex controllers link to one aura component. but component allows include child components or inherited from super component. Each component has one controller.

    using inheritance

    <!-- BaseComponent -->
    <aura:component extensible="true" controller="BaseComponentController">
    </aura:component>

    <!-- child component -->
    <aura:component extends="BaseComponent"
    controller="childComponentController">
    </aura:component>
    Invoke Base component helper method from child component, then invoke BaseComponentController methods.

    Thanks.

  • Hi Prachi,

    Top 50 Salesforce Interview Questions And Answers
    This list of Salesforce interview questions is divided into 9 sections, each for different aspects of Salesforce. #8 has answer to your question.

    Salesforce fundamentals
    Declarative features
    Audit & reporting features
    Data modeling and data management
    Logic & process automation
    Software testing
    Debug & deployment tools
    Integration features
    Programmatic features

    A. Salesforce Fundamentals – Salesforce Interview Questions
    1. Can two users have the same profile? Can two profiles be assigned to the same user?
    Profiles determine the level of access a user can have in a Salesforce org.

    As far as the first part of the question is concerned, Yes. One profile can be assigned to any number of users. Take the example of a Sales or Service team in a company. The entire team will be assigned the same profile. The admin can create one profile: Sales Profile, which will have access to the Leads, Opportunities, Campaigns, Contacts and other objects deemed necessary by the company.

    In this way, many users can be assigned the same profile. In case the team lead or manager need access to additional records/ objects then it can be done by assigning permission sets only for those users.

    Answering the second part of the question, each user can only be assigned 1 profile.

    2. What are Governor Limits in Salesforce?
    In Salesforce, it is the Governor Limits which controls how much data or how many records you can store in the shared databases. Why? Because Salesforce is based on the concept of multi-tenant architecture. In simpler words, Salesforce uses a single database to store the data of multiple clients/ customers. The below image will help you relate to this concept.
    To make sure no single client monopolizes the shared resources, Salesforce introduced the concept of Governor Limits which is strictly enforced by the Apex run-time engine.

    Governor Limits are a Salesforce developer’s biggest challenge. That is because if the Apex code ever exceeds the limit, the expected governor issues a run-time exception that cannot be handled. Hence as a Salesforce developer, you have to be very careful while developing your application.

    Different Governor Limits in Salesforce are:

    Per-Transaction Apex Limits
    Force.com Platform Apex Limits
    Static Apex Limits
    Size-Specific Apex Limits
    Miscellaneous Apex Limits
    Email Limits
    Push Notification Limits

    3. What is a sandbox org? What are the different types of sandboxes in Salesforce?
    A sandbox is a copy of the production environment/ org, used for testing and development purposes. It’s useful because it allows development on Apex programming without disturbing the production environment.

    When can you use it?
    You can use it when you want to test a newly developed Force.com application or Visualforce page. You can develop and test it in the Sandbox org instead of doing it directly in production.

    This way, you can develop the application without any hassle and then migrate the metadata and data (if applicable) to the production environment. Doing this in a non-production environment allows developers to freely test and experiment applications end to end.

    Types of Sandboxes are:

    Developer
    Developer Pro
    Partial Copy
    Full

    4. Can you edit an apex trigger/ apex class in production environment? Can you edit a Visualforce page in production environment?
    No, it is not possible to edit apex classes and triggers directly in production environment.

    It needs to be done first in Developer edition or testing org or in Sandbox org. Then, to deploy it in production, a user with Author Apex permission must deploy the triggers and classes using deployment tools.

    However, Visualforce pages can be created and edited in both sandbox and in production.

    Only if the page has to do something unique (different values), it would have to be developed via Sandbox.

    5. What are the different data types that a standard field record name can have?
    A standard field record name can have data type of either auto number or text field with a limit of 80 chars.

    For generating auto numbers, the format needs to be specified while defining the field and after that for every record that is added, the number will get auto generated. For example:-
    Sr No-{1}
    Sr No-{2}
    Sr No-{3}

    6. Why are Visualforce pages served from a different domain?
    Visualforce pages are served from a different domain to improve security standards and block cross-site scripting. Take a look at the highlighted portion in the below Visualforce page:-

    B. Declarative Features – Salesforce Interview Questions

    7. What is WhoId and WhatId in activities?
    WhoID refers to people. Typically: contacts or leads. Example: LeadID, ContactID

    WhatID refers to objects. Example: AccountID, OpportunityID

    8. What is the use of writing sharing rules? Can you use sharing rules to restrict data access?
    Sharing rules are written to give edit access (public read and write) or public read-only access to certain individuals in Salesforce Org. A classic example is when:- only your managers or superiors need to be given extra credentials to your records in objects as compared to your peers.

    By default, all users in your organization will have organization-wide-default sharing settings of either Public Read Only or Private.
    To give access to more records, which users do not own, we write sharing rules.
    Example: Sharing rules are used to extend sharing access to users in public groups or roles. Hence, sharing rules are not as strict as organization-wide default settings. They allow greater access for those users

    Thanks.

  • Hi Prachi,

    Yes. You can have a roll-up summary in case of a master-detail relationship. But not in case of a lookup relationship.

    A roll-up summary field is used to display a value in a master record based on the values of a set of fields in a detail record. The detail record must be related to the master through a master-detail relationship.

    There are 4 calculations that you can do using roll-up summary field. You can count the number of detail records related to a master record. Or, you can calculate the sum, minimum value, or maximum value of a field in the detail records.

    Thanks.

  • Hi Anjali,

    The user must have “View All Data” permission is required to set the running users.

    Thanks.

  • Avnish Yadav

    Member
    August 23, 2018 at 6:33 am in reply to: Is there any expression to bind in Salesforce controllers?

    Hi Madhulika,

    With the help of methods, we can bind in controllers inside VisualForce pages.

    1. Values are returned by ‘Getter’ to VisualForce Page from the controller.
    2. Values are passed by ‘Setter’ from VisualForce page to controller.
    3. Redirect to another page with ‘action’.

    Thanks.

  • Avnish Yadav

    Member
    August 22, 2018 at 1:08 pm in reply to: What does the Action Status component do?

    Hi Prachi,

    Action status is usually used to show the status of an Ajax Process to which it is related to. It can be as simple as showing text during the update to as fancy as greying out the page and showing a loading gif. your imagination (and HTML CSS skills) are the limits.

    Thanks.

Page 15 of 21