• aklkk
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 28
    Questions
  • 15
    Replies
Hi all ,

i am facting problem because i am not able to write a trigger for after insert after update after delete parent to child object

How to writa a Trigger on Parent Object  after insert ,after update,after delete trigger worked??

Thanks
aklkk
  • August 17, 2019
  • Like
  • 0
Hi Every one 


Please support me 

how to send a email when is inserting a Records in costume Object then send a email to multiple person by Trigger ?

peson means (to send multiple salesfroce users)


Thanks 
aklkk
 
  • May 29, 2019
  • Like
  • 0
hi all ,

Please support me how to get the data from Neteeza  to salesfroce ? 


Thanks 
aklkk
  • April 12, 2019
  • Like
  • 0
Hi All 

Please help me how to write a test class for this code ??

public class FileUploaderTest
{
    public string nameFile{get;set;}
   
    public String newRetailName{get;set;}
    public Blob contentFile{get;set;}
    String[] filelines = new String[]{};
    public List<Lead> accstoupload;
    public String mainFileName;
    
    /***This function reads the CSV file and inserts records into the Account object. ***/
    public Pagereference ReadFile()
    {
        
         newRetailName = System.currentPageReference().getParameters().get('id');

        try{
                //Convert the uploaded file which is in BLOB format into a string
                //nameFile =blobToString( contentFile,'ISO-8859-1');
                //System.assert(false,nameFile);
            if(String.isNotBlank(nameFile) && !nameFile.containsIgnoreCase('.csv')){
                ApexPages.Message errormsg = new ApexPages.Message(ApexPages.severity.ERROR,'Please upload only .csv files');
                ApexPages.addMessage(errormsg);
            } else if(String.isNotBlank(nameFile) && nameFile.containsIgnoreCase('.csv')) {
                //Now sepatate every row of the excel file
                mainFileName =blobToString( contentFile,'ISO-8859-1');
                filelines = mainFileName.split('\n');
                //System.assert(false,filelines);
                //Iterate through every line and create a Account record for each row
                accstoupload = new List<Lead>();
                for (Integer i=1;i<filelines.size();i++)
                {
                    String[] inputvalues = new String[]{};
                    inputvalues = filelines[i].split(',');
                    Lead newLead = new Lead();
                    if(String.isBlank(inputvalues[0])){
                        ApexPages.Message errormsg = new ApexPages.Message(ApexPages.severity.ERROR,'FirstName is missing.');
                        ApexPages.addMessage(errormsg);
                        break;
                    } else {
                        newLead.FirstName = inputvalues[0];   
                    }
                    
                    if(String.isBlank(inputvalues[1])){
                        ApexPages.Message errormsg = new ApexPages.Message(ApexPages.severity.ERROR,'LastName is missing.');
                        ApexPages.addMessage(errormsg);
                        break;
                    } else {
                        newLead.LastName = inputvalues[1];
                    }
                      if(String.isBlank(inputvalues[7])){
                        ApexPages.Message errormsg = new ApexPages.Message(ApexPages.severity.ERROR,'Zipcode is missing.');
                        ApexPages.addMessage(errormsg);
                        break;
                    } else {
                        newLead.Zip_Code__c= inputvalues[7];
                    }
                    //System.assert(false,inputvalues[2] +'=='+ inputvalues[3]);
                    if(String.isBlank(inputvalues[2]) && String.isBlank(inputvalues[3])){
                        ApexPages.Message errormsg = new ApexPages.Message(ApexPages.severity.ERROR,'Please enter either Phone or Email.');
                        ApexPages.addMessage(errormsg);
                        break;
                    } else {
                        newLead.email= inputvalues[2];
                        newLead.Phone= inputvalues[3];
                    }
                    /*if(String.isBlank(inputvalues[3])){
                        ApexPages.Message errormsg = new ApexPages.Message(ApexPages.severity.ERROR,'Please enter either phone.');
                        ApexPages.addMessage(errormsg);
                        break;
                    } else {
                        newLead.Phone= inputvalues[3];
                    }*/
                     newLead.Address__c= inputvalues[4];
                     newLead.City__c= inputvalues[5];
                     newLead.State__c= inputvalues[6];
                     newLead.Sale__c = inputvalues[8];
                     newLead.LeadSource = 'sales';
                     newLead.Product__c= inputvalues[9];
                     newLead.RecordTypeId = Schema.SObjectType.Lead.getRecordTypeInfosByName().get('Retail Lead').getRecordTypeId();
                    
                }
        }
                
        //Finally, insert the collected records
            if(accstoupload != null && !accstoupload.isEmpty()){
                Database.upsert(accstoupload,false); 
             // upsert accstoupload;
            }
            
        }
        catch (Exception e)
        {
            ApexPages.Message errormsg = new ApexPages.Message(ApexPages.severity.ERROR,'An error has occured inserting the records'+e.getMessage()+e.getStackTraceString());
            ApexPages.addMessage(errormsg);
        }    
        return null;
    }

Thanks 
aklkk
  • March 11, 2019
  • Like
  • 0
hi everyone,


how to send a email with the trigger when a crcord is canclled included some filed with the record like name,address ?


Thanks 
AKLKK
 
  • March 08, 2019
  • Like
  • 0
HI All,


Please solve the problem 
how to prevent the more then one attachement on parent record ?



Thanks 
aklkk
  • February 25, 2019
  • Like
  • 0
Hi, all

how to write a Trigger on Attachments if the any attached file then status if approved else not approved on parent Fields ??



thanks
aklkk
  • January 24, 2019
  • Like
  • 0
Hi,all 
Please solve the problem my question is that 



if the upload the pdf in related list of the Aaacount object then status Approved how is it Possible?

thanks aklkk
  • January 23, 2019
  • Like
  • 0
hi All,
Please solve the problem 

how to create a shorting pagination and searching in datatable on visualforce page ?


Thanks 
aklkk
  • January 17, 2019
  • Like
  • 0
hi Every one, 
how to show the data in this way on visualfroce page  please suppot me ? 
User-added image
Thanks 
Alkka
  • January 07, 2019
  • Like
  • 0
Hi All 

how to Delete record by JavaScript on  Cancel Custom Button ??

Please help me 

Thanks 
aklkk
  • December 24, 2018
  • Like
  • 0
HI all,

Google Map is not Working on Visualforce Page pelase solve the problem
last time code is going good now its not Working

<apex:page standardController="Account">
<head>
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var myOptions={ zoom: 15,mapTypeId: google.maps.MapTypeId.ROADMAP,mapTypeControl: false };
var map;
var marker;
var geocoder = new google.maps.Geocoder();
var address ="{!Account.BillingStreet},{!Account.BillingPostalCode}{!Account.BillingCity}, {!Account.BillingState},{!Account.BillingCountry}";
var infowindow = new google.maps.InfoWindow({
content: "<b>{!Account.Name}</b><br>{!Account.BillingStreet}<br>{!Account.BillingCity}, {!Account.BillingPostalCode}<br>{!Account.BillingState}<br>{!Account.BillingCountry}"
});
 
geocoder.geocode( { address: address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK&&results.length) {
if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {
 
//create map
map = new google.maps.Map(document.getElementById("map"), myOptions);
 
//center map
map.setCenter(results[0].geometry.location);
 
//create marker
marker = new google.maps.Marker({
position: results[0].geometry.location,
map: map,
title: "{!Account.Name}"
});
 
//add listeners
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});
google.maps.event.addListener(infowindow, 'closeclick', function() {
map.setCenter(marker.getPosition());
});
}
} else {
$('#map').css({'height' : '15px'});
$('#map').html("Oops! {!Account.Name}'s billing address could not be found, please make sure the address is correct.");
resizeIframe();
}
});
 
function resizeIframe() {
var me = window.name;
if (me) {
var iframes = parent.document.getElementsByName(me);
if (iframes&&iframes.length == 1) {
height = document.body.offsetHeight;
iframes[0].style.height = height + "px";
}
}
}
});
</script>
<style>
#map {
font-family: Arial;
font-size:12px;
line-height:normal !important;
height:250px;
background:transparent;
}
</style>
</head>
<body>
<div id="map"></div>
</body>
</apex:page>
  • December 23, 2018
  • Like
  • 0
hi 


is it Right way for if statement for the Trigger ? please   correct 
Trigger TriggerName on Account(After insrt,after delete,after update){
if(Trigger.isInsert){
     if(Trigger.isAfter){
// after insert trigger logic 

}

}else if(Trigger.isDelete){
  if(Trigger.isAfter){

// logic for after delete trigger

}

}else (Trigger.isUpdate){
  if(Trigger.isAfter){
// after update trigger 

}
}



}
  • December 03, 2018
  • Like
  • 0
hi EveryOne,

How to export the report and save in excel every day ? if is it possible then please provide the  Answer. 



Thanks 
Aklkk
  • December 03, 2018
  • Like
  • 0
hi,

i am faceing a probject for coverage a unit test code please help me ?

trigger on inforamtionManagement on informationManagement__c(After insert) {
    for(informationManagement__c infoobj:trigger.new){
    
    if(infoobj.canclae_Event__c== False && infoobj.Target_People__c=='Person'){
        Resitration_from__c rsfobj=new Resitration_from__c();
        rsfobj.Record_type='new';
        rsfobj.Account_Name=infoobj.lead_Name__c;
        rsfobj.start_date__c=infoobj.start_date__c;
        isnert(rsfobj);
    
    
    
    
    }
    
    
    
    }

}
  • November 19, 2018
  • Like
  • 0
hi,

i am faceing a probject for coverage a unit test code please help me ?

trigger on inforamtionManagement on informationManagement__c(After insert) {
    for(informationManagement__c infoobj:trigger.new){
    
    if(infoobj.canclae_Event__c== False && infoobj.Target_People__c=='Person'){
        Resitration_from__c rsfobj=new Resitration_from__c();
        rsfobj.Record_type='new';
        rsfobj.Account_Name=infoobj.lead_Name__c;
        rsfobj.start_date__c=infoobj.start_date__c;
        isnert(rsfobj);
    
    
    
    
    }
    
    
    
    }

}
  • November 19, 2018
  • Like
  • 0
Hi Everyone

i have a problem
how to solve a prblem when a inserting a registation form if records all ready exist then edit the same record which is all reday exist else save a record as new record ?

Thanks
Aklkk
  • November 11, 2018
  • Like
  • 0
Hi Please support

how to upsert performance with trigger ?(it means old record found then update some fields else not old record found then create new Record)
  • November 10, 2018
  • Like
  • 0
hi

pelase support me how to slove the problem Trigger like fired Upsert Command (its means old data found the update else not found  new create

how we can do that logic ??


Thanks
Akikk
  • November 10, 2018
  • Like
  • 0
Hi Everyone

how to write a trigger on Account object if the inserting new record but all ready  record is exist then update if not exist then create new record ?

Thanks
aklkk
  • November 10, 2018
  • Like
  • 0
Hi all ,

i am facting problem because i am not able to write a trigger for after insert after update after delete parent to child object

How to writa a Trigger on Parent Object  after insert ,after update,after delete trigger worked??

Thanks
aklkk
  • August 17, 2019
  • Like
  • 0
Hi,all 
Please solve the problem my question is that 



if the upload the pdf in related list of the Aaacount object then status Approved how is it Possible?

thanks aklkk
  • January 23, 2019
  • Like
  • 0
hi,

i am faceing a probject for coverage a unit test code please help me ?

trigger on inforamtionManagement on informationManagement__c(After insert) {
    for(informationManagement__c infoobj:trigger.new){
    
    if(infoobj.canclae_Event__c== False && infoobj.Target_People__c=='Person'){
        Resitration_from__c rsfobj=new Resitration_from__c();
        rsfobj.Record_type='new';
        rsfobj.Account_Name=infoobj.lead_Name__c;
        rsfobj.start_date__c=infoobj.start_date__c;
        isnert(rsfobj);
    
    
    
    
    }
    
    
    
    }

}
  • November 19, 2018
  • Like
  • 0
hi,

i am faceing a probject for coverage a unit test code please help me ?

trigger on inforamtionManagement on informationManagement__c(After insert) {
    for(informationManagement__c infoobj:trigger.new){
    
    if(infoobj.canclae_Event__c== False && infoobj.Target_People__c=='Person'){
        Resitration_from__c rsfobj=new Resitration_from__c();
        rsfobj.Record_type='new';
        rsfobj.Account_Name=infoobj.lead_Name__c;
        rsfobj.start_date__c=infoobj.start_date__c;
        isnert(rsfobj);
    
    
    
    
    }
    
    
    
    }

}
  • November 19, 2018
  • Like
  • 0
Hi Everyone

i have a problem
how to solve a prblem when a inserting a registation form if records all ready exist then edit the same record which is all reday exist else save a record as new record ?

Thanks
Aklkk
  • November 11, 2018
  • Like
  • 0
Hi Please support

how to upsert performance with trigger ?(it means old record found then update some fields else not old record found then create new Record)
  • November 10, 2018
  • Like
  • 0
hi

pelase support me how to slove the problem Trigger like fired Upsert Command (its means old data found the update else not found  new create

how we can do that logic ??


Thanks
Akikk
  • November 10, 2018
  • Like
  • 0
Hi Everyone

how to write a trigger on Account object if the inserting new record but all ready  record is exist then update if not exist then create new record ?

Thanks
aklkk
  • November 10, 2018
  • Like
  • 0
Hi Every one ,
How to write a trigger on Account Object if the record is Exist then update the records else created new Account Records ?


Thanks 
Aklkk
  • November 09, 2018
  • Like
  • 0
Hi Everyone,
how to create a trigger when the account is created then automatically contact and opportunity created ?

Pleasae supppot me 


Thanks 
AKlkk
  • November 08, 2018
  • Like
  • 0
Hi All, 
Please support me , how to configure the CPQ in salesfroce ??
its senerio that cpq opportunity copty to salesfroce opportunity cpq account to salesfroce account cpq contact to salesfroce contect
is it possible that web API or Configure the CPQ in salesfroce pelase suggets me ?
 if cpq coniger the salsefroce then pealse how to configure the cpq in salsesfroce 


Thanks in advance dear 
  • October 30, 2018
  • Like
  • 0
hi

 can you  suggest me complete process for create a package?


Thanks
 
  • February 20, 2017
  • Like
  • 0
hi

Please any one suggest me that when i am doing a custome setting of the Renam tabs and lebels for example i am changing that Account name to StudentAccount  then how its possible that apply on the same app? because its apply on all related app in organisation .is it possible or not? if it is possible then pelase describe.
  • February 18, 2017
  • Like
  • 0
why used the viewstae development mode ??

Hi,

 

We got a requirement to pull the records which contains '123' in a particular column. So, we used LIKE '123%' clause in the query. However, the search text value will be entered dynamically and hence we tried to change the query with class varibale for the search text. But it fails for the below where clause.

 

LIKE "'"+searchText+"%'"

 

Can anyone help me to fix this issue.

 

Regards,

SuBaa

  • March 21, 2012
  • Like
  • 0