Forum Replies Created

Page 1 of 2
  • Prakhar

    Member
    September 8, 2016 at 12:33 pm in reply to: How can we get a sharing link from 'files/content' from Salesforce apex?

    Hi Mohit,

    According to your question, you want to get the sharing link of the document which is being saved in file object as a "Content Document".

    In this case you can get the sharing link from "ContentDocumentLink" object which is a junction object between ContentDocument and file where it is shared of the content version of the document which is saved with the help of the query below:

    select id from ContentDocumentLink where ContentDocumentId = '(Id of the content document)'.

    For information about contentdocumentlink please click on the link.

    Thanks.

  • Prakhar

    Member
    September 8, 2016 at 12:17 pm in reply to: What is the wave analytics data limits in Salesforce?

    Hi Himanshu,

    The data limits for Wave Analytics are as follows:

    1. Maximum number of fields in a dataset- 5,000 (including up to 1,000 date fields)
    2. Range value for  each numeric field in a dataset - 36,028,797,018,963,967 to -36,028,797,018,963,968
    3. Maximum number of rows for all registered datasets combined - 250 million per platform license purchased before October 20, 2015.

    For further information of limits of Wave Analytics please click here.

  • Hi Tanu,

    Please read the below code to display the image from document on to a VF page.

    ApexClass:-

    public with sharing class ImageController {
    public String imageURL{get;set;}

    public ImageController()
    {
    imageURL='/servlet/servlet.FileDownload?file=';
    List< document > documentList=[select name from document where
    Name='SamplePic'];

    if(documentList.size()>0)
    {
    imageURL=imageURL+documentList[0].id;
    }
    }
    }

    VF Page:-

    <apex:page controller="ImageController" showheader="false" sidebar="false">

    <apex:form>
    <apex:image url="{!imageURL}">
    </apex:image></apex:form>

    </apex:page>

    Thanks.

  • Prakhar

    Member
    September 8, 2016 at 9:56 am in reply to: Is Mapping a good practice or bad in Salesforce?

    Hi Tanu,

    It is really helpful when you are using Maps in your apex as it decreases the number of lines of code and also when you are using Maps which is collection of Set and List replaces the functioning of them in your code.

    Using Map inside a map is a good practice with the comments in your code which make your code more readable to yourself and also to others when the code is being reviewed in future.

    Hope that clears your query.

    Thanks.

  • Hi Vasundhara,

    Confirming that you have following settings in your organization according to the link below:-
    https://help.salesforce.com/apex/HTViewSolution?id=000005218&language=en_US

    Then according to my understanding you want to get all the cases which are being saved in different languages. Since the record which is being saved in Salesforce is being inserted in the language defined for the users. For Example:

    If the user XYZ language is being set as "Spanish", then the case record being saved by the user would save according to the Spanish language of user.

    So to get the case records with different language what I would suggest first query the users which have the defined language. So your query would be something like this:

    String lang = 'es';

    Note :- "es" is the language code for Spanish language.

    List<User> userObj = [Select Id,Name from User where LanguageLocaleKey =: lang];

    Using the above query would give you all the users with defined language in the parameter "lang".

    Now to get the case records which are being inserted or saved in different language, use the below query:

    List<Case> lisOfCaseRecordInDifferentLanguage = [Select Id, Name from Case where OwnerId IN : userObj];

    Using the above solution would resolve your query.

    Hope that helps.

    Thanks,

    Prakhar.

  • Prakhar

    Member
    July 20, 2016 at 3:39 pm in reply to: How to change the account owner in contact by a apex trigger?

    Hii Mohit,

    Yes you can update the account owner, when firing trigger on the contact. Please take help from below code and modify it according to your requirement.

    trigger updateAccountOwner on Contact (before update) {

    Set<Id> relatedAccountId = new Set<Id>();
    List<Account> updatedList = new List<Account>();
    for(Contact con: trigger.new){
    if(con.AccountId != Null){
    relatedAccountId.add(con.AccountId);
    }
    }

    for(Account acc: [Select Id, Name ,OwnerId from Account where id in : relatedAccountId]){

    // Requested not use the hard coded Ids in the code. This was just done to let you show it can be done.
    acc.OwnerId = '00528000000TxPV';
    updatedList.add(acc);
    }
    update updatedList;
    }

    Thanks.

  • Hii Mohit,

    This is an new feature that is being added in spring 16 release notes of Salesforce, through which you can perform Lock and Unlocking of records using Apex.

    The classes which are being used are LockResult Class and UnlockResult Class. To know more about the lock and unlock classes please go through the link.

  • Prakhar

    Member
    July 20, 2016 at 3:12 pm in reply to: How can we perform dml operations in visualforce page?

    Hi Pranav,

    If you want to perform DML operation on Vf page, you can use sforce.connection in your javascript and then perform your required DML operations.

    For Example:- if you want to insert the records, the use below format:-

    var instanceOfRecord = new sforce.SObject('Name of Object');
    var results = sforce.connection.create([instanceOfRecord]);

    Thanks.

  • Hi Mohit,

    You can use the below tag to include the external script on Vf Pages:-

    <apex:includescript value="The Url of the specified script"/>

    In case if you also want to include external StyleSheet in Vf Page you can use the tag given below:-

    <apex:stylesheet value="The URL of the specified stylesheet" />.

    Hope that helps.

    Thanks.

  • Prakhar

    Member
    July 20, 2016 at 11:25 am in reply to: How can I show report or dashboard on vf page?

    Hii Pranav,

    You can use the below visualforce tag to include the reports on to Vf page.

    <analytics:reportChart>

    For more information of the above tag visit the link.

  • Hii Pranav,

    You can do DML operation with the help of Javascript by using sforce.connection.

    Here is an simple example to insert the record in account object in salesforce:-

    var account = new sforce.SObject('Account');

    // Provide the required fields for the account to insert and other fields that you want.

    account.Name = 'Test';

    // Here you can provide your condition for the insertion or cancel the record.

    if(account.Phone != ' ' && account.Phone != Null){
    var results = sforce.connection.create([account]);

    }

    else{

    //Show some error .

    }

    Thanks.

  • Hii Mohit,

    You can override the standard button functionality by creating a custom controller which would contain the separate method for each of your standard button that you want to display on the Vf page.

    Thanks and Regards.

     

  • Prakhar

    Member
    June 24, 2016 at 8:40 am in reply to: How to show App in Salesforce1?

    Hii Abhinav,

    I have tried the solution of Flexipages in my org but was not able to show the custom app which will be having the tabs of different objects. Can you please explain a bit in reference of Flexipages that how can we show the app which consist of different tabs of objects.

    And is there any way that we can do it using a standard process. I know the process of creating Vf pages and then add it to the navigation menu. But the problem is, then we will not be able to show the tabs for different objects in that Vf page. It will then be displaying the data in table format for the different objects which doesn't looks quite user friendly in case of more than 3-4 objects. And also adding of new records in the objects that are displayed.

    Looking for a more clear solution.

    Thanks.

  • Prakhar

    Member
    June 24, 2016 at 8:27 am in reply to: How to show App in Salesforce1?

    Hii Surbhi,

    I think you might have misread my question.

    Actually what I was looking for to show my custom app in Salesforce1, I know that is visible in Lightning experience in App Launcher on the right hand side of the screen.

    Hope that makes it clear what is my requirement.

    Thanks.

  • Prakhar

    Member
    June 14, 2016 at 1:54 pm in reply to: Salesforce Hackathon

    Thanks Utsav for the information. This is really wonderful and awesome information which would definetly help us.

    Thanks.

  • Prakhar

    Member
    June 14, 2016 at 12:39 pm in reply to: Unable to add Form to a Page using Site.com

    Hii Karen,

    When you are using a template while creating page for site.com then you cannot use an Data and Form components as these are not available for use when editing community site in site.com. The Form, Data and some other page elements on the site.com studio will also be not visible if existing template pages are used .

    This is an known issue in Salesforce introduced in winter'15 release. Please see here for more info.

    In case if you want to add a form then in that case you will to delete all the pages and then create a new page and add the forms according to your requirement.

    Thanks.

  • Hii Rachit,

    As of now there is no such LookUp filters available in Lightening Salesforce. There is an idea available for the same issue.

    And also this is an well known issue to Salesforce, as this is being mentioned in the Salesforce'16 winter release guide for limitation. You can see it here.

    In case you can choose a other work around to get the similar functionality but that might be too tricky and too lengthy. You can create junction object which will act as an filter and holds the value for you.

    Thanks.

  • Prakhar

    Member
    June 14, 2016 at 9:29 am in reply to: How to set up role hierarchy in wave analytics?

    Hii Hazel,

    You can set up role hierarchies in Wave Analytic's  by 2 ways. They are follows:-

    1. If you are uploading data in Wave Analytic from an external file. then you will have to apply the predicate in the rowlevelsecurityfilter field in the metadata file associated with the external data source. Then when the file will be uploaded it will apply the predicate to the data of the file. For Example, add the predicate in the csv in the following manner:

    "rowLevelSecurityFilter": "'name_of_the_column_in_the_datasheet' == \"Value_of_the_column\""

    2.  If the data is being created from the dataset from a dataflow, then you will have to apply a predicate in the                   rowlevelsecurityfilter filter. So when the dataflow runs it will apply the predicate. For Example, the predicate             is applied in this manner:

    'name_of_the_column_in_the_datasheet' == "Value_of_the_column"

    Note: The predicate which is being applied using any of the above mentioned ways mus have the associated column with it and also the Predicate is case-sensitive, so make sure you don't run in any such kind of error's.

    For further help and knowledge please go through the doc provided by Salesforce Click here.

    Hope that resolves your problem.

    Thanks.

  • Prakhar

    Member
    June 14, 2016 at 8:43 am in reply to: link to download a PDF from salesforce

    Hii Utsav,

    Yes, you can use file objects to generate a link which could be accessed publicly from anywhere. While file is being created you can use generate and link and mark it as public.

    Thanks.

  • Prakhar

    Member
    June 14, 2016 at 7:49 am in reply to: How can I create a formula in process builder?

    Hii Audrey,

    Based on your condition, you can build an formula and select an formula check box in process builder to create a formula for the entry criteria. Below is the formula which will trigger a process flow once the condition is satisfied to true.

    IF((ISPICKVAL([Opportunity].StageName , 'Closed Lost') && [Opportunity].CloseDate + 30 == TODAY()), true, false )

    Thanks.

  • Prakhar

    Member
    June 14, 2016 at 6:43 am in reply to: How to get ids of records created in a visual flow?

    Hii Ravi,

    While creating a record from a flow, there is an option "Assign the record id to a variable in a reference flow" right at the bottom of the page. You can assign the name to that particular variable and when creating the other child record you can use that variable to the field of the child opportunity and select the variable in the value.

    In this way you can easily get the id of the parent record. And make sure the flow of the process is such that the parent is marked as an initial step of the process.

    Thanks.

  • Prakhar

    Member
    June 14, 2016 at 6:21 am in reply to: Can I create sliding image in Visualforce page?

    Hii Ajay,

    You can create an sliding image using vf page and controller.

    The vf page will show the image which will have previous and next button similar to as that of an pagination and when you click the button then in your controller you can iterate to an next image.

    Thanks.

  • Prakhar

    Member
    June 13, 2016 at 2:55 pm in reply to: Not able to view the process builder

    Hii Abhinav,

    Make sure you have following permissions given to your particular profile from which you are trying to access the process. They are given as follows:

    1. Manage Force.com Flow and
    2. View All Data

    Make sure both check boxes are being marked as true.

    Thanks.

  • Prakhar

    Member
    June 13, 2016 at 2:39 pm in reply to: How to populate values in vf page from formula field?

    Hii Danna,

    In the VF page that you are using, you will have to assign the value from the url to that particular {get;set;} field of Vf page.

    For Example: Let us suppose your URL looks something like this:

    /apex/Rforce_AccountSearch_Page?caseId=”&Id& "&lastname=" & LastName

    Then use the below code in your VF page:-

    <apex:inputText value="{!lastname}">

    Then in Apex:

    String lastName{get;set;}

    and get the parameters from the URL using

    ApexPages.CurrentPage().getParameters.get('lastname');

    and assign the lastname {get;set;} of the page with the above value i.e.

    lastname = ApexPages.CurrentPage().getParameters.get('lastname');

    Hope that resolves your issue.

    Thanks.

  • Hii Rachit,

    This issue basically comes up when you try to delete any master record which has an child record associated with it.

    For Example if you are deleting an Account which has an case associated with it, then it will not let you delete the account record and will end up showing that you cannot delete the account record as it has different case associated with it.

    To overcome this issue, if you are getting this error on an vf page then you can show it as an apex error message. As of now this issue has not being resolved by Salesforce and it is still being in an pending cases.

    Thanks.

Page 1 of 2