Forum Replies Created

Page 6 of 12
  • Manpreet

    Member
    January 18, 2018 at 4:56 am in reply to: How can I call PageBlockSection at CommandLink Action in Salesforce?

    Hi Saloni,

    I just moved it out as separate function and calling it from commandbutton. you can do the same with commandlink as well.

    <apex:page >
    <script>
    function expandCollapse(){
    twistSection(document.getElementById('{!$Component.theForm.block1.section1}').getElementsByTagName('img')[0]);
    }
    </script>
    <apex:form id="theForm">
    <apex:commandButton value="Click Me" onclick="expandCollapse(); return false;"/>
    <apex:pageBlock id="block1">
    <apex:pageBlockSection id="section1" columns="2" collapsible="true" title="Title">
    Example Area
    </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:form>
    </apex:page>

    Thanks.

  • Hi Shaharyar,

    Amazon EC2 is an Infrastructure as a Service which offers pay-by-hour servers (EC2), storage (S3) etc. You bring your own software to the table - OS (Red Hat, Windows, whatever), Database (MySQL, Oracle, DB2, whatever), Search (your pick), Business Intelligence (Cognos, Oracle BI, whatever) - and then you piece it together and get it all to work. The benefits are that you can do whatever you want - and the con is you have to manage complexity yourself.

    Force.com, by contrast, is a Platform as a Service that provides a pre-integrated offering that already has a database, search, BI Reports, identity/security etc. all built in - that you program using a Java-like language (Apex). With the newly announced VMforce, a VMware and Salesforce.com offering, you will be able to use Java soon. Force.com automatically backs up your data, manages upgrades (your apps don't need to know if Force.com is running on database version 11i or 11g, Dell boxes or Sun boxes, Linux or Windows etc.)

    Thanks.

  • Hi Radhakrishna,

    You can create a different record pages for each record type.After that click on the View Page Assignment to define each one for each record type:

    nHY2f

    SoQJb

    Thanks.

  • Hi Martina,

    You can use SOQL Query something Like this :

    [Select AccountId from Account group by ContactId having count(Name) > 1];

    Thanks.

  • Manpreet

    Member
    January 17, 2018 at 6:49 am in reply to: What is the integration like between Zendesk and Salesforce?

    Hi Shaun,

    You can down their App from App Exchange "Zendesk for Salesforce" and follow up with their Installation Guide.Zendesk’s out-of-the-box Salesforce integration allows Zuora’s Salesforce users to have visibility into customer service tickets. It also empowers Zuora support agents with a 360 view of relevant Salesforce Account and Contact data. We are very pleased to see Zendesk continue to enhance its Salesforce integration.

    Thanks.

  • Hi Audrey,

    Marketo can handle some of what you are talking about, as well as tools like Infer, Bizible, etc. Just look up “Account Based Marketing” software, I am sure most of these integrate with SFDC - the issue is, of course, the added cost and complexity they bring to your lead management operations.

    Thanks.

  • Hi Obivan,

    To encrypt some value we have to use some key value that can be hard coded or we can generate key also by using this :

    Blob cryptoKey = Crypto.generateAesKey(256);

    We have to use same key to decrypt that value.

    Here I’m going to share some code.Hope it will help you. I have created one visualforce page and one controller. In the page only one field(Name) is there and two button(Save & Update).
    When some value is entered in the name field and clicked on save button that value will be stored in the object encrypted format.

    Now record id in the url and click on update button encrypted value will be converted in to original format.

     

    VISUALFORCE PAGE :

    _______________________________________________________________________________

    <apex:page standardController="EnCrypt_Decrypt__c" extensions="EncryptExtensioncls">
    <apex:form >
    <apex:pageBlock >
    <apex:pageBlockSection >
    <apex:inputField value="{!http://encrypt.Name}"/>
    <apex:commandButton value="Save" action="{!Save}"/>
    <apex:commandButton value="Update" action="{!test}"/>
    </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:form>
    </apex:page>

     

    CONTROLLER:
    ________________________________________________________________________________

    public class EncryptExtensioncls{
    public EnCrypt_Decrypt__c encrypt{get;set;}
    //Blob cryptoKey;
    Blob cryptoKey = Blob.valueOf('380db410e8b11fa9');
    public Id recordId{get;set;}
    public EncryptExtensioncls(ApexPages.StandardController controller){
    //cryptoKey = Crypto.generateAesKey(256);
    recordId = Apexpages.CurrentPage().getParameters().get('id');
    if(recordId !=null){
    encrypt = [SELECT id,Name From EnCrypt_Decrypt__c WHERE id=:recordId];
    }
    else{
    encrypt = new EnCrypt_Decrypt__c();
    }
    }
    public PageReference Save(){
    Blob data = Blob.valueOf(http://encrypt.Name);
    Blob encryptedData = Crypto.encryptWithManagedIV('AES128', cryptoKey, data);
    String b64Data = EncodingUtil.base64Encode(encryptedData);
    encrypt.name = b64Data ;
    insert encrypt;
    return null;
    }
    public PageReference test(){
    //Blob cryptoKey = Crypto.generateAesKey(256);
    //Blob data = Blob.valueOf(http://encrypt.Name);
    Blob data = EncodingUtil.base64Decode(http://encrypt.Name);
    Blob decryptedData =Crypto.decryptWithManagedIV('AES128', cryptoKey, data);
    String dryptData = decryptedData.toString();
    System.debug('Printing dryptData '+dryptData);
    encrypt.name = dryptData;
    update encrypt;
    return null;
    }
    }

    Thanks.

  • Hi pranav,
    You can achieve this via Profile settings for included components
    Section.There you can find a button namely "Add Profile".
    Thanks.

  • Manpreet

    Member
    January 17, 2018 at 4:19 am in reply to: Looking for a Salesforce internship in USA

    Hi sandeep,
    This is a very good question, as you wouldn’t want to waste time applying to internships for companies that don’t want to sponsor a Visa or hire international students for other reasons.

    I have compiled results from a survey of students from Canada interning in Silicon Valley this summer, and what companies they will be interning at . These companies are ordered from most interns to least.

    Yahoo, Google, Uber, A9, Wish, Tesla, Apple, NVIDIA, Yelp, Facebook, Salesforce, Gametime, Wemesh, Asana, Microsoft, Pinterest, Nimble Storage, Amazon Lab126, Meraki, FutureAdvisor, Coinbase, Tile, Hustle, Coursera, Ultimate Software (Kanjoya), Minted, Athos, Nuvation, Atomic (Mira), Joyable, Slack, Roblox, Airbnb.

    While these are examples of companies hiring Canadian students, specifically, this shows that they are willing to hire international students in general.
    Thanks.

  • Hi,
    1) Add the main script to a js file and add it to static resource.

    2) Create a new Custom Link.

    3) Reference the js file in the custom link you created in the previous step. We will also need jQuery, so we will add that as well.

    4) Add that custom link a home page component of type Links.

    5) Add the home page component to the home page layout and you’re done. For more details on this hacking method, you can check this link here

    So here we go: ->

    1) Create a javascript file with the below code and add it as a static resource with the name attachmentjs

    jQuery(function(){

    /*Checks when the notes and attachment section is loaded and then initiates the process.*/
    var timeInterval = setInterval(function(){
    if(jQuery("div.bRelatedList[id$=RelatedNoteList]").find("div.pbHeader").find("td.pbButton").find("input[name=attachFile]").length > 0){
    addAttachButton();
    clearInterval(timeInterval);
    }
    },100);

    });

    /*Adds the drop zone div in the notes and attachment section. Event listener are added to listen when files are dropped in the zone.*/
    function addAttachButton() {

    var attachmentDiv = jQuery("div.bRelatedList[id$=RelatedNoteList]");
    insertButton();

    attachmentDiv.find("div.pbHeader").find("td.pbButton").after(
    jQuery("

    ", {
    style : "width:35%;cursor:pointer;"
    }).append(jQuery("",{
    style : "height: 30px; width: px;border-color: orange;border: 3px solid orange;border-style: dotted;border-radius: 4px;text-align: center;vertical-align: middle;line-height: 2;color: Red;font-family: monospace;font-size: 14px;",
    id : "dropDiv"
    }).append(jQuery("",{id:"clickHere"}).text('Drop files here / click here!') , jQuery("",{id:"uploadingMessage",style:"display:none;"}).text('Uploading your Files, please wait!'))
    )
    );

    jQuery("#dropDiv").on('click',function(){
    if(jQuery("#uploadingMessage:hidden").length > 0) {
    if(jQuery("#multiUploadButton").length > 0) {
    jQuery("#multiUploadButton")[0].click();
    }else {
    insertButton();
    jQuery("#multiUploadButton")[0].click();
    }
    } else {
    alert('Your files are being uploaded. Please Wait!');
    }
    });

    function handleFileSelect(evt) {
    evt.stopPropagation();
    evt.preventDefault();
    var files = evt.dataTransfer.files; // FileList object.
    processFiles(files);
    }
    function handleDragOver(evt) {
    evt.stopPropagation();
    evt.preventDefault();
    evt.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy.
    }

    var dropZone = document.getElementById('dropDiv');
    dropZone.addEventListener('dragover', handleDragOver, false);
    dropZone.addEventListener('drop', handleFileSelect, false);
    }

    function processFiles(files) {
    hideDiv();
    var insertedFilesArray = [];
    var fileInsertionCounter = 0;

    for(i=0;i

  • Hi sajid,
    You can very much implement this functionality.I would suggest you to use accordions or pageblocksections for this.You can use SOQL Query something like this :
    [SELECT AccountId, FirstName, lastname
    FROM Contact
    WHERE lastname LIKE 'appl%'];
    Thanks.

  • Manpreet

    Member
    January 16, 2018 at 3:00 pm in reply to: How to write trigger on PriceBookEntry in Salesforce?

    Hi piyush,
    Instead of trigger I used a apex class and scheduled to run it every 15 mins. That is not a big load on Salesforce. The apex class holds one important query – It gets all the PriceBookEntry which are “modified in the last 15 minutes”. And then we perform all the updates required based on that.
    You can use field SystemModStamp. So that includes both “Inserts and Updates” done on PriceBookEntry

    List PBEUpdated15mins = [SELECT Id,Pricebook2Id
    FROM PriceBookEntry WHERE
    SystemModStamp >:Datetime.now().addMinutes(-15)];
    If you want the scheduler to run only on Insert of Pricebookentry, then instead of SystemModStamp, use CreatedDate in the query WHERE condition.

    List PBEUpdated15mins = [SELECT Id,Pricebook2Id
    FROM PriceBookEntry WHERE
    CreatedDate >:Datetime.now().addMinutes(-15)];
    Similarly if you want only Updates, you can replace with LastModifiedDate.

    Thanks

  • Manpreet

    Member
    January 16, 2018 at 2:41 pm in reply to: My old integration connected app is not working now in Salesforce

    Hi Rahul,
    What kind of integration flow have you implemented.They are of 3 types : 1.) Web server
    2.) User agent
    3.) Username-password

    In first two we can get refresh tokens which can be used to obtain new access token which gets expired after a certain period of time, that might be your case.
    Thanks.

  • Hi Audrey,

    Select Default Keyword to use this message as the default for all responses. This message is triggered if MobileConnect cannot link the incoming message to any keyword. You can set only one default keyword message per short or long code. Default keyword messages apply to private short or long codes.

    Thanks.

  • Manpreet

    Member
    January 16, 2018 at 12:59 pm in reply to: Unable to access Sublime Text from office networks in Salesforce

    Hi Subramanyam,

    I’ve been on a bit of a blog hiatus as of late – learning new tools and processes, applying them to my Force.comtoolbelt has been consuming my time as of late.

    One of those tools that has been around for a while, but finally someone got it through my head to try out is Mavensmate by Joe Ferraro.

    Built as a plugin for Sublime Text Editor 3, Mavensmate is a dream for editing code, using keyboard shortcuts to do so, working with code coverage, and getting in some Tetris during those long-running deploys.  =)

    Installing MM on a Mac is a breeze, but a Windows7 64bit install took me two days to figure out.  My post here today is to help those who are trying to do the same thing not kill the same two days it took me.

    1.  Sign up for a GitHub account

    2.  Install the Git for Windows package per the instructions:
    http://mavensmate.com/Plugins/Sublime_Text/Installation#windows

    3.  Download and install Chrome

    4.  Download and install Sublime Text 3 (32 bit only!  64 bit will NOT work!)

    5.  Do NOT start the Mavensmate installer yet; you need to first generate and install the Git SSH key:
    https://help.github.com/articles/generating-ssh-keys

    6.  Download the Mavensmate installer

    Now – this is where it gets tricky…start up the Mavensmate installer but DO NOT PROCEED beyond the first screen.  If you proceed beyond the first screen the install will fail and you’ll be quite frustrated with an error message that doesn’t give you what the real problem is.

    At this point – at the first screen of the Mavensmate installer, open up Sublime Text Editor 3 (32 bit).  When it finishes loading up, proceed through the rest of the Mavensmate installer.  You will see a “mavensmate” menu item appear in Sublime near the end of the install.

    7.  Proceed with the remaining steps on the official Mavensmate Windows install page.
    http://mavensmate.com/Plugins/Sublime_Text/Installation#windows

    Thanks.

  • Hi suraj,

    You can't call an Automated Process ( say Process builder ) off a formula. You best option would be to look for any changes of the fields that are in the formula and have the Automation Process ( say Process builder )  get triggered off of them.

    Thanks.

  • Hi suraj,

    We make instances in order to access variables of that ApexController in any other controller.Similar to OOPs concepts , making Object of class(here controller) and with the help of that object instance one can call methods or can access variables.

    Thanks.

  • Manpreet

    Member
    May 22, 2017 at 6:37 am in reply to: How to Integrate Payment Gateway in Salesforce Webpage?

    Hi suraj,

    You can use a Payment Gateway like Paytm or any other and can integrate it using REST API by making callouts.

    The Payment Gateway to which you want to integrate it with , reach out their website for their exposed urls which will be required while making API Calls.And remember you cannot make callouts just after DML's and sometimes while making callouts in Contructor of any Controller , it gets timeout notification.For more about How to do integration using REST API , refer to this article.

    Thanks.

  • Manpreet

    Member
    May 22, 2017 at 6:31 am in reply to: What is the purpose of using WebHook in Salesforce?

    Hi suraj,

    Webhooks are the modern, web-oriented way for servers to receive notifications from other servers. For instance, when an event happens on a server, like Salesforce.com, your own custom application can receive the event via a web request.

    Salesforce already has a built-in way to handle events called Triggers which run on Salesforce via Apex code. However, you may want to receive these events in your own custom application.

    Thanks.

  • Hi saurabh,

    While providing URL, do not specify the protocol. Use like this:
    <script type='text/javascript' src= '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'></script>

    Thanks.

  • Manpreet

    Member
    May 22, 2017 at 6:26 am in reply to: What is the process to become a Salesforce Trailblazer?

    Hi Radhakrishn,

    Earning Trailhead Badges, completing Trails, Modules, Super Badges, and Projects would be a pretty good start.

    To be more precise Trineaty, you need to complete 100 badges on Trailhead.

    Thanks.

  • Manpreet

    Member
    May 22, 2017 at 6:23 am in reply to: How can i make a callout(automatically) on VF page load?

    Hi suraj,

    Method 1:

    <script type = "text/javascript">
    window.onload=function()
    {
    alert("Hi");
    };
    </script>

    Method 2:

    Visuaforce page:

    <apex:page action="{!onLoad}">

    </apex:page>

    Controller:

    public class sample {
    public sample(){
    }

    public void onLoad(){
    ..................
    ..................
    }
    }

    Thanks.

  • Hi saurabh,

    In trigger, lets say we have system.debug() statement after adderror() method. Will system.debug() be statement executed in Trigger after adderror() method

    adderror() method is not error statement rather its normal execution flow and all the statements written after adderror() will be executed normally.

    Thanks.

  • Hi Suraj,

    You cannot extract related list records via Dataloader.
    Nested query is not supported.
    You can run only relateionship query like this via Dataloader.
    ----
    SELECT Id, Name, Account.Name FROM Contact
    ----

    Try to run your query via Workbench.

    Workbench
    http://wiki.developerforce.com/page/Workbench

    Thanks.

  • Hi suraj,

    This seems to be more of a OOPS question than apex per say..

    If typically if you already have a class which has capability to do query, sort etc. and would like to use its functionality in another class you simply would expose its methods as public and create an object in the other class where you would to use it and call it.

    Thanks.

Page 6 of 12