• mukesh gupta
  • SMARTIE
  • 735 Points
  • Member since 2015
  • 4X Salesforce Certified

  • Chatter
    Feed
  • 19
    Best Answers
  • 2
    Likes Received
  • 1
    Likes Given
  • 102
    Questions
  • 174
    Replies
Hi All,

I am new to lightning and trying use file upload lightning components. 

I used exact same code which is mentioned in salesforce website
https://developer.salesforce.com/docs/component-library/bundle/lightning:fileUpload/example
just replaced recordid to my account id

But it is not working.

Please help me on this

Thanks in Advance
Hi all,

I have a custom object called "CO" and having a field called "User".
I am able to get Account ID now, but I would like to get Account Name insted.
Would someone let me know if there is a way to get Account Name from CO?

=================================
CO (CO__c)
----
Id
User (User__c) -> Contact
                            ---------
                            Id
                            Company  (Account) -> Account
                                                               ---------
                                                               Id
                                                               Name
=================================

"User"       : Lookup(Contact)
"Company": Lookup (Account)

This is what I have now.
select User__r.AccountId from CO__c where Id = 'xxxxxxx';

Thank you,
HG
  • July 10, 2018
  • Like
  • 0
Can anyone help me on getting  below data , some sample endpoint URL and response as XML.
New to Integration, learning how the parse  json and xml from response. I have one url for json( https://api.androidhive.info/contacts/) but not for xml.

Thanks in Advance.....

HttpRequest req=new HttpRequest();
req.setendpoint(' ? ');
req.setmethod('GET');
http req1=new http();
httpResponse xmlresponse=req1.send(req);

 
Hello,

I am having trouble completing a module, specifically, the second hands-on challenge. In the challenge you are asked to modify the Opportunity Pipeline report and create a Key Accounts report with a probability greater than 30%. When I go to check the challenge I am told that the report does not show records with a probability greater than 30%. I have checked the report multiple times along with recreating the report in another trailhead playground.
Has anyone experienced this problem?Trailhead Module Key Account Challenge
Dears,

Can Anyone give me a good solution !!

Example:- 

Person A and Person B Working in Same company , Person A Will not continue his job hereafter. Suddenly he leaves his job without give any information. So Person B need to handle him record as well. How it's Possible ???

1. Person A Using Different Profile .

2. Person A Records OWD is Private.

3. How person B can access that records ???


Thanks In Advance !

Regards,
Soundar P
Hi All,

Am very new to API.In my salesforce org, somebody implemented the API. I don't know whether its REST/SOAP.

Now I want to do some changes in that. Kindly let me know, where I to find the respective API details in my Org.

 

From VF Page:
<div style="float: left; width: 20%;">

<apex:outputField value="{!d.Company__c}" />

</div>

In the controller, if the Company__c is null, I want to set its value to '<div class="spacer" />' so that the div tag is rendered correctly on the page.  My output at the moment is literally <div class="spacer" />.

The goal is to have 5 static columns on the page but if one of the custom fields for the custom object is null, I just want a placeholder there in the HTML so that everything continues to line up correctly.

Hi,

How to access apex class method form process builder, I want to access apex class function by process builder but ,i am not able to access my class function.

Please suggest.

Thanks
Deepak 
Hi,

I am not aware about omni channel and where it's used.  Can you please benefit of this.


Thanks
Romash
Hi everybody,
I'm trying to render a VF Page which contains JavaScript to Generate a QR Code like so:
VF Page:
User-added image
But PDF after the renderAs is all messed up:
User-added image
Anyone knows how to render Javascript to PDF?
Hi

We have a visualforce section on all of our Opportortunity page layouts.
This section shows a particular image depending on what has been selected within the stage field.
Below is a sample of the code that we have in place.
Is it possible to split it up so that depending on which Opportunity Record Type is selected different images can be displayed against each stage?

For example if record type = X and the stage is Closed Won then show image A
If record type = Y and the Stage is closed Won then show image B

Thank you
 
<apex:page standardController="Opportunity" showHeader="true" sidebar="true">

<div align="center">

></apex:image> <apex:image id="won" value="{!$Resource.stageWon}" height="60" rendered="{!Opportunity.stageName = 'Closed Won'}"

 ></apex:image> <apex:image id="lost" value="{!$Resource.stageLost}" height="60" rendered="{!Opportunity.stageName = 'Closed Lost'}" 

</div>

</apex:page>

 
Hello,

I have following error:
System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out

My usecase:
I am calling a webservice in a future handler. 

Other workaround i tried:
I tried to call the webservice without a future handler, but as i am calling in trigger it is giving me error.

Can someone please tell me any workaroud ?

thank you
Hi all,

I'm using VisualForce for an intake survey. The first part of it is relatively easy. This is the code for First Name.

<apex:inputfield value="{!Contact.FirstName}" />

However, I can't find any guidance on how to ask a yes or no question in the intake. I would want to limit it to yes or no. Not allow anything else like "working on it" or "almost."

Anyone know of a possible answer?
Hi Expert,

I have a account with oppertunities. now  i want to add GrossTotal custom field in Account and all opertunity Amount will be add in Gross total.

Please suggest.

Regards
Romesh
  


 
Hello Friends,
I am new to visualforce development,
I want to create a visualforce form in which i want a picklist field and values for picklist will be : DOC, RAR, ZIP
and a TextArea Field in which we can give comment or description
and a Save Button which will save all data of the form to the Activity Object Inside Salesforce
I have picklist field 'Filetype' with values DOC, RAR, ZIP and a TextArea Field 'Description' on Activity Object

and please do not provide any link or reference, if possible, then help me with an example,

Any help would be greatly appreciated
Thanks in Advance
Hi Expert,

In one class i have two soql:-
Example:- 
public class test(){

     List<Account> acc = [select id, name from Account Limit 40000];
     List<Contact> con = [seldect id, email from Contact Limit 15000];
}

//above queries will return limit excede error or not 

 
Hi Expert,

I want to reopen a case when any email comes from user. what i implemented:-

I creaed a workflow that execute on when agent close a case with email template taht's have a case thread id. but when customer reply this email then related case shouuld be reopen and this mail should be add in Email related list on that case.

Please suggest.

Regards
Mukesh​



  





 
Hi Expert,

How would sharing rule work in the below scenario

Suppose i create a new object called "XXXX". Now profile called "AAAA" doesn't have read, create, edit permission on it.

Q1: What would happen if I create a record of object "XXX" and share it with user which has profile "AAAA" and give him "Edit" permission on the record? Would user be able to see the record or edit the record? please qualify your answer.

Q2: Can anybody explain in what order access on record or object is granted in terms of OWD, Sharing rule, Role and profile?

Q3: If i set OWD setting as Public Read/Edit on Object "XXXX" but profile "AAAA" don't have read, create and edit permission on Object "XXXX" then the user who owns profile "AAAA" would be able to see and edit the records of object "XXXX"?

Q4: What would happen if profile "AAAA" has only Read permission on Object "XXXX" then user who owns profile "AAAA" would be able to see and edit ALL the records of object "XXXX"?

Q5: In order to work out OWD setting, at least profile must have Read permission on that particular object?

Q6: The user who is higher role in hierarchy would get owner permission on the records created by user who are lower in the roles means he can edit and delete the record as well. Is that correct?

Please share your best 

Regards
Mukesh
Hi Expert,

I have added a inline visualforce page on case page layout. Now i am able to upload files perfectlry, but now i want to add loader or spiner on file upload time. I add a spiner in visualforce page but when uploading compleatd. then this move on case Tab with files list not on same page. 
 
<apex:page standardController="Case" extensions="UploadFileController" >
<apex:form >
<style type="text/css">
.bPageBlock .detailList .dataCol {
    width: 100%;
}

.bPageBlock .detailList .dataCol {
    width: 107%;
}


dataCol.first {
    text-align: center;
    }

  .detailList td.dataCol.first.last:nth-child(1) {
    text-align: right;
    width: 50%;
}
.inner-tab {
    padding: 20px 0px;
}
  </style>
  
 
 <apex:pageMessages />
 
 <apex:actionStatus id="pageStatus">
    <apex:facet name="start">
        <apex:outputPanel >
           <img src="/img/loading32.gif" width="50" height="50" />
           
            <apex:outputLabel value="Loading..." />
        </apex:outputPanel>            
    </apex:facet>
    
    <apex:facet name="stop">
         
    
    </apex:facet>
    
</apex:actionStatus>
 
<apex:pageBlock >




<apex:pageBlockSection id="sec1" rendered="{!sec1}"> 
    <apex:commandButton id="btnUpload"  action="{!Upload}" value="Upload File"  />
   
    <br/>
     <br/>
    <apex:pageBlock title="File Links" id="rerenderId">
    
      <apex:pageBlockTable value="{!listOfFiles}" var="fl" width="100%">
           <apex:column headerValue="URL" width="50%"><apex:outputLink target="_blank" value="{!fl.URL__c}">{!fl.Url}</apex:outputLink></apex:column>
           <apex:column headerValue="Created Date" width="20%" value="{!fl.createdDate}"></apex:column> 
      </apex:pageBlockTable>
    </apex:pageBlock>
  
    
</apex:pageBlockSection>


<div class="inner-tab">
<apex:pageBlockSection id="sec2" rendered="{!sec2}">
 <apex:inputFile value="{!AttchBody}" fileName="{!AttchName}" fileSize="{!AttachSize}"/>
 
 <apex:commandButton id="btnSubmit"  action="{!SubmitAttachment}" value="Submit Attachment"/>
</apex:pageBlockSection>
 </div>


</apex:pageBlock>





</apex:form>
 
  
</apex:page>

  
public with sharing class UploadFileController {

    Public Id RecordId {get;set;}
    public Blob AttchBody {get;set;}
    public String AttchDesc {get;set;}
    public String AttchName {get;set;}
    Public Integer AttachSize {get;set;}
    Public Attachment attch {get;set;}
    public boolean attachmentBtn {get; set;}
    public boolean sec1 {get;set;}
    public boolean sec2 {get;set;} 
    public External_File_Relationship__c fileDB; 
    public External_File__c ef;
    public List<String> fileList {get;set;} 
    public String parentId; 
    Public List<External_File__c>listOfFiles {get;set;}
     
  
     public UploadFileController(ApexPages.StandardController controller) {
        parentId = ((case)controller.getRecord()).id;
        sec1 = true;
        sec2 = false;
        
        RecordId = ApexPages.CurrentPage().getParameters().get('Id');
        init();

    }
    
    
    public PageReference SubmitAttachment(){
    
      if(AttchName != '' && AttchBody != NUll ){
      
      //file that is 25Mb or less
      if(AttachSize <= 25000000 ){
          External__c  extFile = new External__c();
          extFile.Name =  AttchName;
          extFile.CaseId__c = RecordId;
          
          Insert extFile ;
          attch = new Attachment(ParentId=extFile.id,Description=AttchDesc,Name=AttchName,Body=AttchBody);
       
         try{
                insert attch;
                
                system.debug('attch  '+attch);
                AttchBody = null;
                AttchDesc = null;
                AttchName = null;
               
            }
            catch(DMLException ex){
                    ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Error uploading attachment'));
                    return null;
             
            }
            
            
            ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Attachment uploaded successfully'));
            
            string Attid= attch.id;
            string attachmentid=Attid.substring(0,15);
            String sfdcBaseURL = URL.getSalesforceBaseUrl().toExternalForm();
            extFile.File_Public_URL__c = sfdcBaseURL+'/servlet/servlet.FileDownload?file='+attachmentid;
            update extFile;
            sec2 = false;
            sec1 = true;
            init();
          
      }
      
      }else{
      
          ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR, AttchName +' is too large - please choose a file that is 25Mb or less'));
      
      }
        return null;
          
      }
      
      public void init(){
           List<External_File__c> lst = [Select URL__c, CreatedDate  from  External__c where CaseId__c =: RecordId];
           listOfFiles  = lst;
      }
      
     public PageReference Upload() {
       sec1 = false;
       sec2 = true;
       
       return null;
         
    
    }

}

when i add spinner or Loding then, this move to case tab with inline visualforce page.


Please suggest, what i am doing wrong

Regards
Mukesh
 
Hi Expert,

I am using below code in my lightning componant but facing error "Jquery_File/jquery-3.3.1.min.js 404 (Not Found)" in browser console.

here "Jquery_File" is static resources name and 
 <ltng:require scripts="{!$Resource.Jquery_File + '/jquery-3.3.1.min'}" />

https://testnewdomian-dev-ed.livepreview.salesforce-communities.com/sfsites/c/resource/1535093740000/Jquery_File/jquery-3.3.1.min.js 404 (Not Found)

Thanks
Mukesh

 
Hi Expert,

I want to create  New Event  on Calander object from community user. But When i click on calander date then popbox show message :-

"Looks like there's a problem.
Oops...you don't have the necessary privileges to create this record. See your administrator for help."

User-added image

Please suggest

Regards
Mukesh
Hi Expert,

I am using customer service template, when i move builder and component anf try to search "Case Comments Publisher"  component in component list, but not able to find.

 User-added image

Please help


Regards
​Mukesh
Hi Expert,

I want to create a report and dashboad that's have filter   case escalation, SLAs, and Key Peformance Indicators.

but i am not able to justify SLAs, and Key Peformance Indicators on caes report and dashboad, 

what field that's using for SLAs, and Key Peformance Indicators on case report,

Please confirm.

Thanks

 
Hi,

I am implementing Open CTI Lightning Demo Adapter in salesforce by reference of https://developer.salesforce.com/page/Lightning_Open_CTI

and installed from :- https://login.salesforce.com/packaging/installPackage.apexp?p0=04t41000000bSXh

but facing error 

User-added image

Thanks
Mukesh


 
Hi,

I want to show reports on dashboard for communtiy users, report is currect fetaching related user data but dashboard showing All reports  

User-added image

User-added image



Please suggest
Hi Expert,

I want no convert this custom button into Lightning. Please suggest

User-added image 
Thanks
Mukesh
Hi, 

I am using window.load() in visualforce page, but in lightning readiness report , window.load() does not support in Lightning. Message is  below:- 

"JavaScript included in this page uses window. methods. Included JavaScript uses window. methods for navigation, which are not supported in Lightning Experience."

Can you please suggest , what substitute i can use instead of window.load() for Lightning;

Thanks
Mukesh
 
Hi Expert

I want to update Lead object field by child object of Lead, but i am not able to get relation.

Please suggesy
I am creating Lightning componant. but not able to save this componant.

User-added image

Thanks
Mukesh
Hi Expert,

I am using partner portal in salesforce. but i want to define the roles.  sothat 

1. CEO   --- see all manager records
2. Manager --- see all gm records
3. GM--- see self records

Please  suggest abuot this because partner have a seprate roles.

Thanks
 



 
Hi Expert,

I need to create a Label type field on opportunity page layout:
As per below image i need "Security 4" Label in stanard page layout.

 User-added image

Please confirm

Regard
Mukesh
Hello sir,


I have approx 56,000 members in subscriber list in campaign monitor and I want to send an email to all subscriber automatically.  Is there a way in campaign monitor to send email 300 member per day automatically?

means 300 member get email today and next 300 member will get email tomorrow and so on..



thanks.
Hi Epxert,

I have create a third party(.net) login page with username and password. user can login in salesforce by .net login page to salesforce by Existing user name and password. But i am not able to match password by SOQL in salesforce.

Please suggest.

Thanks
Mukesh 
hi Expert,

When i create a Notes in oppertunity then this notes will Rollup in Account object. but when i use same process in Enterprise edition then Oppertunity Related list notes not Rollup in Account object.

Can you please suggest about this process.

Thanks
Mukesh
Hi exprt, 

I have two datetime field d1(10/12/2017 : 10:40 pm)  and d2(10/12/2017 : 11:40 pm)  now i want to get 2 hours, so i am using business hours formula,
5day in week and 8 hours per day but get only 0.00 by use below formula

ROUND( 8 * ( ( 5 * FLOOR( ( DATEVALUE( First_Activity_Date_Time__c) - DATE( 1900, 1, 8) ) / 7) + MIN(5, MOD( DATEVALUE( First_Activity_Date_Time__c ) - DATE( 1900, 1, 8), 7) + MIN( 1, 24 / 8 * ( MOD( First_Activity_Date_Time__c - DATETIMEVALUE( '1900-01-08 16:00:00' ), 1 ) ) ) ) ) - ( 5 * FLOOR( ( DATEVALUE( Last_Assignment_Date__c ) - DATE( 1900, 1, 8) ) / 7) + MIN( 5, MOD( DATEVALUE( Last_Assignment_Date__c ) - DATE( 1996, 1, 1), 7 ) + MIN( 1, 24 / 8 * ( MOD( Last_Assignment_Date__c - DATETIMEVALUE( '1900-01-08 16:00:00' ), 1) ) ) ) ) ), 0 )
Hi Expert,

I want to create some demo on marketing cloud  journey builder. Can any one share about how to acces journey builder in markeing cloud.

Thanks
Mukesh
Hi Expert,

I need to create an application for me to send SMS directly from Salesforce. Please suggest.

User-added image
Hi Expert,

I am using a test class for coverage 75% code, but few things are not covered. Can any one suggest what is going wrong.

this my test Class: --
@isTest
public class TestProfessorSelectCourse {
    @isTest static void ProfessorCourse(){
       
        
        Professor__c prof = new Professor__c(Name ='JP',Email__c='jp@gmail.com');
        insert prof;
        
        Class__c cls = new Class__c(name='12G', Class_Teacher__c = prof.id);
        insert cls;
        
        Course__c cors = new Course__c(Professor__c=prof.id,Class__c =cls.id, name='Ruby', Start_Date__c= Date.today() , End_date__c= Date.newInstance(2017,03,20));
       	//Professor__c prof = new Professor__c(Name ='JP');
        //cors.Professor__c = prof.Name;
        insert cors;
    }
}

and below is my main class


User-added image

Thanks 
Mukesh
Hi Expert,

I want to reopen a case when any email comes from user. what i implemented:-

I creaed a workflow that execute on when agent close a case with email template taht's have a case thread id. but when customer reply this email then related case shouuld be reopen and this mail should be add in Email related list on that case.

Please suggest.

Regards
Mukesh​



  





 
Hi Expert,

I am using customer service template, when i move builder and component anf try to search "Case Comments Publisher"  component in component list, but not able to find.

 User-added image

Please help


Regards
​Mukesh

User-added image

I don't see "Send Email" action type on Objects except Case. What I need to do to get that "Send Email" action type for other objects.

I'm trying to add a Quick action button 'New Account' next to the Follow button in the the lightning console (see below), but I'm struggling to find any helpful documentation on this.

User-added image
Hi Guys,

How can we show lightning component in List View ?
is there any way ?

Thanks,.
Raghvendra
Hello,
Data not displaying in vf page for the below code .
 public String caseId{get;set;}
*--------Controller--------------*
             public  List<Case> casListId{get; set;}
                  
             public void getDetails()
             {
              //String caseId= System.currentPageReference().getParameters().get('row_id');
                     casListId=new List<Case>();
                     System.debug('Case ID'+caseId);                    
                     casListId=[Select id,CaseNumber from Case where Id ='5007F00000K8gwH'];
                     System.debug('casListId'+casListId);
                  //   return null;
             }
           *----------Vf Page---------*  
<apex:form >
           <apex:pageBlock >
              <table class="Table">
               
                     <apex:repeat value="{!casListId}" var="a" >
                        <tr>
                       <td> <apex:outputText value="{!a.CaseNumber}"/></td>  
                        </tr>
                     </apex:repeat>
               </table>      
             </apex:pageBlock>        
           </apex:form>
I'm trying to override View action of a Standard Object (Opportunity in this case) with a Visualforce page. My override works on both Classic and Lightning theme. However, on lightning pages, my Visualforce page changes the original page's layout.

My Visualforce Page:
<apex:page standardController="Opportunity" lightningStylesheets="true">
<apex:detail subject="{!Opportunity.Id}" relatedList="true" title="true" rendered="true" />
</apex:page>

It works perfectly on the Classic theme, but here is how it looks on Lightning compared to the original Opportunity page without override:
User-added image

How do I achieve the functionality of creating a generic Visualforce page to load both classic pages and lightning pages?
And if it's not possible, what are the alternatives to achieve it?
Hello All,

I have tried to redirect to another lightning page when clicking on the button but I have encountered the below error.
This page has an error. You might just need to refresh it.
Action failed: c:L_Redirect_to_Otherpage$controller$handleClick [Cannot read property 'setParams' of undefined]
Failing descriptor: {c:L_Redirect_to_Otherpage$controller$handleClick}

Snippet below.

Component:
 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
	
    <aura:attribute name="url" type="String" />
    
    <p><a onclick="{!c.handleClick}">link to record</a></p>

</aura:component>

JS Controller:
 
({
    handleClick: function (component, event, helper) {
        var navEvt = $A.get("e.force:navigateToSObject");
        navEvt.setParams({
            "url": "http:www.google.com"
        });
        navEvt.fire();
    }
})

Please help me where I did a mistake.

Regards,
VSK98

 
  • July 12, 2018
  • Like
  • 0
I have a custom date field called Last_Awarded_Date__c on the Accounts object. In the related list of the Accounts object is a custom Opportunities object with an Award_Date__c (date) field and an Awardee_PP_Score__c (number) field. I'm trying to have the Last_Awarded_Date__c field in the Accounts object automatically updated with the date of the most recent Award_Date__c with an Awardee_PP_Score__c from the custom Opportunites object in the related list.  (See images below).

Accounts Object 
User-added image

Related List - 7/10/2018 should be the date in the Last_Award_Date__c field in the Accounts object
User-added image


This is my trigger I have write to add a specific account ID to a Contact. I am new to salesforce programming and I try to write the unit test but I need some help to do it.
trigger Contacts_Accounts on Contact (Before Insert, Before Update) {

for (Contact newContact : Trigger.New){
        String id_account;
        id_account = [select id from Account where idClientSoquij__c = :newContact.idClientSoquij__c].id;
        newContact.AccountId = id_account;
        }
}

 
Hi All,

I need help with some code as im new to apex and salesforce.

I need to be able to have it so any file added to the service appointment will copy into the parent record (Work order) 

Any help would be really appreciated. 

Thank you! 
Hi, Could you please share the link from where i can make the registration for Salesforce Marketing Cloud Users ? and from where i get the Client id and secret. I want to the your API


Thanks
I need to allow the user to update their username in the portal. What permissions will the profile need in order to allow this change to occur?

At the moment I am getting a insufficient_access_on_cross_reference_entity error. In a trigger handler I am running the following code.

private void processUpdatedUserFields() {

        Id loggedUserId = UserInfo.getUserId();
        User currentUser = [SELECT Id, Name, Email FROM User WHERE Id =: loggedUserId];
        for (User newUser : (List<User>) Trigger.new) {
            User oldUser = (User) Trigger.oldMap.get(newUser.Id);
            if (loggedUserId == newUser.Id && newUser.Email != oldUser.Email) {
                system.debug(logginglevel.error, 'isUpdateable::: ' + Schema.sObjectType.User.fields.Username.isUpdateable());
                newUser.Username = newUser.Email;
            }
        }
        
    }

This is running beforeUpdate and used to run successfully.

Thank you.
Hi All,

We have a Lightning:InputField of date type. It's accepting dummy text like 'asdf' and saving as null to database. 

How can I prevent user to enter dummy text rather than a proper date?
Hi-
In the Lightning experience I am struggling with the functionality of Notes & Attachment object. When I click the dropdown on the Notes & Attachments icon I can "Upload File". But what I really want to do it "Attach a File", which is the functionality from the Classic experience.

This matters because I need to havd "Attachments" not "Files" to load into Docusign. I want to have this functionality in the Lightning interface without going to Classic.

Any ideas?

Thanks all!