Forum Replies Created

Page 1 of 12
  • Hi

    For this, you can look into the below two Conga Support links

    How to Compare Two Values in Word Templates using IF Statements

    How to Create IF Fields in a Microsoft Word Template

    Or you can build a custom formula field on salesforce side and then use that in your template.

    Hope this helps you.

  • Hi
    There are many reasons if you can't get your desired output from the provided code:
    1) You have to give the License name correctly
    2) The user data you want to query must check it an active user as you added that filter in your query
    3) You have to check the usertype also
    For the best solution, you can first run the query in the query editor then add that query in the code for the desired output.

  • Hi

    Salesforce Trailhead is the best place for learning and exploring new things. There are various Trailhead modules, projects and trailmix for Admin exams as well.
    Please try to enhance your skills and knowledge from Salesforce Trailhead "Prepare for Your Salesforce Administrator Credential"
    https://trailhead.salesforce.com/users/strailhead/trailmixes/prepare-for-your-salesforce-administrator-credential
    "Prepare for Your Salesforce Advanced Administrator Credential"
    https://trailhead.salesforce.com/users/strailhead/trailmixes/prepare-for-your-salesforce-advanced-administrator-credential

    Thanks

  • PRANAV

    Member
    May 31, 2018 at 10:37 am in reply to: How to query data through Standard API in Salesforce?

    Hi Parv,
    The below will help you
    curl https://yourInstance.salesforce.com/services/data/v20.0/query/?q=SELECT+name+from+Account -H "Authorization: Bearer token"
    For more you can go through https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_query.htm

    Thanks

  • PRANAV

    Member
    May 24, 2018 at 11:12 am in reply to: How can I manipulate records with DML in Salesforce?

    Hi Abhishek,
    Create and modify records in Salesforce by using the Data Manipulation Language, abbreviated as DML. DML provides a straightforward way to manage records by providing simple statements to insert, update, merge, delete, and restore records.

    For Example:
    // Create the account sObject
    Account acct = new Account(Name='Acme', Phone='(415)555-1212', NumberOfEmployees=100);
    // Insert the account by using DML
    insert acct;

    You can practise it on Salesforce Trailhead under Manipulate Records with DML topic for better understanding.

    Hope this helps you.

  • Hi Rajan ,

    I think you use false value for setSaveAsActivity. Either you have to set its value true or left it for default true value. As

    setSaveAsActivity(saveAsActivity)
    The default value is true, meaning the email is saved as an activity. This argument only applies if the recipient list is based on targetObjectId or targetObjectIds. If HTML email tracking is enabled for the organization, you will be able to track open rates.

    Hope this helps you more.

  • Hi Rajan

    You can use the below SOQL query:

    SELECT Id, Name, Type, LastViewedDate
    FROM RecentlyViewed
    WHERE LastViewedDate !=null AND Type = 'Account'
    ORDER BY LastViewedDate DESC

    Here you can use different TYPE for particular sObject.

    Hope this helps you more.

  • Hi Rajan,

    You have to create a HTML or Custom email template for this first.

    Then you can use display:none in your div tag in html section.

    OR

    You can use visibility tag in header tag also.

    h2.a {
    visibility: visible;
    }

    Hope this helps you more.

  • Hi Aman,

    Service Cloud Console is a Salesforce application that is designed for users in a fast-paced environment that need to find, update, and create records quickly. SCC introduces a tabbed environment in which users are able to look at different groupings of records in one screen via a Secondary and Primary tab.

    Steps to enable Service Cloud Console within Salesforce

    1) In Salesforce, go to sobject page layout

    2) Select fields for highlight panel in Salesforce and then click OK

    3) Click on the layout property and click on the highlighting check box, then click the OK button. Lastly save this layout.

    4) Go to Setup → Build  → Create → Apps

    5) Click on the “New” button to create new Apps

    6) Now select the console type check box

    7) In the app label field type “Service Cloud Console” then click next

    8) You have option for image for this console app in your Salesforce also

    9) Select the field account, leads, cases and opportunity for navigation tab item, then click next

    10) You will see “choose how the record will display”, select as per your requirement

    11) Select all so that all profiles can access this app and then save and Enjoy

    Hope this helps you more.

     

     

  • PRANAV

    Member
    April 27, 2018 at 10:52 am in reply to: Merge Custom Object Records in Salesforce

    Hi Mohsin,

    There is no standard salesforce functionality to merge two records for custom object. You will have to built your own logic for this. With the help of Apex you can achieve this but its not a standard/good way to merge two different records with there related list records also unless or until the two records are similar/related to each other.

    And yes you can take the help of various apps from appexchange like Dupe Eliminator, Eliminate duplicate records with ease - merge, convert + actions -Dedup Manager™, Algoworks Case Management App for Salesforce, etc.

    Hope this helps you more.

  • PRANAV

    Member
    April 23, 2018 at 11:54 am in reply to: Can we call a future method from a Salesforce batch class using Apex?

    Hi,

    A future method runs in the background, asynchronously. You can call a future method for executing long-running operations, such as callouts to external Web services or any operation you'd like to run in its own thread, on its own time.

    Yes, we can’t call future method from batch class.

    Some restriction of the future method are:

    • No more than 50 method {Methods with the future annotation} calls per Apex invocation
    • The maximum number of future method invocations per a 24-hour period is 250,000 or the number of user licenses in your organization multiplied by 200, whichever is greater. This limit is for your entire org and is shared with all asynchronous Apex: Batch Apex, Queueable Apex, scheduled Apex, and future methods.
    • Methods with the future annotation must be static methods
    • Can only return a void type
    • You can invoke future methods the same way you invoke any other method. However, a future method can’t invoke another future method
    • Methods with the future annotation cannot be used in Visualforce controllers in either getMethodName or setMethodName methods, nor in the constructor.
    • 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.
    • The getContent and getContentAsPDFPageReference methods cannot be used in methods with the future annotation

    For access to higher limits for future methods, and to invoke a future method from another future method, use the Future Methods with Higher Limits pilot.

    Hope this helps you more.

  • Hi Deepika,

    You can't get the list of junction object directly, but you can use the below code snippet for finding that this object has master-detail relationship or not. Its a trick if you have junction object with two master-detail relationship. As a junction object is a custom object with two master-detail relationships, and is the key to making a many-to-many relationship{as per standard}.

    Map<String, SObjectField> mapLeadFieldAPIToSchema = Lead.getSObjectType().getDescribe().fields.getMap();
    for(String fieldName : mapLeadFieldAPIToSchema.keySet()){
    SObjectField field = mapLeadFieldAPIToSchema.get(fieldName);
    if(field.getDescribe().getRelationshipOrder() == 0){
    //the variable fieldName contains the name of a field which is the parent of a master-detail relationship
    system.debug('@@@@'+fieldName);
    }
    if(field.getDescribe().getRelationshipOrder() == 1){
    //the variable fieldName contains the name of a field which is the parent of a master-detail relationship
    system.debug('@@@@'+fieldName);
    }
    }

    You should use the getRelationshipOrder() method available in the DescribeFieldResult class. This is populated only for Master-Detail relationships and is null for lookup relationships. Also, to get the name of the Master Object, you need to use the getReferenceTo() method.

    RelationShipOrder : The type of relationship for a master-detail relationship field. Valid values are:

    0 if the field is the primary relationship
    1 if the field is the secondary relationship

    Hope this helps you. But its trick not a standard way/method.

  • PRANAV

    Member
    April 18, 2018 at 3:23 pm in reply to: How to Salesforce Trigger on Event Object?

    Hi Harsh,

    I think you are having some issues with your code, so could you please share your code.

  • Hi Harsh,

    For now Rich Text field is not available for Event Object.

    Here's some ideas on Salesforce IdeaExchange for adding Rich Text field on Activities object

    success.salesforce.com/ideaView?id=08730000000sZ4VAAU

    success.salesforce.com/ideaView?id=0873A000000CL9mQAG

     

  • Here's the VF Page Code

    <apex:page controller="InsertImageIntoRichText">
    <apex:form >
    <apex:outputLabel value="Document Name"></apex:outputLabel>
    <apex:inputText id="name" value="{!fname}"/>

    <apex:outputLabel value="Upload Document"></apex:outputLabel>
    <apex:inputfile value="{!file}"></apex:inputfile>

    <apex:commandButton value="Save" action="{!insrt}" id="save"/>
    </apex:form>
    </apex:page>

    Now when you add image through this VF page, the image is inserted and attached to a Rich Text Area custom field on Case. Like

    imagecase

    Hope you will get your solution now. It's a much similar code of what you needed if you want something more/different you can play around the Code and built your required functionality.

    Thanks

  • Hi Harsh,

    The below code will help you for this.

    // Apex Class

    public class InsertImageIntoRichText
    {

    public String fname{get;set;}
    public ID folderid{get;set;}
    public Blob file{get;set;}

    public void insrt()
    {

    Document d= new Document();

    d.name = fname;
    d.body=file; // body field in document object which holds the file.
    d.folderid='00l0K000001GJlF'; //folderid where the document will be stored insert document;
    insert d;

    Case cs = new Case();
    cs.pack_age_test__image_field__c = '<img src="https://pranavbhardwaj-dev-ed--c.ap6.content.force.com/servlet/servlet.FileDownload?file='+d.id+'" width="500" height="281"></img>'; //FirstExample is namespace & image_field__c is Rich Text Area field
    cs.Status = 'New';
    cs.Origin = 'Web';
    insert cs;
    }
    }

  • Hi Harsh,

    Yes you can achieve this through your VF Page button "Choose File".

    You just have to write your Apex controller to insert a Document for "Choose File" and in your apex code you can add that document record id to the sobject where you want to use this inputTextArea richtext / attached file.

    Hope this helps you. If you want I can help you with the code also.

     

  • PRANAV

    Member
    April 17, 2018 at 12:03 pm in reply to: How to Salesforce Trigger on Event Object?

    Hi Harsh,

    Please elaborate your query properly, so that your issue can be resolved.

  • PRANAV

    Member
    April 17, 2018 at 8:31 am in reply to: How to prevent a user from creating a new account in Salesforce?

    Hi Rahul,

    Yes you can create a validation rule on Account object

    Please make you validation rule like the below imageacc1

    So only User with LastName = guestadmin AND FirstName = 'pb' can create account records. Other User can face the validation error like the below image

    acc2

    Hope this helps you. Thanks

  • Hi,

    The below code will help you

    Apex Class

    public class AccountRelatedContactsOpportunities {

    public List<Contact> getContacts() {
    List<Contact> conresults = [Select Id, FirstName, LastName,Title,Email from Contact where accountid='0012800000hVdfO'];
    return conresults;
    }
    public List<Opportunity> getOpportunities() {
    List<Opportunity> oppresults = [Select Id,CloseDate,Amount,StageName,Name from Opportunity where accountid='0012800000hVdfO'];
    return oppresults;
    }

    }

    VisualForce Page

    <apex:page controller="AccountRelatedContactsOpportunities">
    <apex:form>
    <apex:pageBlock title="Contacts List" id="contacts_list">
    <apex:pageBlockTable value="{! contacts }" var="ct">
    <apex:column value="{! ct.FirstName }"/>
    <apex:column value="{! ct.LastName }"/>
    <apex:column value="{! ct.Title }"/>
    <apex:column value="{! ct.Email }"/>
    </apex:pageBlockTable>
    </apex:pageBlock>
    <apex:pageBlock title="Opportunity List" id="opportunity_list">
    <apex:pageBlockTable value="{! opportunities }" var="ot">
    <apex:column value="{! ot.Name }"/>
    <apex:column value="{! ot.CloseDate }"/>
    <apex:column value="{! ot.StageName }"/>
    <apex:column value="{! ot.Amount }"/>
    </apex:pageBlockTable>
    </apex:pageBlock>
    </apex:form>
    </apex:page>

    Here I am using hard coded Account Id. You can replace it with yours or you can fetch it dynamically also.

    The below is the preview of VF page

    vf

     

  • PRANAV

    Member
    April 10, 2018 at 3:25 pm in reply to: How to add error message in a Salesforce Apex Trigger?

    Hi Ratnakar,

    Whatever you are saying is not correct.

    The solution given by Abhinav is correct and helpful. And the issue resolves previously.

    I appreciate your response if it works for the same but the reply provided by you works for VF page only.

    Thanks

  • Hi,

    LIMIT is an optional clause that can be added to a SOSL query to specify the maximum number of rows that are returned in the text query, up to 2,000 results. If unspecified, the default is the maximum 2,000 results. The default 2,000 results is the largest number of rows that can be returned for API version 28.0 and later. 

    The LIMIT clause has no limit in and of itself. It's limited to the context in which it's used. If it's used in Apex code it's limited to the total governor limit for SOQL rows, which is currently 50,000. If it's used in a query via the Web Service API then there is no limit.

    Hope this helps you.

  • PRANAV

    Member
    April 4, 2018 at 7:15 am in reply to: How to get Encoded Value when querying in Salesforce Batch Class?

    Hi Shubham,

    The vertical bar ( | ) is a computer character and glyph with various uses in mathematics, computing, and typography.

    The vertical bar is encoded in Unicode at U+007C | Vertical line (124decimal · HTML &#124;).

     

    So to decode the HTML character in Apex class

    You have to use unescapeHtml4()

    For Example:
    string str ='&#1056;&#1080;&#1096;&#1072;&#1090;&#124;';
    string decode = str.unescapeHtml4();
    system.debug('@@@ '+decode);

    Hope this helps you.

  • PRANAV

    Member
    March 29, 2018 at 8:40 am in reply to: Is there any limitation to load fields for mapping in webmerge?

    Hi All,

    You can also post the separate question for same for faster response.

  • Hi Neha,

    You can also post the separate question for same for faster response.

Page 1 of 12