• Ragula Sivakumar
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 25
    Replies
I am trying to add different report in differnt tabs in lightning app builder but tabs having same reports.

Let say Tab A  adding X report 
Let say Tab B adding Y report after saving the page both tabs having Y report .
Has any one tried ??
 
I could able to upload the file successfully but the input value not passing through the method

​​​​​​​HTML:

<template>
    
    <!--lightning-record-edit-form  object-api-name="Credicard"-->
    <lightning-card icon-name="custom:custom19" title='Credit card information uplaod'>
        <div class="slds-m-around_medium">
                    <div class="slds-grid slds-wrap">
                            <div class="slds-col slds-size_1-of-2">
                    <lightning-layout-item size="6" padding="around-medium"> 
<lightning-input type="number" name="Import Id"  required label="Import Id"  value={impnum} 
        onclick={handlechange} style="width:200px">
            </lightning-input>
            
</lightning-layout-item>
        </div>
        <div class="slds-col slds-size_1-of-2">
                <lightning-layout-item size="6" padding="around-medium"> 
                 <template if:true={Programvalues.data}>
                     <lightning-combobox
                     name="Program"
                     label="Program"
                     value={Programvalue}
                     placeholder="-Select-"
                     options={Programvalues.data.values}
                     onchange={handleselect} style="width:200px"></lightning-combobox>
                 </template>
             </lightning-layout-item>
         </div>
         <div class="slds-col slds-size_1-of-2">
                <lightning-layout-item size="6" padding="around-medium"> 
        
                    <template if:true={AXvalues.data}>
                        <lightning-combobox 
                        name="AXvalue"
                        label="AxPID"
                        value={Avalue}
                        placeholder="-Select-"
                        options={AXvalues.data.values}
                        onchange={handleselect}  style="width:200px" ></lightning-combobox>
                    </template>
                </lightning-layout-item>
                </div>
                <div class="slds-col slds-size_1-of-2">
                        <lightning-layout-item size="6" padding="around-medium"> 
                                <lightning-input type="number" name="Exchange Rate"  required label="Exchange Rate"  value={inpputnum} 
                                onclick={handlechange1} style="width:200px" >
                  </lightning-input>
                  
                
                        </lightning-layout-item>
                        </div>
                    </div>
                </div>
                                
                        
                        <lightning-file-upload
                        name="Import Data"
                                label="Import Data"
                        
                                accept={acceptedFormats}
                        
                                record-id={recordId}
                        
                                onuploadfinished={handleUploadFinished} ></lightning-file-upload>
                        
                        
                        
                        <template if:true ={success} >
                        
                                
                        <c-error-panel errors={success}></c-error-panel>
                        
                        </template>
                        
                        <template if:true={failure}>
                        
                        <c-error-panel errors={failure}></c-error-panel>
                        
                        </template>
                    
                        
                    
                    
        
                </lightning-card>
            </template>
          
        
    JS:
import { LightningElement ,wire,track,api} from 'lwc';
import { getPicklistValues } from 'lightning/uiObjectInfoApi';
import { getObjectInfo } from 'lightning/uiObjectInfoApi';
import CREDITCARD_OBJECT from '@salesforce/schema/Credit_card__c';
import PROGRAMM_Field from '@salesforce/schema/Credit_card__c.Choose_Program_Reason__c';
import AXPID_Field from '@salesforce/schema/Credit_card__c.AX_PID__c';
//import EXCHANERATE_FIELD from '@salesforce/schema/Credit_card__c.Exchange_Rate__c';
//import IMPORT_FIELD from '@salesforce/schema/Credit_card__c.ImportId__c';
import {ShowToastEvent} from 'lightning/platformShowToastEvent';
import insertdata from '@salesforce/apex/importdata.readCSVFileInsertMember';
//const columns = [
    //{ label: 'CampaignId', fieldName: 'CampaignId' }, 
   // { label: 'ContactId', fieldName: 'ContactId' },
  //  { label: 'Status', fieldName: 'Status'}
//];
export default class Uploadfilewithinput extends LightningElement {
    //Credicard=CREDITCARD_OBJECT;
  //  ExchaneRate=EXCHANERATE_FIELD;
   // ImpotId=IMPORT_FIELD;
    @api impnum ="";
    inpputnum="";
    Programvalue="";
    Avalue="";
    @track success;
    @track failure;
    @api recordId;
   // @track data;
   // @track columns =columns;
handlechange(event){
 this.impnum=event.target.value;
}
handlechange1(event){
this.inpputnum=event.target.value;
}
   @wire(getObjectInfo, { objectApiName: CREDITCARD_OBJECT })
   objectInfo; 
   @wire(getPicklistValues, { recordTypeId: '012000000000000AAA', fieldApiName:PROGRAMM_Field})
    Programvalues;
      @wire(getPicklistValues, { recordTypeId: '012000000000000AAA', fieldApiName: AXPID_Field})
      AXvalues;
    @wire(insertdata , { impnum: '$impnum'})
    deWired;
      //inpputnum: '$inpputnum',Programvalue: '$Programvalue',Avalue: '$Avalue'
  
    handleselect(event){
      
       if(event.target.name ==='Program'){
          this.Programvalue=event.target.value;
     }
       if(event.target.name === 'AXvalue'){
           this.Avalue=event.target.value;
        }
}
get acceptedFormats() {
    return ['.csv'];
}
handleUploadFinished(event) {
    const uploadedFiles = event.detail.files;
   insertdata({idContentDocument : uploadedFiles[0].documentId}) 
    .then(result => {
      this.success = result;  
     this.dispatchEvent(
        new ShowToastEvent({
           title: 'Success!!',
            message: 'Campaign Members are created based CSV file!!!',
    variant: 'success',
        }),
    );
    })
    .catch(error => {
        this.failure=error;
        this.dispatchEvent(
            new ShowToastEvent({
              title: 'Error!!',
                message: JSON.stringify(error),
                variant: 'error',
            }),
        );     
   });
    
}
}

Contoller:
public class importdata{
    
    @AuraEnabled 
    public static List<Campaignmember> readCSVFileInsertMember(Id idContentDocument,string impnum ){
    
     
    List<Campaignmember> lstCampaignMembers = new List<Campaignmember>();
        if(idContentDocument != null) {
            ContentVersion objVersion = [Select Id,VersionData FROM ContentVersion WHERE ContentDocumentId =: idContentDocument][0];
            
            if(objVersion != null) {
            
            Blob csvFileBody =objVersion.VersionData;
               String csvAsString = csvFileBody.toString();
          
                String[] csvFileLines = csvAsString.split('\n'); 
                
                
                
                for(Integer i=1;i<csvFileLines.size();i++){
               
                    Campaignmember  camobj = new Campaignmember() ;
                    string[] csvRecordData = csvFileLines[i].split(',');
                    camobj.CampaignId= csvRecordData[0] ;             
                    camobj.ContactId= csvRecordData[1];
                    camobj.Status= csvRecordData[2];
                    camobj.impnum__c=impnum;
                                                                                               
                    lstCampaignMembers.add(camobj );   
                }
            
                if(!lstCampaignMembers.isEmpty()) {
                    insert lstCampaignMembers;
                }
                }
                }
        
        return lstCampaignMembers;
       
        }
   }





 
Hi All,
I have a requirement to input some values for the fields and then select one file as CSV/Excel .
Once you select and in upload file the records should created along with the input values in the fields.
Can you help me how to achieve this .
I tried below but initial level i am getting error
I am trying to import 4k records using data loader. I want to maintain a one unique id  for all  4k records The unique id should be generate automatically in the salesforce..
Will it possible?..
We are using the lead conversion process and using process builder to move child records to contact. we have additional thing while converting we are also creating custom lead record along with contact and account on custom lead records but the standard lead related list moving to contact but not to custom lead .
We want to achieve this .What is the best way to update the related list record when custom lead created.
Hi All,

I am new to developing and give me some insights how to upload csv file using LWC .

Regard,
Siva 

I have cretaed a batch class based on some condition lead records are deleted and scdule using scheduled method using developer cosole.
Do we need to write test  class for both implement class and schedule class?



 
We are using survey monkey to capture Prospect  based on survey . Once they completed the survey the Prospects along with survey responses will capture in sales cloud.
we will like to import only  if the question answer is yes then corresponding prospects will  transferred to CRM.
Somehow i have tried with this code and i tired also using bulk upload and its is working without any error.

Can someone let me know if i need to modify anything ?.




trigger deletesurvey1 on Survey_response__c (After insert) {
if(Trigger.isAfter){ 
//if (Trigger.isDelete){ 
Survey_response__c[] AllChildRecords = [Select id, Lead__c From Survey_response__c Where Survey_Question__c=:Label.Question and  Response__c=:Label.Response];
       List<id>leadlist= New List<id>();
       
       if(AllChildRecords.size()>0){
       for(Survey_response__c rec : AllChildRecords){
        leadlist.add(rec.Lead__c);
          }  
          } 
          
          List<Survey_response__c>surveyres= New List<Survey_response__c>();
         for(Survey_response__c rec1 : [select id  from Survey_response__c where Lead__c IN:leadlist]){
           surveyres.add(rec1);
           
}
          
        delete surveyres;
        delete   [select id from Lead where id IN :leadlist]
I am trying to add different report in differnt tabs in lightning app builder but tabs having same reports.

Let say Tab A  adding X report 
Let say Tab B adding Y report after saving the page both tabs having Y report .
Has any one tried ??
 
Hi All,
I have a requirement to input some values for the fields and then select one file as CSV/Excel .
Once you select and in upload file the records should created along with the input values in the fields.
Can you help me how to achieve this .
I tried below but initial level i am getting error
I am trying to import 4k records using data loader. I want to maintain a one unique id  for all  4k records The unique id should be generate automatically in the salesforce..
Will it possible?..
Hi All,

I am new to developing and give me some insights how to upload csv file using LWC .

Regard,
Siva 
Hi Everyone,

Could anyone explain me that how to make Http callouts in batch class with example.

Note:Need to call the batch class from apex trigger
Hello Guys,

I need to capture email reply in Salesforce. For example let's take a scenario I have sent an email to one contact from send an email button from the custom object activity history related list. As soon as I send the mail, Contact will receive mail in his outlook or mailbox . If the contact try to reply over the mail from outlook or gmail then will Salesforce capture this reply automatically? If not how can I achieve this and capture automatically reply ? Please suggest. Thanks.

Regards,
Rajiv
  • January 27, 2016
  • Like
  • 0
hello

I have a requirement to integrate salesforce with google adwords. so that we can create ,run and stop a campaign through salesforce. i just need a bit of help to start with code. we can integrate it with SOAP API. has anyone done it before?

Thanks in advance
Shailesh 
Hi,

I would like to access the Google Adwords API from Visual Force/Apex. Is it possible? If so how?

Thanks!