Forum Replies Created

Page 56 of 57
  • shariq

    Member
    July 28, 2017 at 1:25 pm in reply to: Is there any way to move fields of custom object to opportunity?

    Hi Nitish,

    You can't transfer fields from one object to different object, you can create custom fields of same API name on that object.

    Hope this Helps.

  • shariq

    Member
    July 28, 2017 at 12:46 pm in reply to: What is the use of apex:facet in Salesforce Visualforce?

    Hi Shubham,

    You can refer to this link

  • Hi Adarsh,

    You can try this :-

    trigger testDelete on Account (before delete)
    {
    List acc = [SELECT Id, (SELECT Id FROM Opportunities ) FROM Account WHERE Id IN : Trigger.old];
    for(Account a : acc)
    {
    if(a.Opportunities.size()!=0)
    {
    a.addErrors('Cant Delete');
    }
    }
    }

  • Hi Shubham,

    This code is working fine for me, please check your org settings.

  • shariq

    Member
    July 26, 2017 at 12:53 pm in reply to: How can i write a Salesforce trigger for below given scenario ?

    Hi Aman,

    You can try this :-

    trigger ContactRoleTrigger on Opportunity (after update) {

    List opps = [select stagename,(select id from OpportunityContactRoles) from opportunity where id in:Trigger.new];
    for(Opportunity opp:opps){
    if(opp.OpportunityContactRoles.size() ==0 && opp.StageName=='closed Won'){
    opp.addError('error');
    }
    }
    }

  • shariq

    Member
    July 25, 2017 at 12:34 pm in reply to: What are Managed and Unmanaged packages in salesforce?

    Hi Aman,

    You can get the answer here

    Hope this helps.

  • Hi Kumar,

    As we know in Master Detail relationship parent is compulsory, but records which are already created doesn't
    have a parent, so you can only create a lookup relationship and then convert it to Master Detail.

    Hope this helps.

  • shariq

    Member
    July 24, 2017 at 1:29 pm in reply to: What are Sites in Salesforce?

    Hi Saloni,

    You can refer to this link

  • shariq

    Member
    July 24, 2017 at 10:54 am in reply to: Difference between controller and extensions in Salesforce?

    Hi Suraj,

    There are 3 types of controller :-

    Standard Controller :-

    These are provided by the platform so you can produce Visualforce pages without writing code. You'd use these when you have a singe object to manipulate. It provides a save method to allow you to persist changes. There's a variant of this that handles a collection of records - the standard list controller.

    Custom Controller :-

    This is written in Apex and requires you to write code for any behaviour you need. You'd use these when your page isn't dealing with a main object - e.g. A launch pad that can take you to a number of different sub pages.

    Extension Controller :-

    This provides additional functionality to a controller - either a standard controller (e.g to manipulate child records along with a parent) or a custom controller (this is often overlooked and is a way to provide common functionality across a number of pages).

  • shariq

    Member
    July 21, 2017 at 11:59 am in reply to: In Salesforce, How will you differentiate DML and SOQL?

    Hi Mohit,

    SOQL :-

    Salesforce Object Query Language is the language which is used to fetch data from salesforce database.
    Example :- [SELECT Id FROM Opportunity LIMT 100]

    DML :-

    Data Manipulation Language is the language which is used to Insert, Update or Delete data into/from database.
    Example :-
    Opportunity opp = new Opportunity(Name = 'oppTest', CloseDate = System.today(),StageName='Prospecting');
    Insert opp;

  • Hi Himanshu,

    Model-View-Controller :-

    Model -

    The Model is simply the underlying database. In Visualforce, it’s the collection of Salesforce objects and fields that we’d represent and modify in our page.

    View -

    The View is the code that makes up our page’s UI. In our case, it’s all of our Visualforce, HTML, CSS, and Javascript code.

    Controller -

    The Controller is the middle layer between the model and the view. It’s the Apex code that interacts with the database according to the view’s needs.

  • shariq

    Member
    July 20, 2017 at 12:05 pm in reply to: What is Inbound Message and Outbound Message in Salesforce?

    Hi Suraj,

    Inbound Messages :-

    Inbound web services, such as the REST API, allow third party to interact with your instance data using web service requests.

    Outbound Message :-

    Outbound web services allow you to access remote endpoints and perform web service requests from a your instance.

  • Hi Aman,

    Apex PageBlockTable:-

    A list of data displayed as a table within either an apex:pageBlock or apex:pageBlockSection component, similar to a related list or list view in a standard Salesforce page. Like an apex:dataTable, an apex:pageBlockTable is defined by iterating over a set of data, displaying information about one item of data per row. The set of data can contain up to 1,000 items, or 10,000 items when the page is executed in read-only mode.

    Apex Repeat:-

    An iteration component that allows you to output the contents of a collection according to a structure that you specify. The collection can include up to 1,000 items.

  • shariq

    Member
    July 19, 2017 at 1:47 pm in reply to: Why do we use interface in Salesforce Apex Class?

    Hi parv,

    An interface is like a class in which none of the methods have been implemented—the method signatures are there, but the body of each method is empty. To use an interface, another class must implement it by providing a body for all of the methods contained in the interface.

    Interfaces can provide a layer of abstraction to your code. They separate the specific implementation of a method from the declaration for that method. This way you can have different implementations of a method based on your specific application.

    For more information you can click here

  • shariq

    Member
    July 18, 2017 at 12:30 pm in reply to: What objects are available for triggers?

    Hi Himanshu,

    When you are going to create new Trigger, the List of objects are shown in the sObject picklist in New Apex Trigger tab.

  • Hi Suraj,

    apex:pagemessages :-

    apex:PageMessages is a containing component where any messages that have been added to the page will appear.

     

    apex:pagemessage :-

    apex:pageMessage is a component that adds a single message to the page.

     

  • shariq

    Member
    July 18, 2017 at 10:56 am in reply to: Display list in visualforce page

    Hi Ajay,

    you can try this :-

    Apex

    public class Records
    {
    public List con {get;set;}
    public void search()
    {
    con = [SELECT LastName, Id FROM Contact LIMIT 100];
    }
    }

    Visualforce Page

    <apex:page controller = "Records">
    <apex:form>
    <apex:pageBlock>
    <apex:commandButton value = "records" action = "{!search}"/>
    <apex:pageBlockTable value="{!con}" var = "contact">
    <apex:column value = "{!contact.LastName}"/>
    <apex:column value = "{!contact.Id}"/>
    </apex:pageBlockTable>
    </apex:pageBlock>
    </apex:form>
    </apex:page>

    • This reply was modified 7 years, 5 months ago by  shariq.
    • This reply was modified 7 years, 5 months ago by  shariq.
  • Hi Sushant,

    You can use Trigger.old method in trigger, for example :- [SELECT Id FROM Sobject__c WHERE Id IN : Trigger.old AND Id NOT IN : (List which includes all Sobject__c's Id)];

  • shariq

    Member
    July 17, 2017 at 1:48 pm in reply to: How to add error message in a Salesforce Apex Trigger?

    Hi Pranav,

    Yes you can add error messages in triggers by using Salesforce trigger addError method.
    For Example - Sobject.addError('Error Messages');

    • This reply was modified 7 years, 5 months ago by  shariq.
  • shariq

    Member
    July 17, 2017 at 1:15 pm in reply to: What is the Difference between Marketing cloud and pardot?

    Hi Aman,

    Pardot –

    Pardot is a lead nurturing and marketing automation platform from Salesforce. Engagement Studio, Pardot’s version of drip campaigns, is a significant step up from older generations of the tool. Its Engagement Programs allow you to send targeted emails based on real-time customer behavior, providing a personalized life cycle experience for your prospects. Lead scoring enables you to set and track specific responses to these various levels of engagement with your marketing efforts. Added to that you can also grade your prospects based on other information such as what industry they work in, the size of their company, or job title. Together with the scoring you can create a robust profile of potential clients, customer, or supporters.

    Marketing cloud -

    Cloud marketing is the process of an organisations efforts to market their goods and services online through integrated digital experiences, by which they are specialized for every single end user. Cloud marketing platforms are supported with third parties which maintain the platform.

    For more information click here

  • Hi Radhakrishna,

    Can you write the full code with description.

  • shariq

    Member
    July 14, 2017 at 1:56 pm in reply to: What is the working of Map in Salesforce?

    Thanks Aman, It helps a lot.

  • shariq

    Member
    July 14, 2017 at 1:44 pm in reply to: What is CSV (comma separated values) file in salesforce?

    Thanks Saloni, It helps a lot.

  • shariq

    Member
    July 14, 2017 at 12:39 pm in reply to: How to write a Salesforce trigger for below given scenario?

    Hi Raghav,

    Can you do this without using map.

  • shariq

    Member
    July 14, 2017 at 9:34 am in reply to: How can we count number of contacts associated with accounts?

    Hi Saloni,

    There is one more way to count number of contacts in account using SOQL query :-

    List contact = [Select Count(Id),Account.Name from Contact where Account.Id != null GROUP BY Account.Name];

    • This reply was modified 7 years, 5 months ago by  shariq.
Page 56 of 57