Forum Replies Created

Page 50 of 57
  • Hi,

    Try this code -

    Apex Class :-

    public with sharing class CustomLookupManager {
    public String selectedPhoneNumber {get;set;}
    public String selectedPhoneNumberContactName {get;set;}
    public String selectedObject {get;set;}
    public String selectedField {get;set;}
    public list<PhoneNumberDetail> getPhoneLocationsForGivenNumber1 {get;set;}

    private Map<String, Schema.SObjectType> schemaMap{
    get{
    if(schemaMap == null){
    schemaMap = Schema.getGlobalDescribe();
    }
    return schemaMap;
    }private set{}
    }

    public list<selectOption> allFieldsForSelectedObject {get;set;}
    /*Controller*/
    public CustomLookupManager(){
    allFieldsForSelectedObject = new list<selectOption>();
    }

    /*To get all object which have phone numbers*/
    public list<selectOption> getsObjects(){
    selectedPhoneNumber = ''; //to reset phone numbers field
    list<selectOption> objectsList = new list<selectOption>();
    list<String> tempObject = new list<String>{'Account','Lead',
    'Opportunity','Contact','Case'};
    objectsList.add(new SelectOption('','--Select Object--'));
    Map<String, Schema.SObjectType> gd = schemaMap;
    Schema.DescribeSObjectResult r;
    Schema.SobjectType sobjecttype;
    for(String objectKey: gd.keySet()){
    sobjecttype = gd.get(objectKey);
    r = sobjecttype.getDescribe();
    if((r.getName()).contains('__c'))
    objectsList.add(new SelectOption(r.getName(), r.getLabel()));
    }
    for(string obj:tempObject){
    objectsList.add(new selectOption(obj,obj));
    }
    return objectsList;
    }

    /*To get all fields on the basis of object*/
    public list<selectOption> getFieldsForSelectedObject(){
    selectedPhoneNumber = ''; //to reset hone number field
    list<selectOption> fieldsName = new list<selectOption>();
    try{
    if(selectedObject != null || selectedObject != ''
    || selectedObject != '--Select Object--'){
    Map<String, Schema.SObjectField> fieldMap = schemaMap.get(selectedObject).
    getDescribe().fields.getMap();
    for(Schema.SObjectField sfield : fieldMap.Values()){
    schema.describefieldresult dfield = sfield.getDescribe();
    schema.Displaytype disfield= dfield.getType();
    system.debug('#######' + dfield );
    if(dfield.getType() == Schema.displayType.Phone){
    fieldsName.add(new SelectOption(dfield.getName(),dfield.getLabel ()));
    }
    }
    }
    }catch(Exception ex){
    apexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,
    'There is no Phone or Fax Field Exist for selected Object!'));
    }
    return fieldsName;
    }
    /*to populate field*/
    public void populateFields(){
    allFieldsForSelectedObject = getFieldsForSelectedObject();
    }

    /*Phone Number's Records*/
    public class PhoneNumberDetail{
    public String contactName{get;set;}
    public PhoneNumberDetail(String contactName){
    this.contactName = contactName;
    }
    }
    }

    Visualforce page code:-

    <table class="list" border="0" cellspacing="0" cellpadding="0"
    style="width:44% !important">
    <tr class="headerRow">
    <th><b>Select Object</b></th>
    <th><b>Select Field</b></th>
    <th><b>Value</b></th>
    </tr>
    <tr>
    <td style="white-space:nowrap;">
    <apex:selectList size="1" value="{!selectedObject}" id="selectedObjectId">
    <apex:selectOptions value="{!sObjects}" />
    <apex:actionSupport event="onchange" action="{!populateFields}"
    rerender="selectfield,SearchPanelId" status="ajaxStatus"/>
    </apex:selectList>
    <apex:actionStatus id="ajaxStatus">
    <apex:facet name="start">
    &nbsp;
    <apex:image value="{!$Resource.ajaxLoad}" height="16"
    width="16" />
    </apex:facet>
    </apex:actionStatus>
    </td>
    <td>
    <apex:selectList size="1" value="{!selectedField}" id="selectfield" >
    <apex:selectOption itemValue="" itemLabel="--Select--"/>
    <apex:selectOptions value="{!allFieldsForSelectedObject}"/>
    </apex:selectList>
    </td>
    <td style="white-space:nowrap;">
    <apex:inputText id="phoneNumberFieldId" value="{!selectedPhoneNumber}"/>
    <apex:inputHidden id="phoneNameFieldId"
    value="{!selectedPhoneNumberContactName}"/>
    <a href="#" id="acc3_lkwgt" onclick="openLookupPopup();" tabindex="2"
    title="Parent Account Lookup (New Window)" style="text-decoration: none;">
    <img src="/s.gif" alt="Parent Account Lookup (New Window)"
    class="lookupIcon"
    onblur="this.className = 'lookupIcon';"
    onfocus="this.className = 'lookupIconOn';"
    onmouseout="this.className = 'lookupIcon';this.className = 'lookupIcon';"
    onmouseover="this.className = 'lookupIconOn';this.className = 'lookupIconOn';"
    title="Parent Account Lookup (New Window)"/>
    </a>
    <span class="helpButton" id="Phone.Search-_help">
    <label for="phoneNumberFieldId"></label>
    <img src="/s.gif" alt="" class="helpOrb" title=""/>
    <script type="text/javascript">
    sfdcPage.setHelp('Phone.Search', '<table><tr><td><center></center>
    </td></tr><tr><td>Custom lookup Example</td></tr></table>');
    </script>
    </span>
    </td>
    </tr>
    </table>

    Hope this helps.

  • Hi,

    Given that the exception relates to the WhatId, I suspect that whatever the custom object type referred to by the prefix 0XB is, it does not have Allow Activities active on the object metadata.

    Hope this helps.

  • shariq

    Member
    September 13, 2018 at 11:15 pm in reply to: What do Salesforce recruiters look for when hiring a sales intern/graduate?

    Hi Abhay,

    I could only tell you about the developer, most important thing for a developer is not solving the problem but how he/she approaches the logic to solve that problem.

    Hope it helps.

  • shariq

    Member
    September 13, 2018 at 11:09 pm in reply to: Record Level access with profile and OWD in Salesforce

    Hi,

    For first - User can view the data(records).

    For second - Yes he will able to edit and delete records which you create.

    Hope this helps.

  • shariq

    Member
    September 13, 2018 at 11:05 pm in reply to: How to implement Print detail and send email button in Salesforce?

    Hi,

    For printing detail page you can java script  - <apex:commandLink value="Print" onclick="window.print();"/>

    For Send Email, put this code on button click -

    List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();

    Messaging.SingleEmailMessage mail =
    new Messaging.SingleEmailMessage();

    List<String> sendTo = new List<String>();
    sendTo.add({!email});
    mail.setToAddresses(sendTo);
    mail.setReplyTo({!replyEmai});
    mail.setSenderDisplayName({!SenderName});
    List<String> ccTo = new List<String>();
    ccTo.add({!ccToAddresses});
    mail.setCcAddresses(ccTo);

    mail.setSubject({!mailSubjet});
    String body = {!customBody};
    mail.setHtmlBody(body);
    mails.add(mail);
    Messaging.sendEmail(mails);

    Hope this helps.

  • shariq

    Member
    September 13, 2018 at 10:46 pm in reply to: Looking for Salesforce Job | Admin/BA role : Canada

    Hi Mayank,

    This community section is for salesforce related queries and doubts.

  • Hi Kapil,

    I think security review process is same for any app to put it into app exchange.

    Hope this helps.

  • shariq

    Member
    September 13, 2018 at 10:36 pm in reply to: How does sales agent and marketing qualify Lead?

    Hi,

    I think they follow series of events that alerts their marketing team and then the sales reps of when a lead is ready to be fit and then closed, they will be pitching leads that aren’t ready.

    Hope this helps.

  • shariq

    Member
    September 13, 2018 at 10:29 pm in reply to: How to make Sales agent collect all lead into the system in Salesforce?

    Hi,

    You can import your lead csv data through data loader or any other tool, you can write a script to save the leads in salesforce from any other environment.

    Hope this helps.

  • Hi,

    We can't tell you the companies name but it totally depend upon their architecture that how they want to fill or view information.

    Hope this helps.

  • Hi,

    In layman terms your Salesforce domain is parent and your community domain is child, so we could not say it is completely a new website.

    Hope this helps.

  • shariq

    Member
    September 13, 2018 at 10:19 pm in reply to: Why does the site created in Salesforce does not show globally?

    Hi,

    Can you please give more detail about the issue, Is your Force.com site not working in any browser, for more information could you send your site settings images.

    Thanks

  • shariq

    Member
    September 13, 2018 at 10:11 pm in reply to: Can anyone share "Edit link" action on Custom related list?

    Hi,

    I think you have created VF page where you are showing list on some condition via apex and clicking edit link you want to open detail page in edit mode. For that you have to create PageReference type method in which you have to pass the record Id(getter setter variable).

    try this -

    PageReference acctPage = new PageReference('/'+{!recordId}+'/e?retURL=%2Fa'+ID);

    Hope this helps.

  • shariq

    Member
    September 13, 2018 at 8:58 pm in reply to: Is it necessary to have log opportunities with lead in Salesforce?

    Hi,

    If the user does not have access to create permission on opportunities then if the user tries to convert a lead an error message "Error: You do not have the required permissions. To continue, you must have the 'Create' permission on Opportunity." will appear if the user tries to create Opportunities while conversion.

    Hope this helps.

  • Hi,

    I don't think that you can change the standard button as per your need, you need to create you would use Quick Actions instead of buttons in Lightning.

    Hope this helps.

  • shariq

    Member
    September 13, 2018 at 8:55 pm in reply to: Why name and subject is same in Salesforce marketing cloud?

    Hi,

    I have searched on net but could not find the reason, I think it is a standard functionality of salesforce marketing cloud.

    Hope this helps.

  • Hi,

    I don't think it is used in marketing cloud for advertising, but you can integrate salesforce with this tool.

    Hope this helps.

  • shariq

    Member
    September 13, 2018 at 8:55 pm in reply to: How to get the value of lightning:inputField when the field is blank?

    Hi,

    Try this : - component.find('Tag_Id').get('v.value')

    Hope this helps.

  • Hi Sharddha,

    Could you explain more what are your requirements.

    Thanks

  • Hi,

    You need to call a java script function on key up mode for that input lightning tag that will filter your data(your logic setup).

    Hope this helps.

  • Hi,

    I have gone through different sites, but I could not find the custom tabs required for installation of marketing cloud. Could you explain more what you want.

    Thanks

  • shariq

    Member
    September 13, 2018 at 8:53 pm in reply to: How to enable Visualforce page scroller for all browsers?

    Hi,

    I think you need to set both showHeader and standardStylesheets to false.

    Hope this helps.

  • Hi,

    This is what I found on different site after searching, It may help-

    When your sales rep quotes a bundle product, Salesforce CPQ can assign that bundle’s quote line a unique package product code based on its configuration. You can define a template for the package product code that contains a combination of static text and variables. Your sales reps can then use each package product code as a SKU to quickly send configured bundle data to their orders team.

    Hope this helps.

    • This reply was modified 6 years, 3 months ago by  shariq.
  • shariq

    Member
    September 13, 2018 at 8:02 pm in reply to: What is Change Data Capture?

    Hi,

    You can post this in your blog section with some more understandable images.

    Thanks

  • shariq

    Member
    September 13, 2018 at 8:00 pm in reply to: How to generate the random string or random password using Apex?

    Hi,

    public String testGenerate(Integer getLength)

    {
    String charString = '!@#$%^&*()nopqrstuvwABCDPQRSTUVWXYZ0123456789abcdefghijkEFGHIJKLMNOlmxyz';
    String randomNew = '';
    while (randomNew .length() < getLength)

    {
    Integer changeInt = Math.mod(Math.abs(Crypto.getRandomInteger()), charString.length());
    randomNew += charString.substring(changeInt , changeInt +1);
    }
    return randomNew ;
    }

    Hope this helps.

Page 50 of 57