+ Start a Discussion
i had gone through developer guide and other things, i need the a small example what really the metadata is with an example , of simple 
thanks and regards
Best Answer chosen by sreeja
In simple words metadata is just the data in your salesforce ORG that does not constitue as customer data.

Analogy: If in an excel sheet all rows are data. All the columns and the sheet itself would be called metadata.

Example all the objects and fields, Validation rules, Worflow rules are all called metadata.

Hope this helps!

Kiran ChodavadiyaKiran Chodavadiya 
I am facing this error while creating Test Class on Line No-25
What is solution or reson behind it ?
if anyone know how to solve this error, please share your knowledge.

Thank You.
public class TestApexHourTrigger {
        Static Void test(){
    	Invoice__c inv = new invoice__c();
        inv.Name = 'Test Invoice';
        insert inv;
        Invoice_Line_Up__c invlnup = new Invoice_Line_Up__c();
        invlnup.Name = 'Part 1';
        invlnup.Price__c = 500;
        invlnup.Invoice_Name__c = inv.Id;
        insert invlnup;
        Invoice_Line_Up__c invlnup2 = new Invoice_Line_Up__c();
        invlnup2.Name = 'Part 2';
        invlnup2.Price__c = 5000;
        invlnup2.Invoice_Name__c = inv.Id;
        insert invlnup2;
        Invoice__c verify = [select Total_Amount__c From Invoice__c where id =:inv.Id];

Best Answer chosen by Kiran Chodavadiya
SwethaSwetha (Salesforce Developers) 
HI Kiran,
Replace system.assertEqual with system.assertEquals and see if it fixes the issue.

See the list of supported "system methods" in salesforce. system.assertEqual does not exist

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Mubarak HussainMubarak Hussain 
Hi All,
What is an Workbench in Salesforce,and what is the difference between workbench,developer console and Force.com Explorer.

Best Answer chosen by Mubarak Hussain
Amit Chaudhary 8Amit Chaudhary 8
Link:- https://workbench.developerforce.com/login.php
Workbench is a powerful, web-based suite of tools designed for administrators and developers to interact with Salesforce.com organizations via the Force.com APIs. Workbench includes robust support for the Force.com Partner, Bulk, Rest, Streaming, Metadata, and Apex APIs that allows users to describe, query, manipulate, and migrate both data and metadata in Salesforce.com organizations directly in their web browser with a simple and intuitive user interface. Workbench also provides many advanced features for testing and troubleshooting the Force.com APIs, such as customizable SOAP headers, debug logs for API traffic, backward compatibility testing with previous API versions, and single sign-on integration within the Salesforce application.

Please check below post for more detail

Please let us know if this will help you

between workbench,developer console and Force.com Explorer all three are used almost for same.

Developer Console: The Developer Console is accessible from within your Salesforce organization, and provides a collection of tools you can use to create, edit, debug and test applications.

Force.com IDE: The Force.com IDE is a full-featured, Eclipse-based coding environment, with capabilities like code completion, version control, collaborative development, and project sharing.

Force.com Explorer: This cross-platform AIR application, still in beta, provides a lightweight tool that lets developers browse their schema, custom objects and fields, and build and test SOQL queries.

Workbench: This powerful, web-based suite of tools designed for adminstrators and developers to interact with Salesforce.com organizations via the Force.com APIs. Workbench includes robust support for the Force.com Partner, Bulk, Rest, Streaming, Metadata, and Apex APIs that allows users to describe, query, manipulate, and migrate both data and metadata in Salesforce.com organizations directly in their web browser with a simple and intuitive user interface.

Please let us know if this will help you

AMit Chaudhary
Rahul Garg SFDRahul Garg SFD 
An Apex transaction insert 100 Account records and 2000 Contact records  before encountering a DML exception when attempting to insert 500 Opportunity records. The Account record are inserted by calling the database.insert() method with the allOrNone argument set to false. The Contact and Opportunity record are inserted using the stand-alone insert statement.
How many total records will be committed to the database in this transaction?
A. 100
B. 2,100
C. 2,000
D. 0

Considering the salesforce documentation of Database.insert() when allOrNone is false, the answer should be A i.e 100. But, when I checked this on Anonymous window in developer console I get answer as D i.e 0.

Please help me with this solution.
Best Answer chosen by Rahul Garg SFD
Rahul Garg SFDRahul Garg SFD
Answer of this Question is D.

All insertions took place in one transaction and the transaction fails, so all records are rolledback even the one inserted form Database.insert().
Anthony Wheeler 1Anthony Wheeler 1 
I'm wondering if this is just a glitch in Salesforce and if anyone has any workaround. I currently have a Trigger on ContentDocumentLink that sends an email to the owner of a custom object record when a File or Note is created and attached to that record. The trigger also attaches file information and the body of the Note if it's a ContentNote being inserted. The trigger handles the logic in differentiating Notes from other file types. The problem is when the user hits the button to create a new Note in classic or in the Console, an empty, untitled, new note record is inserted instantly firing my trigger before the user has time to add content to the body. In Lightning it at least allows the user to fill out the header of the note before saving, but saves before the note body is filled out. Cancelling out of creating the note still leaves the blank note saved and attached to the record. Any help in understanding why the note saves before the user hits the save button would be appreciated.
Best Answer chosen by Anthony Wheeler 1
Ryan GreeneRyan Greene
This is an annoying way SF setup the Content Notes. It does save every secord or so after the user starts typing. The only way I could figure out how to overcome this issue is to run batch Apex, but then you loose the real time notifications. Might need to try hooking it up Chatter somehow.
Puneet KhoslaPuneet Khosla 
I am getting this error when trying to do the "Lightning Experience Rollout Specialist"

The AccountTab Visualforce page does not include one or both of the following: the apex:slds tag in the page, or the slds-table value in the table.

My code is as follows:
<apex:page standardStylesheets="false" standardController="Account" recordSetVar="accounts" tabStyle="account" applyHtmlTag="false" applyBodyTag="false" showHeader="false">
       <apex:slds />
    <div class="slds-scope">     
        <table class="slds-table">
    			<tr class="slds-text-title_caps">
      				<th scope="col">
        				<div class="slds-truncate" title="{!$ObjectType.Account.Fields.Name.Label}">{!$ObjectType.Account.Fields.Name.Label}</div>
    			<apex:repeat value="{!accounts}" var="a">
                  <td data-label="Account Name">
                    <div class="slds-truncate" ><apex:outputLink value="{!URLFOR($Action.Account.View, a.id)}">{!a.name}</apex:outputLink></div>
     <div class="slds-scope">
        <apex:pageBlock >
            <apex:pageBlockTable value="{!accounts}" var="a" styleClass="slds">
                <apex:column headerValue="{!$ObjectType.Account.Fields.Name.Label}">
                    <apex:outputLink value="{!URLFOR($Action.Account.View, a.id)}">{!a.name}</apex:outputLink>

Best Answer chosen by Puneet Khosla
Puneet KhoslaPuneet Khosla
Looks like I figured out.

styleClass="slds-table" needs to be added to pageBlockTable
YiQin HeYiQin He 

I created a lightning component as a quick action button. In the component, I have a cancel button that I want it closed when user clicks.
User-added image

But the problem is that I cannot find any document explain how to close the modal dialog. This is the ui code:
<aura:component controller="ContactController" implements="force:lightningQuickActionWithoutHeader,force:hasRecordId" >
        .changeRecordTypeRow {
        margin-top: 1.5rem;
        margin-bottom: 0;
        margin-left: 0;
        margin-right: 0;
        .changeRecordTypeLeftColumn {
        float: left;
        text-align: right;
        padding-right: 1.5rem;
        width: 35%;
        font-size: .8125rem;
        color: rgb(84, 105, 141);
        .changeRecordTypeRightColumn {
        float: right;
        text-align: left;
        width: 65%;
        	height:auto !important;
        .forceChatterLightningComponent .bodyWrapper{height:100%;width:100%;padding:0;box-sizing:border-box}
    <div class="modal-header slds-modal__header">
        <h2 class="title slds-text-heading--medium" >Change Contact Type</h2>
    <div class="scrollable slds-modal__content slds-p-around--medium">
        <div class="changeRecordTypeRow">
            <fieldset class="slds-form-element">
                <div class="changeRecordTypeLeftColumn">
                    <legend class="form-element__legend slds-form-element__label">Select a record type</legend>
                <div class="changeRecordTypeRightColumn slds-form-element__control">

                    <span class="slds-radio">
                        <input type="radio" id="radio_PrimaryContact" name="recordType" />
                        <label class="slds-radio__label" for="radio_PrimaryContact">
                            <span class="slds-radio--faux"></span>
                            <span class="slds-form-element__label">Primary Contact</span>
                    <span class="slds-radio">
                        <input type="radio" id="radio_SecondaryContact" name="recordType" />
                        <label class="slds-radio__label" for="radio_SecondaryContact">
                            <span class="slds-radio--faux"></span>
                            <span class="slds-form-element__label">Secondary Contact</span>
    <div class="modal-footer slds-modal__footer">
    	<div class="forceChangeRecordTypeFooter">
        	<button type="button" class="slds-button slds-button--neutral .slds-modal__close" aura:id="btnCancel" >
            <button type="button" class="slds-button slds-button--brand" aura:id="btnSave">
Does anyone have similar experience? Thanks in advance.
Best Answer chosen by YiQin He
YiQin HeYiQin He
Hi Karthik,

Thanks for the reply. I've already found the solution.
Call this method $A.get("e.force:closeQuickAction").fire() will close the modal dialog.

Hi All,
Help me on this, i want using validation rule "Dealer user cannot save if the selected picklist value in Status field in "Inquiry" record type in Case is "Uploaded".
Best Answer chosen by sanjusfdc
Prakash NawalePrakash Nawale

Use below code in validation rule to prevent creating of Case record based on your requirments.
            $User.Username = 'Dealer username',
            ISPICKVAL( Status , 'Uploaded') 

Please like the answer and mark it as best if this helps.
Craig WoodmanCraig Woodman 
I had a question, but answered it on my own. So since my search didn't reveal anything, I figured I would post it here in case anyone else is looking.

Does a Before Update flow (or one that is triggered by record create or change, that saves before the record is updated) work with lead creation by web-to-lead?

I had not seen this in any documentation. And searches didn't show anything. So I figured I would do some tests on my own.

I set up a test flow to write text to the Lead Description field on creation, that says "The before update flow worked!!!" I then went to the website, downloaded a catalog, and checked the description field. The text was written, with no delay to the web to lead record.

My use case for this is changing the record type automatically on a web to lead record, which passes in certain values. It works perfectly!

I hope that this helps anyone who is looking for this information!
Best Answer chosen by Craig Woodman
Craig WoodmanCraig Woodman
Thanks Anutej,  While this can be completed with a trigger, I wanted to show the functions of the new before save flow actions, and answer a question that I could not find about these flows.  Hopefully people can see this and see both solutions.
Pete Watson 5Pete Watson 5 
Hi All, 

Any help on the below would be much appreciated.

have the below trigger and its working perfectly in the sandbox but after deploying to prod I am getting a CPU time limit exeeded failure... 

trigger ProfileTrigger on User (before insert, before update) {
    List<Id> userIds = new List<Id>();
    List<Case> cases = new List<Case>();
    List<Case> casesToUpdate = new List<Case>();
    for(User u: Trigger.new) {
        if(u.out_of_office__c==True) {
        for (case c : (cases = [SELECT id, Status FROM Case where ownerId IN:userIds]))
            IF(c.Status == 'Assigned' || c.Status == 'Working' ||c.Status == 'Escalated'){
        update casesToUpdate;

Many thanks in advance! 
Best Answer chosen by Pete Watson 5
AnudeepAnudeep (Salesforce Developers) 
Hi Pete, 

I recommend adding Limits.getCpuTime() to check where there is the maximum consumption is
Integer cpuStart = Limits.getCpuTime();
System.debug('Before For loop = ' +cpuStart);

    for(User u: Trigger.new) {
        if(u.out_of_office__c==True) {
 System.debug('CPU time consumed in loop ' + (Limits.getCpuTime() - cpuStart));

// repeat this for the other for loop

// Check CPU time before DML

 cpuStart = Limits.getCpuTime();

 System.debug('Before DML = ' +cpuStart);

 update casesToUpdate;

I suggest comparing the debug logs between your sandbox and production when running this code

Also, review this help article