• Vivekh88
  • NEWBIE
  • 25 Points
  • Member since 2015
  • Infosys

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

We have a requirement where we have to embed salesforce loghtning component into SPA which is built on React Framework. The data's currently what we are fetching in lightning compoenent is coming from Salesforce and for SPA they are fetching the records from different APIs using microservice.So my question is,

1. Can i do embed a lightning component in SPA(Build on ReactJs)?
2. If i embed what will be the challenges to be faced?
3. It will affect the performance of SPA and Salesforce?

Thanks
Vivekh
Hi,

I have a Input field on a table. When i load the lightning page for the first time the value of input is empty. But when i refresh the page am able to see the value. Am calling the brand in init() only. Still am not able to populate value on first time page load. What is the issue?
 
Component:
<div class="cell brand clickable" onclick="{!c.handleSort}" data-changes-field-name="brand.Name" data-current-field-name="Product_Brand__c">
    <input value="BRAND" readonly="true"/>
        <div class="sort-icon">
	    <aura:if isTrue="{!v.changesSortField == 'brand.Name'}">
		 <lightning:icon iconName="{! v.sortDirection > 0 ? 'utility:arrowdown' : 'utility:arrowup'}" size="xx-small"></lightning:icon>
			 <aura:set attribute="else">
	                      <lightning:icon iconName="utility:sort" size="xx-small" class="inactive">
                              </lightning:icon>
			 </aura:set>
	     </aura:if>
	 </div>
      <div class="click-target"></div>
 </div>
Thanks
Vivek

 
Hi,
when i click an action button on my account detail page it should redirect to a URL and close the action modal page. But the problem is the modal page is still there. Only redirection is happening.

this is my controller code,
({
    myAction : function(component, event, helper) {
        var recordId = component.get("v.recordId");
        var urlEvent = $A.get("e.force:navigateToURL");
        urlEvent.setParams({
            "url": "http://google.com&SalesforceRecordId="+recordId
        });
        urlEvent.fire();
        var dismissActionPanel = $A.get("e.force:closeQuickAction");
        dismissActionPanel.fire();
    }
})

I used 'closequickaction' method to close the modal window. But it is not working. Any idea..?

Thanks in advance..

Regards,
Vivek
Hi,

Need a sample code for Pushing Account record from Salesforce to External System on button click using SOAP serivce.
Thanks in advance..
Thanks
Vivekh
Hi,
Can me remove the drop down list from action button on Opportunity detail page for Lightning? I need to show those remaining buttons which are hidden under drop down. is this possible? 

User-added image

Thanks in advance!

Vivek
Hi,

I am create a new standard report of type 'Account with Account Team Member'. i want to add AccountAccessLevel, CaseAccessLevel, ContactAccessLevel fields in my report. But those fields are not available in reports. Is there any other way to show them?

Thanks
Vivek
Hi,

I have a requirement where i need to push Group members related to Account to Account Team members object. I just need to push the users to Account Team member only once. Its a one time process. Is that possible?

Thanks
Vivekh
Hi,
I need to get a report of all user names and number of times the user ran the conga composer. Any appexchange product is there or we can achieve that using Standard reports?

Thanks
Vivekh
Hi,
I have a requirement where i need to get the total count of Logins done by the particular profile.

Profile                                      Month                       Times Logged in
System Administrator                August 2016              150
Standard User                          August 2016               123


I tried to give this query,
List<Aggregateresult> logquery = [Select count(LoginTime) logintime, userid from LoginHistory where userid =: scope Group by userid];

But this wil execute the total count by Users. But i need it for Profiles. Is there any other workaround to do this?

Thanks
Vivekh
 
Hi,

I have a requirement where i have to populate the number of logins made by the users rowwise and show them in  VF page,

                              Profile     August 2016 Logins      July2016logins           June2016Logins
Vivek                     Admin           15                                   15                           11
Rajesh                   Business       10                                   12                           22

I am using LoginHistory object for querying all data's.
Can the month values be populated rowwise?

Thanks
Vivek
Hi,
We have a requirement where we have to show the total number of accounts created during every month and showing the total number of accounts in same table.

                      No.of records for the month    Total number of Account records
Jan 2016                         10                                        30
Feb 2016                         20                                        50
Mar 2016                         40                                        90

Number of accounts for a month i have implemented, but the total no. of account record is possible?

Thanks
Vivek
Hi,

i want to fire onchange event without going out of input text box and save the values.
Onchange fucntion works whenever i enter a field value and click somewhere outside and then save.
Is there any other event to make this scenario possible?

User-added image

My code:
<b style="vertical-align:inherit">New: </b>
<apex:InputField style="height:70px;width:180px;" value="{!a.acc.Updates__c}" rendered="{!disableInput}" id="updatetext">
          <apex:actionSupport event="onchange" action="{!handleUpdateChange}" reRender="AccDMLTable">
                   <apex:param id="updval" name="updval" value="{!a.acc.ID}" assignTo="{!objSelectedStudentId1}"/>
         </apex:actionSupport>
</apex:inputField>

Thanks
Vivekh
Hi,

I have a requirement where i need to reorder particular rows in VF page whenever user clicks a link on reorder column in VF page.

Delete                  Reorder                Time            Topic
<Checkbox>         <Arrowheads>      <time>         <Topics>

Thanks
Vivek
Hi,

I have a soql query where i am using LIKE operator.
String sql = 'Select Name From Account WHERE Name LIKE \'%' + searchKeyword + '%\'';
Here 'searchKeyword' variable holds values like 'Test 1, Test 2, Test 3, Test 4'.
When i search a Name in my VF page which is a Textbox, like this 'Test 1, Test 4' its not returning the searchKeyword values. Because LIKE operator searches values only in Orderwise. It cant search middle values.

Is there any possible solution where it searches all values that are contained in the textbox?

Thanks
Vivek
Hi
I have a scenario where i am using a Datepicker in VF page. I am actually comparing that datepicker field with StartDate field of Event object in my SOQL query to list out all event records. But i am getting invalid date error as my Date field used in VF page holds only Date value.
VF Page:
<apex:inputText value="{!Startdate}" size="10" id="demo" onfocus="DatePicker.pickDate(false, this , false);" />
i am using <apex:inputText> as <apex: Input type='Datetime'> doesnt support IE.
 
SOQL query used in apex:

String soqlQuery = 'select Id,What.name,who.name,Attachment_Tags__c,StartDateTime,EndDateTime,subject from Event where ((StartDateTime >=: Startdate and EndDateTime <=: Enddate) ' + selectedor + ' (What.name = \'' + searchStr2 + '\') '+ selectedAddition +' (Who.name = \'' + searchStr3 + '\') '+ selectedAttachment +' (Attachment_Tags__c = \'' + searchStr4 + '\'))';

Thanks
Vivek
 
Hi,
I need to put a validation on date field which is available on my Visualforce page. How can i achieve that?
I need to enter the date in this format mm//dd/yyyy. If user enters in anyother format it should throw an error.
User-added image
 
VF page:
               <tr>
                <th>
                <b>Date Range:</b> 
                </th>
                <th> 
                From:
                <apex:input type="date" value="{!Startdate}"/>
                </th>
                </tr>
                <tr>
                <th>
                </th>
                <th>
                To: 
                <apex:input type="date" value="{!Enddate}"/>
                </th>
                </tr>
                <tr>

Thanks
Vivek
 
Hi all,

I created a custom field of data type 'Text area' in Event object which currently holds only 255 characters max. Is there any workaround for increasing more characters for that custom field? 

Thanks
Vivek
Hi everyone,

We have a requirement where we are adding new records to a custom object by a roq dynamically which has a DateTime field and a Duration field. 
for example, 
We have a datetime field as '21/2/2016 03:45 PM' and Duration as '20' then when he clicks add row the next DateTime field should be updated with '21/2/2016 04:05 PM'
This is my method in Apex class and screenshot of the page
 
public void addMoreRows(){  
           AgendaTopics__c AgendaTopic = [SELECT Id,Topic_Owner__c,Time__c,Event_ID__c,Response__c,Issues__c,Estimated_Duration_minutes__c,Topic_Name__c FROM AgendaTopics__c where Event_ID__c =: everec.id LIMIT 1];
           AgendaTopic.Event_ID__c = everec.id;
           AgendaTopic.Time__c = everec.StartDateTime;
          
           if(AgendaTopic.Time__c != null && AgendaTopic.Estimated_Duration_minutes__c != null)
           {
               datetime myDateT = AgendaTopic.Time__c;
               double d = AgendaTopic.Estimated_Duration_minutes__c;
               Integer shootmins = d.intValue();
               AgendaTopic.Time__c = myDateT.addminutes(integer.valueof(shootmins));
           }      
           listAgendaTopic.add(AgendaTopic);
            
        }

User-added image

Thanks
Vivekh
Hi,
I have a custom object topics__c. I need to create a custom field which has lookup to Event/Activities object. Whether that is possible?
Because i cant find Event object when i create a custom lookup field.

Thanks
Vivek
Hi,
I am having a requirement for importing datas through excel for Event object. I have 6 Custom fields,
Time1, Topic1, duration1 and Time2, topic2, duration2.
My excel table will be like this,
Time           Topics     Duration
12/3/2016     text1       60
10/3/2016     text2       45
i have written a class and vf for this scenario,
Apex Class:
public with sharing class ImportTopics
{
public transient Blob contentFile{get;set;}
public String nameFile{get;set;}
private String[] filelines{get;set;}
Public Event Event1{get;set;}
public String currentRecordId {get;set;}
public List<Event> acclist{get;set;}
    public ImportTopics(ApexPages.StandardController controller) {
    filelines = new String[]{};
    acclist = New List<Event>();   
    Event1 = New Event();
    Event1 = (Event)controller.getRecord();
    }
    public void readFile(){
           try{
               nameFile = contentFile.toString(); 
               filelines = nameFile.split('\n');
               for(Integer i=1;i<filelines.size();i++){
                   Event accObj = new Event();
                   string[] csvRecordData = filelines[i].split(',');
                   accObj.Id = Event1.id;
                   accObj.StartDateTime = System.now();
                   String datetimevalue = csvRecordData[0];
                   DateTime dt = DateTime.parse(datetimevalue);
                   String dtConverted = dt.format('yyyy-MM-dd hh:mm:ss');
                   
                   //fields to be updated with first rows of excel
                   accObj.Time_1__c = Datetime.ValueOf(dtConverted);
                   accObj.Proposed_Agenda_Topics1__c = csvRecordData[1];
                   accObj.Estimated_time_1__c = = csvRecordData[2];

                   //fields to be updated with second rows of excel
                   accObj.Time_2__c = Datetime.ValueOf(dtConverted);
                   accObj.Proposed_Agenda_Topics2__c = csvRecordData[1];
                   accObj.Estimated_time_2__c = = csvRecordData[2];
                   
                   
                   acclist.add(accObj); 
                    }
                  
            }
            catch(Exception e){
                ApexPages.Message errormsg = new ApexPages.Message(ApexPages.severity.ERROR,'An error has occured reading the CSV file: '+e.getMessage());
                ApexPages.addMessage(errormsg);
         }
         Upsert acclist;   
      }      
}


VF page:
<apex:page sidebar="false" standardStylesheets="false" standardcontroller="Event" extensions="ImportTopics">
     <apex:form id="theForm">
     <apex:pageBlock >
     <apex:pagemessages />
                 <apex:inputFile value="{!contentFile}" id="theFile" filename="{!nameFile}"/> <br/>
                 <apex:commandButton action="{!ReadFile}" value="Import topics" id="theButton" style="width:95px;"/>
     </apex:pageBlock>
     </apex:form>   
</apex:page>
The problem is it is updating only the first rows with first set of fields. Can anyone help me with this.?

Thanks
Vivekh
Hi,

I have a requirement where i need to reorder particular rows in VF page whenever user clicks a link on reorder column in VF page.

Delete                  Reorder                Time            Topic
<Checkbox>         <Arrowheads>      <time>         <Topics>

Thanks
Vivek
Hi,
when i click an action button on my account detail page it should redirect to a URL and close the action modal page. But the problem is the modal page is still there. Only redirection is happening.

this is my controller code,
({
    myAction : function(component, event, helper) {
        var recordId = component.get("v.recordId");
        var urlEvent = $A.get("e.force:navigateToURL");
        urlEvent.setParams({
            "url": "http://google.com&SalesforceRecordId="+recordId
        });
        urlEvent.fire();
        var dismissActionPanel = $A.get("e.force:closeQuickAction");
        dismissActionPanel.fire();
    }
})

I used 'closequickaction' method to close the modal window. But it is not working. Any idea..?

Thanks in advance..

Regards,
Vivek
Hi,

I am create a new standard report of type 'Account with Account Team Member'. i want to add AccountAccessLevel, CaseAccessLevel, ContactAccessLevel fields in my report. But those fields are not available in reports. Is there any other way to show them?

Thanks
Vivek
Hi,
We have a requirement where we have to show the total number of accounts created during every month and showing the total number of accounts in same table.

                      No.of records for the month    Total number of Account records
Jan 2016                         10                                        30
Feb 2016                         20                                        50
Mar 2016                         40                                        90

Number of accounts for a month i have implemented, but the total no. of account record is possible?

Thanks
Vivek
Hi,

i want to fire onchange event without going out of input text box and save the values.
Onchange fucntion works whenever i enter a field value and click somewhere outside and then save.
Is there any other event to make this scenario possible?

User-added image

My code:
<b style="vertical-align:inherit">New: </b>
<apex:InputField style="height:70px;width:180px;" value="{!a.acc.Updates__c}" rendered="{!disableInput}" id="updatetext">
          <apex:actionSupport event="onchange" action="{!handleUpdateChange}" reRender="AccDMLTable">
                   <apex:param id="updval" name="updval" value="{!a.acc.ID}" assignTo="{!objSelectedStudentId1}"/>
         </apex:actionSupport>
</apex:inputField>

Thanks
Vivekh
Hi,

I have a requirement where i need to reorder particular rows in VF page whenever user clicks a link on reorder column in VF page.

Delete                  Reorder                Time            Topic
<Checkbox>         <Arrowheads>      <time>         <Topics>

Thanks
Vivek
Hi,

I have a soql query where i am using LIKE operator.
String sql = 'Select Name From Account WHERE Name LIKE \'%' + searchKeyword + '%\'';
Here 'searchKeyword' variable holds values like 'Test 1, Test 2, Test 3, Test 4'.
When i search a Name in my VF page which is a Textbox, like this 'Test 1, Test 4' its not returning the searchKeyword values. Because LIKE operator searches values only in Orderwise. It cant search middle values.

Is there any possible solution where it searches all values that are contained in the textbox?

Thanks
Vivek
Hi,
I have a custom object topics__c. I need to create a custom field which has lookup to Event/Activities object. Whether that is possible?
Because i cant find Event object when i create a custom lookup field.

Thanks
Vivek
Hi,
I need to fetch and add some custom field values related to Event object in Event page layout. I have created a VF page and tried to use place holders for blurred text.
<apex:page standardController="Event" cache="true" docType="html-5.0">
<apex:form>
<apex:pageBlock>
<apex:inputTextArea value="{!Event.Minutes__c}" html-placeholder="Customername" style="width: 750px; height: 150px;">
</apex:inputTextArea>
</apex:pageBlock>
</apex:form>
</apex:page>
The problem is i cant add multiple placeholders inside a textbox. i need similar kind of UI to display in my Event Standard page layout.

User-added image

So when the user enter the event record these fields needs to be populated automatically from Event (Assigned to, StratDate, EndDate, etc) and the other custom fields needs to be entered manually within the textbox. All the values needs to be stored in that particular Textbox. Whether this is possible?

Thanks
Vivek
Hi,
I need to insert some records through excel. I have a VF page where i upload the excel file and create records for my custom object. i have a custom field which has Datetime stored. So when i tried to upload the excel with datetime in VF it is going to exception loop. It is not creating records.
This is my class method. 
public void importCSVFile(){
           try{
               csvAsString = csvFileBody.toString();
               csvFileLines = csvAsString.split('\n'); 
               inputvalues = new String[]{};
               for(string st:csvfilelines[0].split(','))
               fieldList.add(st);  
                
               for(Integer i=1;i<csvFileLines.size();i++){
                   AgendaTopics__c accObj = new AgendaTopics__c();
                   string[] csvRecordData = csvFileLines[i].split(',');
                   Datetime dt = Datetime.valueOf(csvRecordData[0]);
                   accObj.Time__c = dt;
                   accObj.Estimated_Duration_minutes__c = Decimal.valueOf(csvRecordData[1]);
                   accObj.Topic_Name__c = csvRecordData[2];    
                   accObj.Owner__c = String.valueOf(csvRecordData[3]);                                                                           
                   acclist.add(accObj);  
               }
}
            catch (Exception e)
            {
                ApexPages.Message errorMessage = new ApexPages.Message(ApexPages.severity.ERROR,'An error has occured while importin data Please make sure input csv file is correct');
                ApexPages.addMessage(errorMessage);
            }

Thanks
Vivek
 
Hi,
I am trying to generate a excel from a VF page with lookup value in it. When i tried to generate the lookup field comes with hyperlink. Any possible workout to remove those hyperlink.
User-added image

this is my VF page coding.
<td class="cellBody" align="center">
       <apex:outputField value="{!ms.Owner__c}" />
</td>

I tried to put OutputText instead of OutputField but i am getting Lookup field ID instead of Name. 

Thanks
Vivek