Avnish Yadav
IndividualForum Replies Created
-
Avnish Yadav
MemberSeptember 19, 2018 at 12:26 pm in reply to: In Batch class execute method default limit is 200.How can i Change this in salesforce?Hello,
Just pass the size argument in the executeBatch() method.
Ex- Database.executeBatch(new BatchClassName, size )
Thanks.
-
Avnish Yadav
MemberSeptember 19, 2018 at 12:23 pm in reply to: Write a syntax and structure of scheduler class in Salesforce?Hello,
Here is simple structure of Schedular Class-
global class BatchScheduleUpdate implements Schedulable { global void execute(SchedulableContext sc) { // Implement any logic to be scheduled // We now call the batch class to be scheduled BatchContactUpdate b = new BatchContactUpdate (); //Parameters of ExecuteBatch(context,BatchSize) database.executebatch(b,200); } }/pre> Thanks.
- This reply was modified 6 years, 2 months ago by Avnish Yadav.
-
Avnish Yadav
MemberSeptember 19, 2018 at 12:19 pm in reply to: What is the difference between WhoId and WhatId?Hello,
In simple Words, WhoId refers to the person while WhatId refers to Things in salesforce.
Thanks.
-
Avnish Yadav
MemberSeptember 19, 2018 at 9:10 am in reply to: How to get all the fields of Sobject using Dynamic Salesforce Apex?Hello Anurag,
Try this code
`
public class ControllerClassName
{
public ListstrList { get;set; } public void autoRun()
{
MapobjectFields = Schema.getGlobalDescribe().get('Account').getDescribe().fields.getMap(); strList = new List
(objectFields.keySet()); }
}
`
Thanks. -
Avnish Yadav
MemberSeptember 18, 2018 at 1:30 pm in reply to: How to add Javascript Remoting to a Visualforce Page in Salesforce?Hello,
Remote action function in salesforce allows user to access any method from any class through javasrcipt methods, and get the result as a javascript object for further manipulation.
Points to remember while implementing remote action function:
Remote action method should have @RemoteAction annotation.
The method should also be Global and StaticExample:-
global with sharing class ContactJs {
public ContactJs() { } // empty constructor@RemoteAction //the function to be called in remote action should use this annotation
global static list<Contact> getcon() {
//function should be static and global else it will throw error
list<Contact> con1 = [SELECT id,name FROM contact limit 5];
if(con1!=null && !con1.isEmpty()){
return con1;
}else{
return new list<contact>();
}
}
}
Vf Page:-<apex:page controller="ContactJs">
<script type = "text/javascript">
function getRemoteContact() {
var a;
Visualforce.remoting.Manager.invokeAction(
//Invoking controller action getcon
'{!$RemoteAction.ContactJs.getcon}',function(result, event){
//We can access the records through the parameter result
//event.status determines if there is error or not
if(event.status){
document.getElementById('remoteContactId').innerHTML = 'Contact Name: <br/><br/>';
for(a=0;a<result.length;a++){
document.getElementById('remoteContactId').innerHTML += result[a].Name +'<br/>';
}
}
},
{escape: true}
);
}
</script><button onclick="getRemoteContact()">Get Contact</button>
<div id="responseErrors"></div>
<apex:pageBlock id="block">
<apex:pageBlockSection id="blockSection" columns="2">
<span id="remoteContactId"></span>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:page>Hope this, will help you.
Thanks.
-
Avnish Yadav
MemberSeptember 18, 2018 at 1:27 pm in reply to: What is metadata - driven development model ?Hello,
The Lightning platform uses a metadata-driven development model to help app developers become more productive in putting together apps. It means that the basic functionality of an app—that is, the tabs, forms, and links—are defined as metadata in a database rather than being hard-coded in a programming language.
Thanks.
-
Avnish Yadav
MemberSeptember 18, 2018 at 1:25 pm in reply to: What is the difference between SOQL and SOSL?Hello,
SOSL can search multiple object types, which requires multiple separate queries in SOQL, in addition, all the relevant fields are already text indexed for SOSL, but the same fields don't have DB indexes, so SOQL queries against them will be slower. If you have a lot of data, these differences will be much more apparent.
Thanks.
-
Avnish Yadav
MemberSeptember 18, 2018 at 1:23 pm in reply to: How to use remote site settings in salesforceHello,
Before any Apex callout can call an external site, that site must be registered in the Remote Site Settings page, or the callout fails. Salesforce prevents calls to unauthorized network addresses.
To add a remote site setting:
From Setup, enter Remote Site Settings in the Quick Find box, then select Remote Site Settings.
Click New Remote Site.
Enter a descriptive term for the Remote Site Name.
Enter the URL for the remote site.
Optionally, enter a description of the site.
Click Save.Thanks.
-
Avnish Yadav
MemberSeptember 18, 2018 at 1:22 pm in reply to: Explain what does the “types” define in WSDL?Hello,
The type element defines all the data types used between the server and the client
To define data types WSDL uses the W3C XML Schema Specification as its default choice
Type element is not required if the service uses only simple XML schema types like integers and strings
To reuse the type with multiple web services, WSDL allows to define types in a separate elementsHope this will help you.
Thanks.
-
Avnish Yadav
MemberSeptember 18, 2018 at 1:20 pm in reply to: Mention the operation types response used in WSDL?Hello,
WSDL defines four types response. Request response is the most common operation type.
One way: It can receive a message but will not return response
Request response: It receives a request and will return a response
Solicit response: It sends a request and will wait for response
Notification: It sends a message but will not wait for a responseThanks.
-
Hello Agnes,
Create an Opportunities report where:
Show: All Opportunities
Opportunity Status: Closed Won
Probability: All
Date Range: TodayMake the report in Summary format. Summarize the results by Opportunity Owner (Sales Rep).
Include all fields necessary, but specifically, include the Amount field. Click the down arrow next to the Amount field in the preview results and select "Summarize this field". Check the SUM box and save.
Finally, click Show and uncheck the check next to Details and then click Run Report.
Hope this will help you.
Thanks.
-
Hello,
If we have to hide records from one person, one user in the organization, in a private model. We have to lock everything down to hide records from somebody and then use things like sharing rules to grant access back to the rest of the organization. So, if we have to put one person in the penalty box and make sure they can’t see their neighbors stuff, whatever that object might be, and then use sharing rules to grant access back.
Thanks.
-
Avnish Yadav
MemberSeptember 18, 2018 at 1:00 pm in reply to: What is the difference between SaaS and PaaS concepts in Salesforce?Hello,
PaaS solutions appeal to developers who want to spend more time coding, testing, and deploying their applications instead of dealing with hardware-oriented tasks such as managing security patches and operating system updates while SaaS providers host an application and make it available to users through the internet, usually a browser-based interface. As the most familiar category of cloud computing, users most commonly interact with SaaS applications such as Gmail, Dropbox, Salesforce, or Netflix.
Thanks.
-
Hello,
Cloud Flow Designer is a point-and-click tool that lets you automate business processes by building flows. A flow is an application that automates a business process by collecting data and doing something in your Salesforce org or an external system. Flows can either require user interaction—perhaps a wizard or guided UI for data entry—or run in the background on their own—perhaps something that automatically transfers records when a user’s role changes.
Thanks.
-
Avnish Yadav
MemberSeptember 18, 2018 at 7:28 am in reply to: How to rerender PageBlockSection through Visualforce checkbox?Hello,
I recommend you to use <apex:actionFunction> or Rerender feature of visualforce.
Thanks.
-
Avnish Yadav
MemberSeptember 18, 2018 at 6:54 am in reply to: Can I update profile after assigning to user?Hello,
Yes, you can update profile after assigning to the user.
Thanks.
-
Avnish Yadav
MemberSeptember 15, 2018 at 1:47 pm in reply to: What are some points to remember regarding Static Keyword in apex.Hi,
- Apex classes cannot be static.
2. Static allowed only in outer class.
3. Static variables not transferred as a part of View State.
4.Static variables and static block runs in order in which they are written in class.
5.Static variables are static only in scope of request.
Thanks
- Apex classes cannot be static.
-
Hello Prachi,
If you set more than one savepoint, then roll back to a savepoint that is not the last savepoint you generated, the later savepoint variables become invalid. For example, if you generated savepoint SP1 first, savepoint SP2 after that, and then you rolled back to SP1, the variable SP2 would no longer be valid. You will receive a runtime error if you try to use it.
Thanks.
-
Avnish Yadav
MemberSeptember 14, 2018 at 1:52 pm in reply to: What is the best way to deploy profiles in Salesforce?Hello,
I suggest you to use changeset to deploy profiles in Salesforce
Thanks.
-
Avnish Yadav
MemberSeptember 14, 2018 at 1:49 pm in reply to: Explain Standard and Custom Reports in SalesforceHello Anurag,
Standard Reports are the pre-built reports provided by Salesforce. They are more like Report Templates.
You can edit any standard report, make any changes as per requirement and save them with the different name. These are called custom reports.
Thanks.
-
Avnish Yadav
MemberSeptember 14, 2018 at 1:48 pm in reply to: What is community cloud model in Salesforce?Hello,
Community Cloud is an online social platform that enables companies to connect customers, partners, and employees with each other and the data and records they need to get work done. This next-generation portal combines the real-time collaboration of Chatter with the ability to share any file, data, or record anywhere and on any mobile device.
You can use Communities to:
• Drive more sales by connecting your employees with your distributors, resellers, and suppliers
• Deliver world-class service by giving your customers one place to get answers
• Manage social listening, content, engagement, and workflow all in one place
Thanks.
-
Avnish Yadav
MemberSeptember 14, 2018 at 1:39 pm in reply to: What is the difference between Render, Rerender And RenderAs attributes of Visualforce?Hello,
Rendered:
This to rendered(ie., display) particular filed or section based on boolean value. In the controller you need to have get method to assign the value for this variable.
Eg:
`
`
controller:
`
public boolean val{get;set;}method(){
val = true;
}
`
RederAs:It is render a VF page as PDF or some other
Eg:
`
`
ReRender:This is to ReReder(ie.,Reload) some fields, or sections after some operation/change. For this you need to assign id to field, sections.
Eg:
<apex:actionRegion >
<apex:inputField value="{!xxxx}" >
<apex:actionSupport event="onchange" rerender="id1,id2, id3" action="{!xxx}" >
<apex:param name="Para" value="{!rowNum}" assignTo="{!IndexValue}" />
</apex:actionSupport>
</apex:inputField>
</apex:actionRegion>
</apex:inputFiel>
id1,id2, id3 are the id's of field and sections -
Avnish Yadav
MemberSeptember 14, 2018 at 1:35 pm in reply to: Can we use SOSL statements in Salesforce triggers?Hello,
We can't use SOSL in Triggers Because the apex developer's guide says so-
SOSL statements evaluate to a list of lists of sObjects, where each list contains the search results for a particular sObject type. The result lists are always returned in the same order as they were specified in the SOSL query. SOSL queries are only supported in Apex classes and anonymous blocks. You cannot use a SOSL query in a trigger.
Thanks.
-
Avnish Yadav
MemberSeptember 14, 2018 at 1:30 pm in reply to: When to use before vs after Triggers in Salesforce?Hello,
Before Trigger:
In case of validation check in the same object.
Update the same object.
After Trigger:
Insert/Update related object, not the same object.
Notification Email.Thanks.
-
Avnish Yadav
MemberSeptember 14, 2018 at 1:28 pm in reply to: Can anyone explain what is an outbound message and how it works in Salesforce?Hey All,
I want to that if our endpoint goes down for a while, or if the network connection between salesforce and our server is flaky, will salesforce will retry sending a triggered outbound message or not.
Thanks. in advance.