-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
12Questions
-
26Replies
Can we display the fields based on record type in using LWC component.
I want to display few fileds based on record type using lWC.
I have two record type A,B .
I want to display the field 3 if the record type is B and also display the field 6 using if the record type is A.
<template> <lightning-card icon-name="standard:investment_account" variant="narrow" title="eDM Tactic" > <lightning-record-view-form record-id={recordId} object-api-name="Campaign"> <div class="slds-grid slds-wrap"> <div class="slds-col slds-size_1-of-2"> <div class="slds-p-around_medium"> <lightning-output-field field-name="field1" class="slds-m-right_x-small"></lightning-output-field> <lightning-output-field field-name="field2"></lightning-output-field> <lightning-output-field field-name="field3"></lightning-output-field> </div> </div> <div class="slds-col slds-size_1-of-2"> <div class="slds-p-around_medium"> <lightning-output-field field-name="field4" class="slds-m-right_x-small"></lightning-output-field> <lightning-output-field field-name="field5"></lightning-output-field> <lightning-output-field field-name="field6"></lightning-output-field> </div> </div> </div> </lightning-record-view-form> </lightning-card> </template>
- Ragula Sivakumar
- November 13, 2020
- Like
- 0
- Continue reading or reply
Use Custom Setting over bulk record creation
I have cretaed one list custom setting with list od=f text values .
I want to use the the custom setting to create a bulk records in another object
custom_setting__c customsetting=custom_setting__c.getValues('record');
List<object__C>objlist= new list <object__C>();
for(integer i=0;i<200;i++){
object__C led = new Lead__c(name='Test);
objlist.add(led);
}
insert objlist;
I want to use the the custom setting to create a bulk records in another object
custom_setting__c customsetting=custom_setting__c.getValues('record');
List<object__C>objlist= new list <object__C>();
for(integer i=0;i<200;i++){
object__C led = new Lead__c(name='Test);
objlist.add(led);
}
insert objlist;
- Ragula Sivakumar
- October 15, 2020
- Like
- 0
- Continue reading or reply
Not able to add different reports in tabs in Lightning app builder
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 ??
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 ??
- Ragula Sivakumar
- May 26, 2020
- Like
- 0
- Continue reading or reply
- Ragula Sivakumar
- December 18, 2019
- Like
- 0
- Continue reading or reply
passing the input values into Apex controller In LWC
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;
}
}
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;
}
}
- Ragula Sivakumar
- December 16, 2019
- Like
- 0
- Continue reading or reply
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 .
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 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
- Ragula Sivakumar
- November 27, 2019
- Like
- 0
- Continue reading or reply
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?..
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?..
Will it possible?..
- Ragula Sivakumar
- October 10, 2019
- Like
- 0
- Continue reading or reply
leadCoversion
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.
We want to achieve this .What is the best way to update the related list record when custom lead created.
- Ragula Sivakumar
- September 19, 2019
- Like
- 0
- Continue reading or reply
CSV file to read using lWC
Hi All,
I am new to developing and give me some insights how to upload csv file using LWC .
Regard,
Siva
I am new to developing and give me some insights how to upload csv file using LWC .
Regard,
Siva
- Ragula Sivakumar
- September 06, 2019
- Like
- 0
- Continue reading or reply
Regarding Test Class
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?
- Ragula Sivakumar
- August 16, 2019
- Like
- 0
- Continue reading or reply
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 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]
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]
- Ragula Sivakumar
- August 06, 2019
- Like
- 0
- Continue reading or reply
Can we display the fields based on record type in using LWC component.
I want to display few fileds based on record type using lWC.
I have two record type A,B .
I want to display the field 3 if the record type is B and also display the field 6 using if the record type is A.
<template> <lightning-card icon-name="standard:investment_account" variant="narrow" title="eDM Tactic" > <lightning-record-view-form record-id={recordId} object-api-name="Campaign"> <div class="slds-grid slds-wrap"> <div class="slds-col slds-size_1-of-2"> <div class="slds-p-around_medium"> <lightning-output-field field-name="field1" class="slds-m-right_x-small"></lightning-output-field> <lightning-output-field field-name="field2"></lightning-output-field> <lightning-output-field field-name="field3"></lightning-output-field> </div> </div> <div class="slds-col slds-size_1-of-2"> <div class="slds-p-around_medium"> <lightning-output-field field-name="field4" class="slds-m-right_x-small"></lightning-output-field> <lightning-output-field field-name="field5"></lightning-output-field> <lightning-output-field field-name="field6"></lightning-output-field> </div> </div> </div> </lightning-record-view-form> </lightning-card> </template>
- Ragula Sivakumar
- November 13, 2020
- Like
- 0
- Continue reading or reply
Not able to add different reports in tabs in Lightning app builder
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 ??
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 ??
- Ragula Sivakumar
- May 26, 2020
- Like
- 0
- Continue reading or reply
- Ragula Sivakumar
- December 18, 2019
- Like
- 0
- Continue reading or reply
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 .
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 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
- Ragula Sivakumar
- November 27, 2019
- Like
- 0
- Continue reading or reply
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?..
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?..
Will it possible?..
- Ragula Sivakumar
- October 10, 2019
- Like
- 0
- Continue reading or reply
How to make Http callouts in batch class
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
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
- vignesh balasubramanian 14
- June 30, 2017
- Like
- 0
- Continue reading or reply
Capture Email Responses automatically in Custom object Salesforce
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
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
- Rajiv
- January 27, 2016
- Like
- 0
- Continue reading or reply
Intergration with google adwords
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
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
- shailesh.gusain.sfd1.3960741070027976E12
- July 30, 2014
- Like
- 1
- Continue reading or reply
How to access Google Adwords API
Hi,
I would like to access the Google Adwords API from Visual Force/Apex. Is it possible? If so how?
Thanks!
I would like to access the Google Adwords API from Visual Force/Apex. Is it possible? If so how?
Thanks!
- jedi_101
- April 12, 2008
- Like
- 0
- Continue reading or reply