• bk s
  • NEWBIE
  • 30 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 17
    Replies
Hi Team,

In Partner Portal.. I attached 4 Images in Notes and attachments to different Account ... and scenario  is images should display dynamically basing on the logged in account... i am not able to refer on Visualforce Page.... Can yu please help me on the code...Help me how to refer in VF pages...

Thanks In advance
Hello awesome developers!

I am stuck here, and I will be up front I am prety new to the apex extension for VF pages.  

I am attempting to as a record is closed, send an email from a workflow with an url to a VF page for an user to fill out a brief survey.  I am attempting to place a parameter in the URL of the closing records ID to then pre populate the lookup field on the VF page with the ID of the closing record that is sending the survey needed email. 

I have the following VF page built and extension, however when the page is loaded, the lookup field on the VF page is not being populated.  Any ideas on what I did incorrectly and or ideas on how to make this work?  

I appreciate any input,

PS...once this is working, since I am new to the extension building, any insights on building a test class for the extension?

Shawn

VF Page:
 
<apex:page standardController="Salesforce_Support_Survey__c" sidebar="false" showHeader="false" extensions="SalesforceSupportSurveyController" docType="html-5.0">
   
    <style>
    html, body, p { 
        font-family: "ProximaNovaSoft-Regular", Calibri, 
            "Gill Sans", "Gill Sans MT", Candara, Segoe, 
            "Segoe UI", Arial, sans-serif; 
        font-size: 110%;
    }
    input { font-size: 95%; }
	</style>
    
    <apex:form >
        <apex:pageBlock title="Thank you for taking our short survey!" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="Submit Survey"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Survey Questions:" columns="2">
                <apex:outputField value="{!Salesforce_Support_Survey__c.X1_Timliness__c}"/>
                <apex:inputField value="{!Salesforce_Support_Survey__c.X1_Answer__c}"/>
                <apex:outputField value="{!Salesforce_Support_Survey__c.X2_Satisfaction__c}"/>
                <apex:inputField value="{!Salesforce_Support_Survey__c.X2_Answer__c}"/>
                <apex:outputField value="{!Salesforce_Support_Survey__c.X3_Submission_process__c}"/>
                <apex:inputField value="{!Salesforce_Support_Survey__c.X3_Answer__c}"/>
                <apex:outputField value="{!Salesforce_Support_Survey__c.X4_Enhancement_Ideas__c}"/>
                <apex:inputField value="{!Salesforce_Support_Survey__c.X4_Answer__c}"/>
                <apex:outputField value="{!Salesforce_Support_Survey__c.X5_Additional_Comments__c}"/>
                <apex:inputField value="{!Salesforce_Support_Survey__c.X5_Answer__c}"/>
                <apex:inputField value="{!Salesforce_Support_Survey__c.Issue__c}"/>
                 <script>
          			document.getElementById('{!$Component.dynFieldName}_lkid').value = '{!IssueId}';
          			document.getElementById('{!$Component.dynFieldName}').value = '{!IssueName}';
      			</script>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Extension:
 
public class SalesforceSupportSurveyController
{
    public string IssueId
    {    get;set;    }

    public string IssueName
    {    get;set;    }
    
    public SalesforceSupportSurveyController(ApexPages.StandardController ctlr)
    {
        IssueId = System.currentPageReference().getParameters().get('lookupVal');
        IssueName = [select Name from SFDC_Issue__c where Id =: IssueId].Name;
    }
}

 
Requesting help from Saleforce Trailhead Admin. I'm using a brand new DE org for this superbadge. I've complete the challenge and it works in my org, but the validation has this error:

There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: IHOXZBFU
I'm integrating Salesforce with Mailchimp as the default connecting isn't doing what I need.  I've created a simple class to hold the REST Body

public class MailChimpSubscriberJson{
    public class Merge_fields {
        public String FNAME;
        public String LNAME;
    }
    public class JSON2Apex {
        public String id;
        public String email_address;
        public String status;
        public Merge_fields merge_fields;
    }
}

But my assignment works for apart of the sub-class, Merge_fields.  Specifically this line of code is wrong, but I can't see why.  There is data in the Firstname.

                Subscriber.merge_fields.FNAME=MailchimpContact[0].Firstname;

I'm getting this error, common.apex.runtime.impl.ExecutionException: Attempt to de-reference a null object.  I can only think Subscriber.merge_fields.FNAME is incorrect.
Hi All,
Can any one guide me how to prevent duplicate case creation using Messaging.InboundEmailHandler . 
The business scenario is customer send a mail by removing case thread id from the subject and description of the email and instead of thread id customer put case number on the subject and enquire about the case.
Hello All,
Been banging against this for a while.
Started in standard dev environment and was above 80%.
Now that i moved it to a full sandbox it is at 72%.

Any ideas on why or how to increase.

Thanks

TRIGGER CODE

trigger OTOpportunityTrigger on Opportunity (after insert)
{
//Begin Loop of OTM Lookup   
for(Opportunity oppty : trigger.New)
{
    List<OpportunityTeamMember> listOpptyTeamMem = new List<OpportunityTeamMember>();
     Account[] accts = [SELECT Id, Enterprise_Zip_Postal_Code__c FROM Account WHERE Id =: oppty.AccountId LIMIT 1]; 
     List<CTRAS__c> CTRAScic = new List<CTRAS__c>();
     List<CTRAS__c> CTRAScice = new List<CTRAS__c>();
     List<CTRAS__c> CTRASssc = new List<CTRAS__c>();
     List<CTRAS__c> CTRASssce = new List<CTRAS__c>();
     List<CTRAS__c> CTRASisc = new List<CTRAS__c>();
     List<CTRAS__c> CTRASisce = new List<CTRAS__c>();
     Set<Id> OpptyIdSet =  new Set<Id>();
     string a;
     string b;
if (accts.size() > 0) {
a = accts[0].Id;
b = accts[0].Enterprise_Zip_Postal_Code__c;
CTRAScice = [Select Aligned_Member__c from CTRAS__c where UID__c=:'CIC-'+ b.substring(0,5) + '-' + a.substring(0,15) limit 1];        
CTRASssce = [Select Aligned_Member__c from CTRAS__c where UID__c=:'SSC-'+ b.substring(0,5) + '-' + a.substring(0,15) limit 1];        
CTRAScic = [Select Aligned_Member__c from CTRAS__c where UID__c=:'CIC-'+ b.substring(0,5) + '-' limit 1];        
CTRASssc = [Select Aligned_Member__c from CTRAS__c where UID__c=:'SSC-'+ b.substring(0,5) + '-' limit 1];        
}
//Find Values used for assignment 
OpportunityTeamMember OTMC = new OpportunityTeamMember();
OpportunityTeamMember OTMS = new OpportunityTeamMember();
OpportunityTeamMember OTMI = new OpportunityTeamMember();
//Confirm Opp exists.      
if(oppty.Id != null)    
{
if(accts != null) // check if list is not empty
{
//Check for exceptions
CTRASisce = [Select Aligned_Member__c from CTRAS__c where UID__c=:'ISC-'+ UserInfo.getUserId().substring(0,15) + '-' + a limit 1];        
//Perform standard lookups
CTRASisc = [Select Aligned_Member__c from CTRAS__c where UID__c=:'ISC-'+ UserInfo.getUserId().substring(0,15) + '-' limit 1];        
}
 
//ADD CIC TO OT
if (CTRAScice.size() > 0)
{
            OTMC.OpportunityId = oppty.Id;
            OTMC.TeamMemberRole = 'CT CIC';
            OTMC.UserId = CTRAScice[0].Aligned_Member__c;
            listOpptyTeamMem.add(OTMC);
} else if (CTRAScic.size() > 0) {
            OTMC.OpportunityId = oppty.Id;
            OTMC.TeamMemberRole = 'CT CIC';
            OTMC.UserId = CTRAScic[0].Aligned_Member__c;
            listOpptyTeamMem.add(OTMC);
}
//ADD SSC TO OT
if (CTRASssce.size() > 0)
{
           OTMS.OpportunityId = oppty.Id;
           OTMS.TeamMemberRole = 'CT SSC';
           OTMS.UserId = CTRASssce[0].Aligned_Member__c;
           listOpptyTeamMem.add(OTMS);
} else if (CTRASssc.size() > 0) {
           OTMS.OpportunityId = oppty.Id;
           OTMS.TeamMemberRole = 'CT SSC';
           OTMS.UserId = CTRASssc[0].Aligned_Member__c;
           listOpptyTeamMem.add(OTMS);
}
//ADD ISC TO OT
if (CTRASisce.size() > 0)
{
            OTMI.OpportunityId = oppty.Id;
            OTMI.TeamMemberRole = 'CT ISC';
            OTMI.UserId = CTRASisce[0].Aligned_Member__c;
            listOpptyTeamMem.add(OTMI);
} else if (CTRASisc.size() > 0){
            OTMI.OpportunityId = oppty.Id;
            OTMI.TeamMemberRole = 'CT ISC';
            OTMI.UserId = CTRASisc[0].Aligned_Member__c;
            listOpptyTeamMem.add(OTMI);
}
insert listOpptyTeamMem;
}
}
}


TEST CLASS CODE

@isTest(SeeAllData=True)
public with sharing class TestOTOpportunityTrigger {

    public static testmethod void test_1() {
     string a;
        Opportunity o  = new Opportunity();
        o.OwnerID = UserInfo.getUserId();
        o.StageName = 'Opportunity Identified';
        o.CloseDate = Date.newInstance(2017,11,30);
        o.AccountId = '001E000001KJsA1';
        o.Name = 'TestOpportunityTriggers3';
        o.Shipper_Payor__c = 'Shipper';
        o.Ramp_Date__c = Date.newInstance(2017,11,30);
        o.RecordTypeId = '012E0000000DC1E';
        insert o;
       
        OpportunityTeamMember OTMC = new OpportunityTeamMember();
        OpportunityTeamMember OTMS = new OpportunityTeamMember();
        OpportunityTeamMember OTMI = new OpportunityTeamMember();

        OTMC.OpportunityId = o.Id;
        OTMC.TeamMemberRole = 'CT CIC';
        OTMC.UserId = '00544000008Hw08';
        insert OTMC;
       
        OTMS.OpportunityId = o.Id;
        OTMS.TeamMemberRole = 'CT SSC';
        OTMS.UserId = '00544000008Hw08';  
        insert OTMS;
           
        OTMI.OpportunityId = o.Id;
        OTMI.TeamMemberRole = 'CT ISC';
        OTMI.UserId = '00544000008HgiI';  
        insert OTMI;

        }
    }

Code Block missing 1Code block missing 2
I am getting this error while deploying Ant migration tool. I compile all classes and triggers. . Still the error is not gone. Let me know how to fix this error.
Hello everyone, 

this is my first question here, so please let me know if there's anything I can do to help you solve my problem quicker.

Setup: 
I'm sending a callout request in order to receive a response in JSON which contains a link to a website. The request looks like this:
 
http://api.ekomi.de/v3/putOrder?auth=accountId|password&order_id=E10002&version=cust-1.0.0&type=json
The response I'm getting is System.HttpResponse[Status=OK, StatusCode=200]

When I enter the callout request in my browser I get the following response:
{"link":"https:\/\/www.ekomi.de\/kundenmeinung.php?kunde=customerId&shop=accountId","hash":"2f68e87f2ba63a7929798400c372126b","known_since":"2017-07-24","done":1,"done_at":1500900539}

Problem
When I try to debug the response's body, I get the following error: System.CalloutException: Could not parse HTTP response body to string

When I take the string I got from the browser and try to debug it, I get the following error:
ERROR deploying ApexClass classes/SendEkomiReviewRequest.cls: Invalid string literal '{"link":"https:\/\/www.ekomi.de\/kundenmeinung.php?kunde=customerId&shop=accountId","hash":"2f68e87f2ba63a7929798400c372126b","known_since":"2017-07-24","done":1,"done_at":1500897547}'. Illegal character sequence '\/' in string literal.

Is there a way of altering the response I'm getting before it's parsed, so I can eventually deserialize it? 

Thanks for your help!
Daniel
public void manage()
    {
        Evt ev = null;
        if(Trigger.isInsert && Trigger.isBefore)
        {
            ev = Evt.beforeinsert;
        }
        else if(Trigger.isInsert && Trigger.isAfter)
        {
            ev = Evt.afterinsert;
        }
        else if(Trigger.isUpdate && Trigger.isBefore)
        {
            ev = Evt.beforeupdate;
        }
        else if(Trigger.isUpdate && Trigger.isAfter)
        {
            ev = Evt.afterupdate;
        }
        else if(Trigger.isDelete && Trigger.isBefore)
        {
            ev = Evt.beforedelete;
        }
        else if(Trigger.isDelete && Trigger.isAfter)
        {
            ev = Evt.afterdelete;
        }
        else if(Trigger.isundelete)
        {
            ev = Evt.afterundelete;             
        }
        
        List<HandlerInterface> handlers = eventHandlerMapping.get(ev.name());
        
        if (handlers != null && ! handlers.isEmpty()) 
        {
            for (HandlerInterface h : handlers) 
            {
             if(Test.isRunningTest()){
            }
            else{
                h.handle();
                }
            }
        }
    }
}

I have added if(Test.isRunningTest()) to avoid the trigger while runnning test classes.Is it the correct way?
I Have class where i am writing all the queries and calling into the other class .
I need to the get the custom setting values from class B to class A and assign to variable in class A.
Here is the code in Class B.
public String ABC()
    {
     List<User> ListUserValues= getCurrentUserInfoById(userinfo.getUserId());
        for(User UserValues :ListUserValues)
        {
          if(UserValues.Location__c=='US')
          {
            AuthenticationSettings__c GLIntegration = AuthenticationSettings__c .getAll().get('SAP_Universal');
             UserName=Integration.User__c;
             Password=ntegration.Password__c;
             EndPoint=ntegration.EndPoint__c;
             UserDet = UserName + ':' + Password;
          }
         }

I need to get UserDet and endpoint variable in Class A.

Can you help me how to get the value into class A.

Thanks for help

Regards,
Jyo
Hi,

I have a VF page that I am using on the standard detail page , I am working on a req When there are a lot of Opportunity products it's not very user friendly to scroll.   Is it possible to mimic the same functionality that's on the standard related list?  Have the "Show N More>>" link that shows additional records right on the same page like the related list does and a "Go to list (N)>>" link that sends them to a new page?   
Hi Guys,
              I am trying to find duplicate accounts in the system and trying to merge them based on our filter criteria using apex. The issue is I am hitting the governor limit of 150 DML statements while doing this.
We will have to put the merge statement inside the loop as we need the parent and child as the parameters in the merge statement. I don't think we can bulkify Merge like other DML statements due to the above reason. I am not sure if there is any better way to do it and avoid hitting governor limits.
Any help in this regard would be greatly appreciated.
I'm trying assign a value to a lookup object that was retrieved from an inbound email. The value has already been successfully retrieved. The next hurdle is for my code to assign the value to the lookup field. Been playing around with SOQL but am now stuck.

Please help.

 

Hi there,


We are currently using salesforce SOAP API.

From a client we are able to connect to test.salesforce.com on port 443 and successfully authenticated and perform API actions.
 
We have recently implemented 2-way mutual authentication and now we are unable to perform API actions. We received the following two errors.
 
 
An unexpected error occurred. Please include this ErrorID if you contact support 1204428080-30724 (1157628926)
 
MUTUAL_AUTHENTICATION_FAILED.

 
 
In reviewing developers.salesforce.com it was recomneded to use port 8443 to perform mutual authentication. We tried that with the client but the client was unable to estabilish a connection on port 8443 and it timed out.
 
Any ideas to resolve the above errors would be helpful?

Thanks

 

  • April 01, 2016
  • Like
  • 0
Hi Team,

In Partner Portal.. I attached 4 Images in Notes and attachments to different Account ... and scenario  is images should display dynamically basing on the logged in account... i am not able to refer on Visualforce Page.... Can yu please help me on the code...Help me how to refer in VF pages...

Thanks In advance
Hi all!

I'm a beeginner and I need a formula field to add the first 3 sales recorded of an account.

I don't have already the sales field in my account fields.

Hope you can help me
Built few lightning components for listing records,redirecting to particular record detail after clicking from the list view, add new record and redirecting between these components with e.force.navigateToComponent event. This worked for few days but not working now. I looked into it did not able to found the issue. May be its because their version automatically changed to 34 previously it was 33. Please suggest.

Thanks and Regards
Anshuman Chauhan 
Hi all,
I've tried alot of solutions for this issue but when I install the package then I received an email with exception info as below:
System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out.

Please find below my code:
global class PostInstallClass implements InstallHandler {
  global void onInstall(InstallContext context) {
      User u = GetUserById(context.installerId());
      try
      {
          if(!Test.isRunningTest())          UpdatePackageInstallationInfo(context.installerId(), u.Email);
      }
      catch(Exception e)
      {
          SendMessage(new String[]{'abc@xyz.com'},'Package failed to install/upgrade','Failed to install/upgraed package. ' + u.Email + ' tried to install/upgraed the package but failed because. Error Details: ' + e);
      }     
  }
    
    public User GetUserById(ID id)
    {
        User u = [Select Id, Email from User where Id =:id];
        return u;
    }
    
    @future(callout=true)
    public static void UpdatePackageInstallationInfo(String organizationId, String userEmail)
    {        
        String url = 'http://demoapi.sunapplabs.com/api/salesforce/updateinstallpackage?organizationid='+organizationId;
        Http h = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint(url);
        req.setMethod('GET');
        HttpResponse responseResult = h.send(req);
        if(responseResult.getBody() == 'true')
        {            
            SendMessage(new String[]{userEmail, 'abc@xyz.com'},'Package install successful','Thanks for installing the package. Response result : '+responseResult);
        }
        else
        {
            SendMessage(new String[]{'abc@xyz.com'},'Package failed to install/upgrade','Failed to install/upgraed package. ' + userEmail + ' tried to install/upgraed the package but failed because of failure from MyAPI response. Response result : '+responseResult);
        }
    }
    public static void SendMessage(String[] toAddresses, String subject, String message)
    {
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        mail.setToAddresses(toAddresses);
        mail.setReplyTo('abc@xyz.com');
        mail.setSenderDisplayName('My Package Support');
        mail.setSubject(subject);
        mail.setPlainTextBody(message);
        Messaging.sendEmail(new Messaging.Email[] { mail }); 
    }
  }



 
Hello All,

During the login to our SFDC community portal, we find that there is a param called as cshc. Can you please explain what this is and what is being tracked in this parameter?

I was referring an old thread in the below link
https://developer.salesforce.com/forums/ForumsMain?id=906F000000099dpIAA

but looking for some detailed answer.

CODE from the link above -
<a href="https://logmein.lmisupport.cs3.force.com/portal/secur/frontdoor.jsp?cshc=0000000SmHV00000000elr&portalId=06030000000KLOj&refURL=https%253A%252F%252Flogmein.lmisupport.cs3.force.com%252Fportal%252Fsecur%252Ffrontdoor.jsp&retURL=%252Fportal%252Fapex%252Fportalcasedetail&sid=00DQ00000000elr%2521ARsAQPMRBgvnE_sjnWsrc8aZgq857bO3C84ObcZOp4dOrmnM2CHLBcyfp5ufh64L4XCjMfffMFKQDVo07Ua7JbtgmA1WumAlSDU&untethered="target="_blank">https://logmein.lmisupport.cs3.force.com/portal/secur/frontdoor.jsp?cshc=0000000SmHV00000000elr&portalId=06030000000KLOj&refURL=https%253A%252F%252Flogmein.lmisuppo