Forum Replies Created

Page 2 of 5
  • shradha jain

    Member
    August 31, 2018 at 8:52 am in reply to: RESTful web service in salesforce

    Hello Madhulika,

    As HTTP URL paths are used as a part of RESTful web service, so they need to be secured. Some of the best practices include the following

    • Perform validation of all inputs on the server from SQL injection attacks.
    • Perform user’s session based authentication whenever a request is made.
    • Never use sensitive data like username, session token password, etc through URL. These should be passed via POST method.
    • Methods like GET, POST, PUT, DELETE, etc should be executed with proper restrictions.
    • HTTP generic error message should be invoked wherever required.

    Thanks.

  • shradha jain

    Member
    August 31, 2018 at 8:11 am in reply to: Operation types response in WSDL in salesforce

    Hello Madhulika,

    WSDL basically defines 4 types of Operation type responses. These are enlisted below:

    • One-way: Receives a message but does not return response.
    • Request-Response: Receives a request and return a response.
    • Solicit-Response: Sends a request and wait for a response.
    • Notification: Sends a message but does not wait for a response.

    Thanks.

  • Hello Prachi,

    Summary and joined reports can have up to three grouping levels. Matrix reports can have two row and two column groupings.

    Thanks.

  • Hello Chanchal,

    You can follow these steps to resolve this error:

    • select all
    • copy
    • close file (yes to close without saving)
    • open file again
    • paste and save.

    Thanks.

  • Hello Prachi,

    The main difference between the Lightning tags and force tags is force tags works as apex:inputField tags work on the VF page. For example, if we are using forceInputField for the picklist field then it will show the input in picklist format with the respected values. It also supports the lookup/master input fields.

    Thanks.

  • shradha jain

    Member
    August 30, 2018 at 12:06 pm in reply to: MIXED-DML-OPERATION

    Hello Chanchal,

    If we perform DML operation on standard/custom object and global objects(User, UserRole, Group, GroupMember, Permission Set, etc...) in same transaction this error will come.
    To avoid this error, we should perform DML operation on standard/custom object records in a different transaction.
    In general all the apex classes and apex triggers execute synchronously (execute immediately).
    if we perform DML operation on standard/custom object records asynchronously (execute in future context), we can avoid MIXED-DML-OPERATION error.

    Thanks.

  • shradha jain

    Member
    August 30, 2018 at 5:09 am in reply to: Overloading in Apex

    Hello Madhulika,

    Overloading in Apex programming alludes to the capability to make use of a lone identifier to distinguish various techniques for a class that contrasts in their in sequence virtues and gives way to the function parameters. Overload techniques are generally, for the most part, used especially when they convincingly carry out a comparable enterprise yet to some extent only one of its kind type of arrangement of function parameters.

    It is an idea which is used to steer totally away from the overindulgence of programming code where a comparable line of attack can be easily utilized in a number of circumstances when coupled with a few alternate arrangements of function parameters.

    The real strategy that you had originally developed gets called in during the runtime to settle the assemble time, along these very lines balancing a very strategic distance from all the runtime mistakes that can occur. Overloading is the method that gives code the lucidity it requires, takes out its multilateral quality, and upgrades the runtime implementation.

    Thanks.

  • shradha jain

    Member
    August 30, 2018 at 5:02 am in reply to: @testVisible and @testSetup in salesforce

    Hello Madhulika,

    @testVisible: Some methods are declared as private so you won’t be able to call them outside the class. However, sometimes you really want to be able to invoke it from a unit test method.To resolve this, you can mark the method with a @TestVisible annotation. Then although it is still private, it is invokable from your unit test methods.

    @testSetup: For most unit tests in Salesforce, we need to generate some test data. And for different test methods within one single test class, the required test data set is usually very close. In order to serve for this purpose, Salesforce has introduced TestSetup annotation. The data generated in TestSetup will be persisted for every test method within the test class to use. And the data will only be rolled back after the execution of the whole test class completes.Methods defined with the @testSetup annotation are used for creating common test records that are available for all test methods in the class.
    Thanks.

  • Hello Madhulika,

    The limitations of Savepoint or Transaction Control in Apex are:

    • Each savepoint you set counts against the governor limit for DML statements.
    • Static variables are not reverted during a rollback. If you try to run the trigger again, the static variables retain the values from the first run.
    • Each rollback counts against the governor limit for DML statements. You will receive a Runtime error if you try to rollback the database additional times.
    • The ID on an sObject inserted after setting a savepoint is not cleared after a rollback.

    Thanks.

  • shradha jain

    Member
    August 28, 2018 at 7:11 am in reply to: How to display Encrypted Field on Salesforce Visualforce?

    Hello Madhulika,

    Encrypted custom fields that are embedded in the <apex:outputText> component display in clear text. The <apex:outputText> component doesn’t respect the View Encrypted Data permission for users. To prevent showing sensitive information to unauthorized users, use the <apex:outputField> tag instead.

    Thanks.

  • shradha jain

    Member
    August 28, 2018 at 7:04 am in reply to: What is salesforce1 and what is its use?

    Hello Madhulika,

    Salesforce1 is a new platform, complete with a host of new APIs and mobile UI tools.To oversimplify it, it's taking the Chatter mobile app, which up until this point has just been an app running on closed source code and building it into a platform, while really blowing out its capabilities. It's built on the premise that our business lives are increasingly happening in the feed. Every action from a like to a comment, now has a public API and method call behind it. More than just Chatter however, it's allows you to embed your business applications either through Visualforce or custom publisher actions (with you app hosted wherever). Salesforce1 will offer custom branding, administrator configuration, and allow for installable apps. 3rd party sales tools, service tools, marketing apps will be able to plug right into this framework.
    More than just mobile, while it is the focus, Salesforce1 represents a new API-first mentality at Salesforce.com. Every action, interface, and new feature is built on top of a public API that developers can also wield and consume. Think about a list view in Salesforce, it's not something you can build without some pretty deep customization and code of your own. This UI component is not built on a public API. This is the old paradigm of Salesforce.com and Salesforce1 is the new one.
    Thanks.

  • shradha jain

    Member
    August 27, 2018 at 1:30 pm in reply to: What are the different AJAX action tags in Salesforce?

    Hello Madhulika,

    The different AJAX action tags are:

    actionStatus: used to display start and stop statuses of AJAX requests.
    actionSupport: used to call a second component when an event happens to the first component.

    actionPoller: similar to actionSupport, but the event is based on a timer instead of a user action.

    actionFunction: provides support for invoking a controller action from JavaScript code using an AJAX request by defining a new JavaScript function.
    actionRegion: used to demarcate which parts of the page the server should reprocess.

    Thanks.

  • shradha jain

    Member
    August 27, 2018 at 1:27 pm in reply to: How can you create partial page refreshes in Visualforce?

    Hello Madhulika,

    Basically, you need to define the section of the page that is going to refresh (typically with a panel of sorts), and then define the event that will cause the refresh. The method changes depending on if the area being refreshed is the same as the one handling the event. It also depends on if you are just processing something on the server, or if you need the UI to change.

    Thanks.

  • Hello Madhulika,

    The difference between apex:pageBlockTable and apex:dataTable are:

    apex:pageBlockTable

    1) uses salesforce styling
    2) No need to specify the headers
    3) mandatory attribute "value".

    apex:dataTable

    1) Need to specify the headers
    2) we can specify custom style classes.
    3) No mandatory attribute "value" unlike in pageblockTable

    Thanks.

  • Hello Madhulika,

    You can  fix it by deleting all debugs logs from developer console.

    1. In dev console, Select tab "Query Editor" at the bottom of the console
    2. Select check box "Use Tooling API"
    3. Use this query:

    SELECT Id FROM ApexLog

    Delete all rows.Once all rows are deleted you will be able to save new debug logs.

    Refer the following link for more information:
    https://help.salesforce.com/articleView?id=000194045&type=1

    Thanks.

     

  • shradha jain

    Member
    August 24, 2018 at 12:48 pm in reply to: How to Invoke Rest Service from Visualforce page?

    Hello Madhulika,

    All of the APIs are available on the visualforce.com domain, so you can access them without a cross-domain request. Do not include the server URL. You should use the domain that you are on.

    var weblink = "/services/apexrest/v1/restResourceTest";
    Your browser will understand this as an attempt to use the current host name, which will work. Here's a  example  that works:

    <apex:page >
    <script>
    var s = '{!GETSESSIONID()}';
    var x = new XMLHttpRequest();
    x.open('GET','/services/data');
    x.setRequestHeader('Authorization','Bearer '+s);
    x.onload = function() { alert(this.response); }
    x.send(null);
    </script>
    </apex:page>

    Thanks.

  • shradha jain

    Member
    August 24, 2018 at 12:44 pm in reply to: How to use If Condition in Apex:pageBlockTable?

    Hello Madhulika,

    You can use the If condition in apex: pageBlockTable as follows:

    {!IF(AND(field1 <condition> value, field2 <condition> value), "Show on True", "Show on False")}

    Thanks.

  • Hello Anjali,

    There are five ways to store files, documents, and images in salesforce:

    1) The Documents tab is the original file repository and still has its uses: This is where you store web resources like logos and Visualforce materials. Also, if you create any HTML Salesforce email templates, you would store any images referenced in your HTML code.Be sure to make the document externally available if you intend to use it as a logo or Salesforce email template HTML image or it will not be viewable by your recipient. You can still store files that are not associated to any record like a PDF or spreadsheet files here but Salesforce Content offers more functionality and abilities.

    2) The Notes and Attachments related list is where you associate and store files related to a specific record in the Salesforce CRM system: When you attach a file to a Chatter feed on a record, it is automatically added to the record’s Notes and Attachments related list as a Feed Attachment. If you have a Google Apps account and it is integrated into your instance of Salesforce, you can also add or create a new Google Doc here. This also holds the attachments from any emails associated to that record from Outlook or a Salesforce email template. Please note that the size limit for an attached file is 5MB except for Feed Attachments. The maximum size for all files attached to an email is 10MB and all file types are supported.

    3) The Google Docs tab can be enabled if you have a Google Apps account: This allows you and your users in Salesforce to have tab access to your Google Docs right in the Salesforce interface. This allows for real-time collaboration on spreadsheets, documents and more without having to install any programs on your computer. Google Docs can even be associated to Salesforce CRM Content workspaces. You can find more information about this feature in Salesforce under Google Apps in Setup.

    4) The Files tab is part of the Salesforce Chatter App and allows you to easily upload, store, find with Salesforce Global Search, and follow files you own or have access to from Salesforce Content or Chatter: The Files tab supports all file types including PDF, Excel, PowerPoint, Word, image, audio, and video files up to 100MB each. You can share files here with Chatter or by creating groups. You also have a private section so no other users in the Salesforce CRM system can see them. The Files tab requires no admin setup and is ready to use when Chatter is enabled. Since this integrates with Chatter and Content, think of this as a central repository where all files from those two can be accessed if you have the proper permissions.

    5) Salesforce CRM Content has the most features and requires the most admin setup before use: Since I already posted a write-up on the Benefits of Salesforce Content and Delivery, I will just cover the main points here. Content allows you to upload files and easily send them as links to your customers or co-workers. Like Chatter, you can follow a Content file and be notified when it is updated. You can see when someone views or downloads any content that you share and, the best feature in my opinion, is the ability to create content packs by combining unrelated documents and or presentation slides into one pack so you do not have to send out multiple files or presentations. So, as you can see, there are multiple places to store files in the Salesforce CRM system. By understanding the features of each repository, you should be able to pick the right place for the file so that it can be accessed by the proper people.

    Thanks.

  • Hello Madhulika,
    Try using this regex (Single line comments only):

    String src ="How are things today /* this is comment */ and is your code /* this is another comment */ working?";
    String result=src.replaceAll("/\\*.*?\\*/","");//single line comments
    System.out.println(result);

    Here is regex for single and multi-line comments by adding (?s):

    //note the added \n which won't work with previous regex
    String src ="How are things today /* this\n is comment */ and is your code /* this is another comment */ working?";
    String result=src.replaceAll("(?s)/\\*.*?\\*/","");
    System.out.println(result);

    Thanks.

  • shradha jain

    Member
    August 23, 2018 at 12:17 pm in reply to: What is the list of Global value providers in Salesforce?

    Hello Avnish,

    List of Global value providers :

    • $globalID: returns globalId of a component.
    • $Browser : returns information about hardware and operating system.
    • $Label : allows to access labels outside your code.
    • $Locale : returns information about user's preferred locale.
    • $Resource : allows to refer JSP, stylesheets.

    Thanks.

  • Hello Madhulika,

    The different things that need to  be consider while using future methods are:

    1. Methods with the future annotation cannot be used in Visualforce controllers in either getMethodName or setMethodName methods, nor in the constructor.
    2. You cannot call a method annotated with future from a method that also has the future annotation. Nor can you call a trigger from an annotated method that calls another annotated method.
    3. Future methods cannot be called from batch class.

    Thanks.

  • shradha jain

    Member
    August 22, 2018 at 5:02 am in reply to: How Salesforce is useful in tracking sales?

    Hello Prachi,

    Salesforce records all the basic details like the number of customers served daily, daily sales volume, sales manager detailed reports, sales numbers in each month or quarter. Also, it keeps a track on the repeat customer, which is key to success for any sales organization.

    Thanks.

  • Hello Madhulika,

    No, Synchronous Web service callouts are not supported from scheduled Apex. To be able to make callouts, make an asynchronous callout by placing the callout in a method annotated with @future(callout=true) and call this method from scheduled Apex. However, if your scheduled Apex executes a batch job, callouts are supported from the batch class.

    Thanks.

  • Hello Anurag,

    WebLink:
    Represents a custom button or link defined in a custom object.
    This type extends the Metadata metadata type and inherits its fullName field.

    ActionOverride:
    Represents an action override on a standard or custom object. Use it to create, update, edit, or delete action overrides. You can access ActionOverride only by accessing its encompassing CustomObject. Action overrides are defined as part of a standard or custom object.

    Thanks.

  • Hello Parul,

    You can use remote objects to insert a record on sobject using visualforce page without using controller. Remote Objects are proxy objects that enable basic DML operations on sObjects directly from JavaScript.All of the data access is handled by the Remote Objects components.

    Example:

    This Visualforce page retrieves a list of 10 Warehouse records and displays them on the page in response to the user clicking the Retrieve Warehouses button.

    <apex:page>
    <!-- Remote Objects definition to set accessible sObjects and fields -->
    <apex:remoteObjects >
    <apex:remoteObjectModel name="Warehouse__c" jsShorthand="Warehouse"
    fields="Name,Id">
    <apex:remoteObjectField name="Phone__c" jsShorthand="Phone"/>
    </apex:remoteObjectModel>
    </apex:remoteObjects>

    <!-- JavaScript to make Remote Objects calls -->
    <script>
    var fetchWarehouses = function(){
    // Create a new Remote Object
    var wh = new SObjectModel.Warehouse();

    // Use the Remote Object to query for 10 warehouse records
    wh.retrieve({ limit: 10 }, function(err, records, event){
    if(err) {
    alert(err.message);
    }
    else {
    var ul = document.getElementById("warehousesList");
    records.forEach(function(record) {
    // Build the text for a warehouse line item
    var whText = record.get("Name");
    whText += " -- ";
    whText += record.get("Phone");

    // Add the line item to the warehouses list
    var li = document.createElement("li");
    li.appendChild(document.createTextNode(whText));
    ul.appendChild(li);
    });
    }
    });
    };
    </script>

    <h1>Retrieve Warehouses via Remote Objects</h1>

    <p>Warehouses:</p>

    <ul id="warehousesList">
    </ul>
    <button onclick="fetchWarehouses()">Retrieve Warehouses</button>

    </apex:page>

    You can refer the following link for more information:

    https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_remote_objects.htm

    Thanks.

Page 2 of 5