You need to sign in to do that
Don't have an account?
sundhar.mks1.3962649227519546E12
MAP using Trigger
Hi Guys,
Any body have using MAP Please find the code, How this code change to MAP?
Private void UpdatePriceListDate(List<Account> newAccounts){
//Create the instance for the Account
List<Account> ChildRecords = new List<Account>();
//Variable Declaration
string CurrentAccountNotes;
string CurrentParentId;
date PrilistCorrectdate;
for (Account currentrecord : newAccounts) {
//Getting the parentid, PriceListDate and Account notes
CurrentParentId = currentrecord.id;
PrilistCorrectdate = currentrecord.Price_List_Correct__c;
CurrentAccountNotes =currentrecord.Account_Notes__c;
}
ChildRecords = [Select id,Parentid,Price_List_Correct__c,Account_Notes__c, from account where parentid = :CurrentParentId];
for (Account childrecord : ChildRecords) {
//Update the PriceList Date to Childrecord
childrecord.Price_List_Correct__c = PrilistCorrectdate;
//Update the Account Notes to Childrecord
childrecord.Account_Notes__c = CurrentAccountNotes;
}
//Updata the Child Records
update ChildRecords;
}
}
Thanks...
Any body have using MAP Please find the code, How this code change to MAP?
Private void UpdatePriceListDate(List<Account> newAccounts){
//Create the instance for the Account
List<Account> ChildRecords = new List<Account>();
//Variable Declaration
string CurrentAccountNotes;
string CurrentParentId;
date PrilistCorrectdate;
for (Account currentrecord : newAccounts) {
//Getting the parentid, PriceListDate and Account notes
CurrentParentId = currentrecord.id;
PrilistCorrectdate = currentrecord.Price_List_Correct__c;
CurrentAccountNotes =currentrecord.Account_Notes__c;
}
ChildRecords = [Select id,Parentid,Price_List_Correct__c,Account_Notes__c, from account where parentid = :CurrentParentId];
for (Account childrecord : ChildRecords) {
//Update the PriceList Date to Childrecord
childrecord.Price_List_Correct__c = PrilistCorrectdate;
//Update the Account Notes to Childrecord
childrecord.Account_Notes__c = CurrentAccountNotes;
}
//Updata the Child Records
update ChildRecords;
}
}
Thanks...
Then the result of query automatically store in map . Each record will store corrsponding to id.
All Answers
Then the result of query automatically store in map . Each record will store corrsponding to id.
How to change this code to bulk contest? for exmple: at the same time i want to update the >1000 record's, give any idea
Thank's....