-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
43Questions
-
32Replies
Execution of AfterUpdate caused by: System.FinalException: Record is read-only
Hi Team ,
I have wrote a trigger. When ever the record is updated I need update the pick list field which is Car_Type__c. But I'm gettng below error. Please let me know the why the error message is getting and solution for it.
Error Message : execution of AfterUpdate caused by: System.FinalException: Record is read-only
Triggger :
trigger DiscountonCarprice on V_Customers__c (after insert,after update) {
if(Trigger.isInsert && Trigger.isAfter ){
DiscountonCarpriceController.Discount(trigger.new);
}
else if(Trigger.isupdate && Trigger.isAfter ){
system.debug('Im in else block');
DiscountonCarpriceController.DiscountAfterUpdate(trigger.new,trigger.oldmap);
}
}
=================================
Apex Class :
public class DiscountonCarpriceController {
Public static void discount(list<V_Customers__c> vclist){
set<id> vcId = new set<id>();
list<V_Customers__c> updateVc = new list<V_Customers__c>();
for(V_Customers__c vcCust:vclist){
vcId.add(vcCust.id);
}
list<V_Customers__c> updateVcList = [select id,name,Country__c,Discount__c from V_Customers__c where id =: vcId];
for(V_Customers__c vc: updateVcList){
if(vc.Country__c=='INDIA'){
vc.Discount__c = 20;
//updateVc.add(vc);
}
else if(vc.Country__c=='UK'){
vc.Discount__c = 15;
// updateVc.add(vc);
}
else if(vc.Country__c=='USA'){
vc.Discount__c = 10;
// updateVc.add(vc);
}
}
update updateVcList;
}
Public static void DiscountAfterUpdate(list<V_Customers__c> vclist,map<id,V_Customers__c> vcoldMap){
set<id> vcId = new set<id>();
for(V_Customers__c vcCust:vclist){
vcId.add(vcCust.id);
}
system.debug('vclist****'+vclist);
system.debug('vcoldMap****'+vcoldMap);
list<V_Customers__c> vclist1 = new list<V_Customers__c>();
list<V_Customers__c> vclist2 = [select id,name,Country__c,Discount__c,Car_Type__c from V_Customers__c where Id IN :vcId];
for(V_Customers__c vc:vclist){
if(vcoldMap.get(vc.id).id == vc.id ){
vc.Car_Type__c = 'Hatchback';
vclist1.add(vc);
system.debug('Discount Amount***'+ vc.Discount__c);
}
}
system.debug('vclist1***'+ vclist1);
update vclist1;
system.debug('vclist1***'+ vclist1);
}
}
=============================
Error Screenshot:
FYI:
I have wrote a trigger. When ever the record is updated I need update the pick list field which is Car_Type__c. But I'm gettng below error. Please let me know the why the error message is getting and solution for it.
Error Message : execution of AfterUpdate caused by: System.FinalException: Record is read-only
Triggger :
trigger DiscountonCarprice on V_Customers__c (after insert,after update) {
if(Trigger.isInsert && Trigger.isAfter ){
DiscountonCarpriceController.Discount(trigger.new);
}
else if(Trigger.isupdate && Trigger.isAfter ){
system.debug('Im in else block');
DiscountonCarpriceController.DiscountAfterUpdate(trigger.new,trigger.oldmap);
}
}
=================================
Apex Class :
public class DiscountonCarpriceController {
Public static void discount(list<V_Customers__c> vclist){
set<id> vcId = new set<id>();
list<V_Customers__c> updateVc = new list<V_Customers__c>();
for(V_Customers__c vcCust:vclist){
vcId.add(vcCust.id);
}
list<V_Customers__c> updateVcList = [select id,name,Country__c,Discount__c from V_Customers__c where id =: vcId];
for(V_Customers__c vc: updateVcList){
if(vc.Country__c=='INDIA'){
vc.Discount__c = 20;
//updateVc.add(vc);
}
else if(vc.Country__c=='UK'){
vc.Discount__c = 15;
// updateVc.add(vc);
}
else if(vc.Country__c=='USA'){
vc.Discount__c = 10;
// updateVc.add(vc);
}
}
update updateVcList;
}
Public static void DiscountAfterUpdate(list<V_Customers__c> vclist,map<id,V_Customers__c> vcoldMap){
set<id> vcId = new set<id>();
for(V_Customers__c vcCust:vclist){
vcId.add(vcCust.id);
}
system.debug('vclist****'+vclist);
system.debug('vcoldMap****'+vcoldMap);
list<V_Customers__c> vclist1 = new list<V_Customers__c>();
list<V_Customers__c> vclist2 = [select id,name,Country__c,Discount__c,Car_Type__c from V_Customers__c where Id IN :vcId];
for(V_Customers__c vc:vclist){
if(vcoldMap.get(vc.id).id == vc.id ){
vc.Car_Type__c = 'Hatchback';
vclist1.add(vc);
system.debug('Discount Amount***'+ vc.Discount__c);
}
}
system.debug('vclist1***'+ vclist1);
update vclist1;
system.debug('vclist1***'+ vclist1);
}
}
=============================
Error Screenshot:
FYI:
- venkat bojja
- April 02, 2023
- Like
- 0
- Continue reading or reply
Min() Function in Roll-Up Summary Field
Hi Team,
I have a scenario.
I have one formula field which is Total_Billing_Amount__c which is in child Object.
I'm trying to get the Maximum and Minimum values using the Roll-up summary field on parent Object. It was calculating properly for Maximum but unable to fetch the Minimum Billing amount through Min funtion. It is fetching the Zero instead of getting minimum Total_billing_amount__c
. Any reason behind this ?
Thanks in advance...
Thanks
Venkat.
I have a scenario.
I have one formula field which is Total_Billing_Amount__c which is in child Object.
I'm trying to get the Maximum and Minimum values using the Roll-up summary field on parent Object. It was calculating properly for Maximum but unable to fetch the Minimum Billing amount through Min funtion. It is fetching the Zero instead of getting minimum Total_billing_amount__c
. Any reason behind this ?
Thanks in advance...
Thanks
Venkat.
- venkat bojja
- March 16, 2023
- Like
- 0
- Continue reading or reply
Need formula for below requirement
Hi Team,
I have one requirement.
I need to write formula field...
I have a check_box__c field
1) check_box__c checked or uncheked + Type__c != 'ABC' we need to make the Discount__c field blank.
2) check_box__c checked + Type__c = 'ABC' then we need to do like below
Please help me on this. Thanks in Advance...
Thanks
Venkat.
I have one requirement.
I need to write formula field...
I have a check_box__c field
1) check_box__c checked or uncheked + Type__c != 'ABC' we need to make the Discount__c field blank.
2) check_box__c checked + Type__c = 'ABC' then we need to do like below
Model_Type__c | Discount |
Model 1 | 1000 |
Model 2 | 2000 |
Model 3 | 3000 |
Model 4 | 4000 |
Please help me on this. Thanks in Advance...
Thanks
Venkat.
- venkat bojja
- December 01, 2022
- Like
- 0
- Continue reading or reply
I have Check_Box__c field whichshould enable when the opportunity stage is Contract Loaded
Hi Team,
I have a requirement...
I have Check_Box__c field on opportunity which should editable only the opportunity stage is Contract Loaded.
How I can achieve this requirement with validation rule or any configuration process...
Thanks in advance
Thanks
Venkat.
I have a requirement...
I have Check_Box__c field on opportunity which should editable only the opportunity stage is Contract Loaded.
How I can achieve this requirement with validation rule or any configuration process...
Thanks in advance
Thanks
Venkat.
- venkat bojja
- December 01, 2022
- Like
- 0
- Continue reading or reply
On Junction Object having Two Look-Up fields. If Junction object record is creating from it's parent1 related list no need to visible the Parent2 Look-Up field vise versa
I have ObjectA,ObjectB and ObjectC
I have two look-up fields on ObjectB
Like :ObjectA Name
ObjectC Name
Now When I'm trying to create the ObjectB record from it's parent object ObjectA related list, no need to visible ObjectC Name Look-up field same like while creating the ObjectB record from it's another parent ObjectC no need to visible ObjectA Name Look-up field
Thanks in advance ....
Thanks & Regards
Venkat.
I have two look-up fields on ObjectB
Like :ObjectA Name
ObjectC Name
Now When I'm trying to create the ObjectB record from it's parent object ObjectA related list, no need to visible ObjectC Name Look-up field same like while creating the ObjectB record from it's another parent ObjectC no need to visible ObjectA Name Look-up field
Thanks in advance ....
Thanks & Regards
Venkat.
- venkat bojja
- July 13, 2022
- Like
- 0
- Continue reading or reply
Contact Record Owner's User is inactive and no one can update the Account Name on that Contact
Hi Team,
Contact Record Owner's User is inactive, so in this scenario no one can update the Account Name on that Contact record. Any word around for it. Thanks in advance...
FYI:
Thanks
Venkat.
Contact Record Owner's User is inactive, so in this scenario no one can update the Account Name on that Contact record. Any word around for it. Thanks in advance...
FYI:
Thanks
Venkat.
- venkat bojja
- April 20, 2022
- Like
- 0
- Continue reading or reply
How to rename the Text Posts Tab under the Fee>Post on Case Object.
Hi Team
I want to rename the Text Posts tab which is under the Fee>Post on Case Object. Please help me on this.Thanks in advance...
FYI:
Thanks
Venkat
I want to rename the Text Posts tab which is under the Fee>Post on Case Object. Please help me on this.Thanks in advance...
FYI:
Thanks
Venkat
- venkat bojja
- March 28, 2022
- Like
- 0
- Continue reading or reply
Validation on Case
Hi Team,
I have a requirment.
I have a Case Objec having Lookup to Account And Asset.
After select Account on Case the selected Account related Assets only we need to select and save the case record. If the asset is not related to this seleected Account we need to throw the validation error like Please select the Selected Account related Asset and it should only applicable for recordtypename='service' on the Case object. Please help me on this ASASP.
Thanks in Advance.....
Thanks
Venkat.
I have a requirment.
I have a Case Objec having Lookup to Account And Asset.
After select Account on Case the selected Account related Assets only we need to select and save the case record. If the asset is not related to this seleected Account we need to throw the validation error like Please select the Selected Account related Asset and it should only applicable for recordtypename='service' on the Case object. Please help me on this ASASP.
Thanks in Advance.....
Thanks
Venkat.
- venkat bojja
- March 22, 2022
- Like
- 0
- Continue reading or reply
Employee Object Department is need to update with User Object Department PickList value
Hi Team,
I have a requirement.
On User Object I have one Department Picklist field and same field on Employe Object. But there is no relation, when ever the User is created with pertecular Department PickList Value is need to be updated in Employee object Department field.
What are the best possibilities to achieve this requiment. Please share me some helpful information.
Thanks in advance....
Thanks
Venkat.
I have a requirement.
On User Object I have one Department Picklist field and same field on Employe Object. But there is no relation, when ever the User is created with pertecular Department PickList Value is need to be updated in Employee object Department field.
What are the best possibilities to achieve this requiment. Please share me some helpful information.
Thanks in advance....
Thanks
Venkat.
- venkat bojja
- September 16, 2021
- Like
- 0
- Continue reading or reply
Save Time field with HH:MM format and we Don't allow the Seconds
Hi Team,
I have a requirement.
We have a visualforce page. In that we have Time field with format HH:MM. While entering the values it is taking only HH:MM but after saving the record is saving with Seconds also. I don't want to allow the Seconds, only I need HH:MM format.Please help me on this.
Thanks in advance
Thanks
Venkat
I have a requirement.
We have a visualforce page. In that we have Time field with format HH:MM. While entering the values it is taking only HH:MM but after saving the record is saving with Seconds also. I don't want to allow the Seconds, only I need HH:MM format.Please help me on this.
Thanks in advance
Thanks
Venkat
- venkat bojja
- September 15, 2021
- Like
- 0
- Continue reading or reply
How to Navigate Custom Lightning component to installed package lightning component
I have a Custom Lightning component which is returning records from installed package object. When ever we click on the record name we need to navigate to installed package lightning component on partner community. Please help me on this.
Thanks in advance...
Thanks
Venkat B.
Thanks in advance...
Thanks
Venkat B.
- venkat bojja
- February 18, 2021
- Like
- 0
- Continue reading or reply
Need to create Account based on selected picklist values from UI
Hi Team,
Ihave a requirement,I have two record types 'Review'and 'Non-Review' on customobject__c.
2) I have custommeatadata__mtd object and having pick list field department__c with values 'Review' and 'Non-Review' with same name like records types.
3) On UI I need to get the picklist vales as a dropdown and when I select 'Review' picklist values the record should create 'Review' recordtype name
4) If I select 'Non-Review ' picklist values the record should create 'Non-Review' recordtype name .
Thanks in Advance...
Thanks
Venkat
Ihave a requirement,I have two record types 'Review'and 'Non-Review' on customobject__c.
2) I have custommeatadata__mtd object and having pick list field department__c with values 'Review' and 'Non-Review' with same name like records types.
3) On UI I need to get the picklist vales as a dropdown and when I select 'Review' picklist values the record should create 'Review' recordtype name
4) If I select 'Non-Review ' picklist values the record should create 'Non-Review' recordtype name .
Thanks in Advance...
Thanks
Venkat
- venkat bojja
- January 22, 2021
- Like
- 0
- Continue reading or reply
How Can we create the Objects and fields through .CSV file ?
Hi Team,
I have a .CSV file which contains object names and field names.When I upload this file in salesforce org, autometically create that objects and fields. How can we achieve this requirement.
Thanks in Advance...
Thanks,
Venkat.
I have a .CSV file which contains object names and field names.When I upload this file in salesforce org, autometically create that objects and fields. How can we achieve this requirement.
Thanks in Advance...
Thanks,
Venkat.
- venkat bojja
- December 08, 2020
- Like
- 0
- Continue reading or reply
print functionality for Lightning component
Hi Team,
I have a custom lightning component which is implemented for Custom Dashboard. I wanted to print that dashboard,while trying to print it from Google Chrome Browser (Ctrl+p) href tags and headers & footers comming on print page. How Can I Override these things on Chrome browser.
Or we have ltng:out option right, with this we can embed the Lightning component in to vf and we can genarate pdf. Can I have the Code for this customization.
Thanks in advance....
Thanks,
Venkat B.
I have a custom lightning component which is implemented for Custom Dashboard. I wanted to print that dashboard,while trying to print it from Google Chrome Browser (Ctrl+p) href tags and headers & footers comming on print page. How Can I Override these things on Chrome browser.
Or we have ltng:out option right, with this we can embed the Lightning component in to vf and we can genarate pdf. Can I have the Code for this customization.
Thanks in advance....
Thanks,
Venkat B.
- venkat bojja
- October 12, 2020
- Like
- 0
- Continue reading or reply
Columns Filter on DataTable in Lightning Web Components
Hi Team,
I have requirement...
On loaded data in datatable i need to filter the columns data with search box. Based on any column we enter the text in search box the relavant record need to display.I need this in LWC(Lightning Web Components.
Thanks in advance...
Thanks & Regards,
Venkateswara Rao B.
I have requirement...
On loaded data in datatable i need to filter the columns data with search box. Based on any column we enter the text in search box the relavant record need to display.I need this in LWC(Lightning Web Components.
Thanks in advance...
Thanks & Regards,
Venkateswara Rao B.
- venkat bojja
- September 14, 2020
- Like
- 0
- Continue reading or reply
How to Restrict the Record Access based on RecordType and Account Team Member
Hi Team,
I have a requirement...
On Account object we have few record types, if the record type name is prospect or customer we can treat the record as "Product Account".
I want to restrict the access for product Account record on below scenarios.
Thanks for your help….
Regards,
Venkat B.
I have a requirement...
On Account object we have few record types, if the record type name is prospect or customer we can treat the record as "Product Account".
I want to restrict the access for product Account record on below scenarios.
- The Record owner and Account Team Members can view and edit the Product Account.
- Users that do not own the Product Account and are not listed as Account Team Members can view, but CANNOT edit the Product Account
- Admins can view/edit all Product Accounts.
Thanks for your help….
Regards,
Venkat B.
- venkat bojja
- April 21, 2020
- Like
- 0
- Continue reading or reply
Unable to Change salesforce licence for Installed Package Profile
Hi Team,
In my Org I have already installed package is there, for installed package profiles have the salesforce licence. Now just i want to chage the installed package Profile's Licence. When I'm trying to clone the Profile the licence field is in disable mode(notable to edit it). Can any one suggest me how can i achieve this profile licence changing for installed package.
Thanks in advance...
Thanks,
Venkat.
- venkat bojja
- January 31, 2020
- Like
- 0
- Continue reading or reply
An internal server error has occurred : When i trying to hit the Closed Own / Closed Lost button on
Hi Team,
When i am trying to hit the Closed Own / Closed Lost button on Opportunity getting the below error message.
An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.
Thank you again for your patience and assistance. And thanks for using salesforce.com!
Error ID: 496485080-5196291 (1823944930)
Please help me on this.
FYI:
Thanks,
Venkat.
When i am trying to hit the Closed Own / Closed Lost button on Opportunity getting the below error message.
An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.
Thank you again for your patience and assistance. And thanks for using salesforce.com!
Error ID: 496485080-5196291 (1823944930)
Please help me on this.
FYI:
Thanks,
Venkat.
- venkat bojja
- January 07, 2020
- Like
- 0
- Continue reading or reply
How to create a Lightning Flow for Look-Up (Self Look-Up)
Hi Team,
Through the lightning Flows i need to update the look-up field with filter condition:
Opportunity >type='Professional Service' AND the Account Name= Account Name(Self Loop-Up Relation).
Thanks,
Venkat.
Through the lightning Flows i need to update the look-up field with filter condition:
Opportunity >type='Professional Service' AND the Account Name= Account Name(Self Loop-Up Relation).
Thanks,
Venkat.
- venkat bojja
- September 19, 2019
- Like
- 0
- Continue reading or reply
How to Restrict the Look-Up field to create the Record in Lightning View
Hi Team,
In my project i have the urgent requirement.
At the lookup Field we have an option to create New Record in Lightning View.
Creating the New Record at Look-Up Field is a Standard Salesforce Out of the box functionality.
1)How can i restrict the user while trying to create the Record at Look-Up in lightning View ?
FYI:
Thanks in Advance...
Thanks,
Venkat.
In my project i have the urgent requirement.
At the lookup Field we have an option to create New Record in Lightning View.
Creating the New Record at Look-Up Field is a Standard Salesforce Out of the box functionality.
1)How can i restrict the user while trying to create the Record at Look-Up in lightning View ?
FYI:
Thanks in Advance...
Thanks,
Venkat.
- venkat bojja
- September 13, 2019
- Like
- 0
- Continue reading or reply
I have Check_Box__c field whichshould enable when the opportunity stage is Contract Loaded
Hi Team,
I have a requirement...
I have Check_Box__c field on opportunity which should editable only the opportunity stage is Contract Loaded.
How I can achieve this requirement with validation rule or any configuration process...
Thanks in advance
Thanks
Venkat.
I have a requirement...
I have Check_Box__c field on opportunity which should editable only the opportunity stage is Contract Loaded.
How I can achieve this requirement with validation rule or any configuration process...
Thanks in advance
Thanks
Venkat.
- venkat bojja
- December 01, 2022
- Like
- 0
- Continue reading or reply
On Junction Object having Two Look-Up fields. If Junction object record is creating from it's parent1 related list no need to visible the Parent2 Look-Up field vise versa
I have ObjectA,ObjectB and ObjectC
I have two look-up fields on ObjectB
Like :ObjectA Name
ObjectC Name
Now When I'm trying to create the ObjectB record from it's parent object ObjectA related list, no need to visible ObjectC Name Look-up field same like while creating the ObjectB record from it's another parent ObjectC no need to visible ObjectA Name Look-up field
Thanks in advance ....
Thanks & Regards
Venkat.
I have two look-up fields on ObjectB
Like :ObjectA Name
ObjectC Name
Now When I'm trying to create the ObjectB record from it's parent object ObjectA related list, no need to visible ObjectC Name Look-up field same like while creating the ObjectB record from it's another parent ObjectC no need to visible ObjectA Name Look-up field
Thanks in advance ....
Thanks & Regards
Venkat.
- venkat bojja
- July 13, 2022
- Like
- 0
- Continue reading or reply
Contact Record Owner's User is inactive and no one can update the Account Name on that Contact
Hi Team,
Contact Record Owner's User is inactive, so in this scenario no one can update the Account Name on that Contact record. Any word around for it. Thanks in advance...
FYI:
Thanks
Venkat.
Contact Record Owner's User is inactive, so in this scenario no one can update the Account Name on that Contact record. Any word around for it. Thanks in advance...
FYI:
Thanks
Venkat.
- venkat bojja
- April 20, 2022
- Like
- 0
- Continue reading or reply
How to rename the Text Posts Tab under the Fee>Post on Case Object.
Hi Team
I want to rename the Text Posts tab which is under the Fee>Post on Case Object. Please help me on this.Thanks in advance...
FYI:
Thanks
Venkat
I want to rename the Text Posts tab which is under the Fee>Post on Case Object. Please help me on this.Thanks in advance...
FYI:
Thanks
Venkat
- venkat bojja
- March 28, 2022
- Like
- 0
- Continue reading or reply
Validation on Case
Hi Team,
I have a requirment.
I have a Case Objec having Lookup to Account And Asset.
After select Account on Case the selected Account related Assets only we need to select and save the case record. If the asset is not related to this seleected Account we need to throw the validation error like Please select the Selected Account related Asset and it should only applicable for recordtypename='service' on the Case object. Please help me on this ASASP.
Thanks in Advance.....
Thanks
Venkat.
I have a requirment.
I have a Case Objec having Lookup to Account And Asset.
After select Account on Case the selected Account related Assets only we need to select and save the case record. If the asset is not related to this seleected Account we need to throw the validation error like Please select the Selected Account related Asset and it should only applicable for recordtypename='service' on the Case object. Please help me on this ASASP.
Thanks in Advance.....
Thanks
Venkat.
- venkat bojja
- March 22, 2022
- Like
- 0
- Continue reading or reply
How Can we create the Objects and fields through .CSV file ?
Hi Team,
I have a .CSV file which contains object names and field names.When I upload this file in salesforce org, autometically create that objects and fields. How can we achieve this requirement.
Thanks in Advance...
Thanks,
Venkat.
I have a .CSV file which contains object names and field names.When I upload this file in salesforce org, autometically create that objects and fields. How can we achieve this requirement.
Thanks in Advance...
Thanks,
Venkat.
- venkat bojja
- December 08, 2020
- Like
- 0
- Continue reading or reply
Explain the formula
Hi Team,
Please help me on below formula as each and every line with expaination.
IF(
ISPICKVAL( Severity__c , "Critical")&& ISBLANK(Plan_Due_By_Date__c ), CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+2+10,
1,Plan_Due_By_Date___c+4+10,
2,Plan_Due_By_Date___c+4+10,
3,Plan_Due_By_Date___c +4+10,
4,Plan_Due_By_Date___c +4+10,
5,Plan_Due_By_Date___c+4+10,
Plan_Due_By_Date___c+3+10),
IF(
ISPICKVAL( Severity__c , "High")&&ISBLANK(Plan_Due_By_Date__c ), CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+2+10,
1,Plan_Due_By_Date___c+4+10,
2,Plan_Due_By_Date___c+4+10,
3,Plan_Due_By_Date___c +4+10,
4,Plan_Due_By_Date___c +4+10,
5,Plan_Due_By_Date___c+4+10,
Plan_Due_By_Date___c+3+10),
IF(
ISPICKVAL( Severity__c , "Medium")&&ISBLANK(Plan_Due_By_Date__c ), CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+6+20,
1,Plan_Due_By_Date___c+8+20,
2,Plan_Due_By_Date___c+8+20,
3,Plan_Due_By_Date___c +8+20,
4,Plan_Due_By_Date___c +8+20,
5,Plan_Due_By_Date___c+8+20,
Plan_Due_By_Date___c+7+20),
IF(
ISPICKVAL( Severity__c , "Low")&&ISBLANK(Plan_Due_By_Date__c ),CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+10+30,
1,Plan_Due_By_Date___c+12+30,
2,Plan_Due_By_Date___c+12+30,
3,Plan_Due_By_Date___c+12+30,
4,Plan_Due_By_Date___c+12+30,
5,Plan_Due_By_Date___c+12+30,
Plan_Due_By_Date___c+41),Plan_Due_By_Date__c
)
)
)
)
Thanks in advance
Thanks,
Venkat.
Please help me on below formula as each and every line with expaination.
IF(
ISPICKVAL( Severity__c , "Critical")&& ISBLANK(Plan_Due_By_Date__c ), CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+2+10,
1,Plan_Due_By_Date___c+4+10,
2,Plan_Due_By_Date___c+4+10,
3,Plan_Due_By_Date___c +4+10,
4,Plan_Due_By_Date___c +4+10,
5,Plan_Due_By_Date___c+4+10,
Plan_Due_By_Date___c+3+10),
IF(
ISPICKVAL( Severity__c , "High")&&ISBLANK(Plan_Due_By_Date__c ), CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+2+10,
1,Plan_Due_By_Date___c+4+10,
2,Plan_Due_By_Date___c+4+10,
3,Plan_Due_By_Date___c +4+10,
4,Plan_Due_By_Date___c +4+10,
5,Plan_Due_By_Date___c+4+10,
Plan_Due_By_Date___c+3+10),
IF(
ISPICKVAL( Severity__c , "Medium")&&ISBLANK(Plan_Due_By_Date__c ), CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+6+20,
1,Plan_Due_By_Date___c+8+20,
2,Plan_Due_By_Date___c+8+20,
3,Plan_Due_By_Date___c +8+20,
4,Plan_Due_By_Date___c +8+20,
5,Plan_Due_By_Date___c+8+20,
Plan_Due_By_Date___c+7+20),
IF(
ISPICKVAL( Severity__c , "Low")&&ISBLANK(Plan_Due_By_Date__c ),CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+10+30,
1,Plan_Due_By_Date___c+12+30,
2,Plan_Due_By_Date___c+12+30,
3,Plan_Due_By_Date___c+12+30,
4,Plan_Due_By_Date___c+12+30,
5,Plan_Due_By_Date___c+12+30,
Plan_Due_By_Date___c+41),Plan_Due_By_Date__c
)
)
)
)
Thanks in advance
Thanks,
Venkat.
- venkat bojja
- February 13, 2019
- Like
- 0
- Continue reading or reply
How to clone the case with custom component
Hi Team,
I have a requirement i want to clone the case with custom Action. Please provide me the reference component for this. While cloning the case i want to make sure few fiedls are blank with case status as NEW.
Thanks in advance
Thanks,
Venkat.
I have a requirement i want to clone the case with custom Action. Please provide me the reference component for this. While cloning the case i want to make sure few fiedls are blank with case status as NEW.
Thanks in advance
Thanks,
Venkat.
- venkat bojja
- February 08, 2019
- Like
- 0
- Continue reading or reply
How to Display the current system date with Time in lightning
Hi Team,
How to Display the current system date and Time with better UI template in lightning.Please help me on this.
Thanks in advance....
Thanks
bvr.
How to Display the current system date and Time with better UI template in lightning.Please help me on this.
Thanks in advance....
Thanks
bvr.
- venkat bojja
- July 30, 2018
- Like
- 0
- Continue reading or reply
salesforce lightning documentation
Hi Team,
Any one is having the lightning documentation is done by their own.
If have please provide.. Thanks in advance\
Thanks
Venkat.
Any one is having the lightning documentation is done by their own.
If have please provide.. Thanks in advance\
Thanks
Venkat.
- venkat bojja
- June 14, 2018
- Like
- 0
- Continue reading or reply
Lightning Component force:showToast event nor working in Developer Console
Hi Team,
I Have one issue...
When i am tring to use var showToast = $A.get("e.force:showToast"); like this in my controller.Js it is not working through the developer console.
But it is working into tab level. I required to work this into developer console. Is there any work aroud it. Please help me on this...
Thanks in advance...
Thanks
Venkat
I Have one issue...
When i am tring to use var showToast = $A.get("e.force:showToast"); like this in my controller.Js it is not working through the developer console.
But it is working into tab level. I required to work this into developer console. Is there any work aroud it. Please help me on this...
Thanks in advance...
Thanks
Venkat
- venkat bojja
- June 12, 2018
- Like
- 0
- Continue reading or reply
How to open a component into new tab from the same application
Hi Team,
How could we open a component into new tab from the same application in lightning. What are the possibilities. Please help me on this.
Thanks
Venkat
How could we open a component into new tab from the same application in lightning. What are the possibilities. Please help me on this.
Thanks
Venkat
- venkat bojja
- May 25, 2018
- Like
- 0
- Continue reading or reply
How can we give the component URL in Anchor Tag: <a>
Hi Team,
I am iterating the <a href="https://www.google.co.in/" target="_blank">My Google</a>. In hyper link how can we give the component URL. Is it possible...?.when i clicked on that hyper link i need to navigate to that particular component with record ID. I don't want to use the force:navigateToURL.
Please help me on this... Thanks in advance...
Reference Code:
<aura:iteration items="{!v.ContactList}" var="acc">
<tr>
<th>
<label class="slds-checkbox" id="{!acc.Id}">
<ui:inputCheckbox aura:id="checkContact" name="{!acc.Id}" text="{!acc.Id}" change="{!c.onCheckboxChange}" />
<span class="slds-checkbox--faux" />
<span class="slds-form-element__label"></span>
</label>
</th>
<th scope="row">
<div class="slds-truncate" title="">{!acc.Name}</div>
</th>
<td>
<div class="slds-truncate" title="">{!acc.Phone}</div>
</td>
<th scope="row">
<div class="slds-truncate" title="">{!acc.Email}</div>
</th>
<td>
<div class="slds-truncate" title=""><a href="https://www.google.co.in/" target="_blank">My Google</a></div>
</td>
<th scope="row">
<div class="slds-truncate" title="{!acc.PM_General_Notes__c}">{!acc.AccountId}</div>
</th>
</tr>
</aura:iteration>
=============================================================
Ref Image:
Thanks
Venkat
I am iterating the <a href="https://www.google.co.in/" target="_blank">My Google</a>. In hyper link how can we give the component URL. Is it possible...?.when i clicked on that hyper link i need to navigate to that particular component with record ID. I don't want to use the force:navigateToURL.
Please help me on this... Thanks in advance...
Reference Code:
<aura:iteration items="{!v.ContactList}" var="acc">
<tr>
<th>
<label class="slds-checkbox" id="{!acc.Id}">
<ui:inputCheckbox aura:id="checkContact" name="{!acc.Id}" text="{!acc.Id}" change="{!c.onCheckboxChange}" />
<span class="slds-checkbox--faux" />
<span class="slds-form-element__label"></span>
</label>
</th>
<th scope="row">
<div class="slds-truncate" title="">{!acc.Name}</div>
</th>
<td>
<div class="slds-truncate" title="">{!acc.Phone}</div>
</td>
<th scope="row">
<div class="slds-truncate" title="">{!acc.Email}</div>
</th>
<td>
<div class="slds-truncate" title=""><a href="https://www.google.co.in/" target="_blank">My Google</a></div>
</td>
<th scope="row">
<div class="slds-truncate" title="{!acc.PM_General_Notes__c}">{!acc.AccountId}</div>
</th>
</tr>
</aura:iteration>
=============================================================
Ref Image:
Thanks
Venkat
- venkat bojja
- May 21, 2018
- Like
- 0
- Continue reading or reply
DataTable in lightning
Hi Team,
I have a one data table with check boxes. Ineed to check only one check box at a time with the checked record ID.Please help me on this.
Thanks in advance...
Reference code:
Component:
<aura:component controller="ContactAuraController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<!--Declare Event Handlers-->
<aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
<!--Declare Attributes-->
<aura:attribute name="contactList" type="list" />
<aura:attribute name="isSelectAll" type="boolean" default="false"/>
<aura:attribute name="recdId" type="String" />
<div class="slds-m-around_xx-large">
<h1 class="slds-text-heading--medium">Contacts</h1>
<br/>
<!--Contact List Table-->
<table class="slds-table slds-table--bordered slds-table--cell-buffer" role="grid">
<thead>
<tr class="slds-text-title--caps">
<th>
<label class="slds-checkbox">
<ui:inputCheckbox value="{!v.isSelectAll}" change="{!c.handleSelectedContacts}" aura:id="selectAll"/>
<span class="slds-checkbox--faux" />
<span class="slds-form-element__label"></span>
</label>
</th>
<th scope="col">
<div class="slds-truncate" title="Name">Name</div>
</th>
<th scope="col">
<div class="slds-truncate" title="Account">Account</div>
</th>
<th scope="col">
<div class="slds-truncate" title="Phone">Phone</div>
</th>
<th scope="col">
<div class="slds-truncate" title="Email">Email</div>
</th>
</tr>
</thead>
<tbody>
<aura:iteration items="{!v.contactList}" var="con">
<tr>
<th>
<label class="slds-checkbox">
<ui:inputCheckbox aura:id="checkContact" value="" text="{!con.Id}"/>
<span class="slds-checkbox--faux" />
<span class="slds-form-element__label"></span>
</label>
</th>
<th scope="row">
<div class="slds-truncate" title="{!con.Name}">{!con.Name}</div>
</th>
<td>
<div class="slds-truncate" title="{!con.Account.Name}">{!con.Account.Name}</div>
</td>
<th scope="row">
<div class="slds-truncate" title="{!con.Phone}">{!con.Phone}</div>
</th>
<td>
<div class="slds-truncate" title="{!con.Email}">{!con.Email}</div>
</td>
</tr>
</aura:iteration>
</tbody>
</table>
<div>
<br/>
<!-- <lightning:button label="Submit" class="slds-button_brand" onclick="{!c.handleSelectedContacts }" /> -->
</div>
</div>
</aura:component>
==================================
Controller.JS
({
//get Contact List from apex controller
doInit : function(component, event, helper) {
var action = component.get("c.getContactList");
action.setParams({
});
action.setCallback(this, function(result){
var state = result.getState();
if (component.isValid() && state === "SUCCESS"){
component.set("v.contactList",result.getReturnValue());
}
});
$A.enqueueAction(action);
},
//Select all contacts
//Process the selected contacts
getSelectedName: function (cmp, event,helper) {
debugger;
var selectedRows = event.getParam('selectedRows');
for (var i = 0; i < selectedRows.length; i++){
// alert(selectedRows[i].Id);
cmp.set('v.recdId', selectedRows[i].Id);
var RecordID = cmp.get("v.recdId");
alert('RecordID'+RecordID);
}
},
})
=================================
Apex Controller
public class ContactAuraController {
@AuraEnabled
Public static List<Contact> getContactList(){
//get all contact list
List<Contact> conList = [SELECT Id, Name, Account.Name, Phone, Email FROM Contact LIMIT 10];
return conList;
}
}
=====================================
Reference Image:
I have a one data table with check boxes. Ineed to check only one check box at a time with the checked record ID.Please help me on this.
Thanks in advance...
Reference code:
Component:
<aura:component controller="ContactAuraController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<!--Declare Event Handlers-->
<aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
<!--Declare Attributes-->
<aura:attribute name="contactList" type="list" />
<aura:attribute name="isSelectAll" type="boolean" default="false"/>
<aura:attribute name="recdId" type="String" />
<div class="slds-m-around_xx-large">
<h1 class="slds-text-heading--medium">Contacts</h1>
<br/>
<!--Contact List Table-->
<table class="slds-table slds-table--bordered slds-table--cell-buffer" role="grid">
<thead>
<tr class="slds-text-title--caps">
<th>
<label class="slds-checkbox">
<ui:inputCheckbox value="{!v.isSelectAll}" change="{!c.handleSelectedContacts}" aura:id="selectAll"/>
<span class="slds-checkbox--faux" />
<span class="slds-form-element__label"></span>
</label>
</th>
<th scope="col">
<div class="slds-truncate" title="Name">Name</div>
</th>
<th scope="col">
<div class="slds-truncate" title="Account">Account</div>
</th>
<th scope="col">
<div class="slds-truncate" title="Phone">Phone</div>
</th>
<th scope="col">
<div class="slds-truncate" title="Email">Email</div>
</th>
</tr>
</thead>
<tbody>
<aura:iteration items="{!v.contactList}" var="con">
<tr>
<th>
<label class="slds-checkbox">
<ui:inputCheckbox aura:id="checkContact" value="" text="{!con.Id}"/>
<span class="slds-checkbox--faux" />
<span class="slds-form-element__label"></span>
</label>
</th>
<th scope="row">
<div class="slds-truncate" title="{!con.Name}">{!con.Name}</div>
</th>
<td>
<div class="slds-truncate" title="{!con.Account.Name}">{!con.Account.Name}</div>
</td>
<th scope="row">
<div class="slds-truncate" title="{!con.Phone}">{!con.Phone}</div>
</th>
<td>
<div class="slds-truncate" title="{!con.Email}">{!con.Email}</div>
</td>
</tr>
</aura:iteration>
</tbody>
</table>
<div>
<br/>
<!-- <lightning:button label="Submit" class="slds-button_brand" onclick="{!c.handleSelectedContacts }" /> -->
</div>
</div>
</aura:component>
==================================
Controller.JS
({
//get Contact List from apex controller
doInit : function(component, event, helper) {
var action = component.get("c.getContactList");
action.setParams({
});
action.setCallback(this, function(result){
var state = result.getState();
if (component.isValid() && state === "SUCCESS"){
component.set("v.contactList",result.getReturnValue());
}
});
$A.enqueueAction(action);
},
//Select all contacts
//Process the selected contacts
getSelectedName: function (cmp, event,helper) {
debugger;
var selectedRows = event.getParam('selectedRows');
for (var i = 0; i < selectedRows.length; i++){
// alert(selectedRows[i].Id);
cmp.set('v.recdId', selectedRows[i].Id);
var RecordID = cmp.get("v.recdId");
alert('RecordID'+RecordID);
}
},
})
=================================
Apex Controller
public class ContactAuraController {
@AuraEnabled
Public static List<Contact> getContactList(){
//get all contact list
List<Contact> conList = [SELECT Id, Name, Account.Name, Phone, Email FROM Contact LIMIT 10];
return conList;
}
}
=====================================
Reference Image:
- venkat bojja
- May 04, 2018
- Like
- 0
- Continue reading or reply
list view print functionality in lightning
I have developed code to over come limitation of print option for list view.
VF Page
Controller class
Lightning component
Component controller JS
Helper classes
You can modify this code any other object you wish to implement.
Create listview button with the VF page.
VF Page
<apex:page sidebar="false" standardStylesheets="false" cache="false" standardController="Account" recordSetVar="accounts" lightningStylesheets="true"> <button id="upload-button" onclick="window.print();" style="margin-left: 50%;" Class="slds-button">Print</button> <apex:includeLightning /> <div id="lightning" ></div> <script> $Lightning.use("c:ListView", function() { $Lightning.createComponent("c:ListViewComponent", { label : "" }, "lightning", function(cmp) { }); }); </script> </apex:page>
Controller class
public with sharing class ListViewController { // Method to get all list view option available for the Account object @AuraEnabled public static List<SelectOption> getListViews(){ SelectOption lstView=new SelectOption ('--None--','--None--'); List<SelectOption> listviews = new List<SelectOption>(); listviews.add(lstView); for(ListView lstObj : [SELECT Id, Name FROM ListView WHERE SobjectType = 'Account' order by name ASC]){ listviews.add(new SelectOption (lstObj.id,lstObj.name)); } return listviews; } // Method to get the Account records based on the selected list view @AuraEnabled public static DynamicTableMapping getFilteredAccounts(String filterId){ list<string> headervalue =new list<string>(); HttpRequest req = new HttpRequest(); String baseUrl = URL.getSalesforceBaseUrl().toExternalForm(); String endPoinURL = baseUrl+'/services/data/v32.0/sobjects/Account/listviews/'+filterId+'/describe'; req.setEndpoint(endPoinURL); req.setMethod('GET'); req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId()); Http http = new Http(); HTTPResponse response = http.send(req); Map<String, Object> tokenResponse = (Map<String, Object>) JSON.deserializeUntyped(response.getBody()); String query = (String) tokenResponse.get('query'); system.debug('query--->'+query); for(string s:query.split(',')){ s=s.trim(); if(s.startsWith('SELECT')){ headervalue.add((s.removeStart('SELECT')).trim()); }else if(!s.startsWith('SYSTEMMODSTAMP') && !s.equalsIgnoreCase('SYSTEMMODSTAMP FROM ACCOUNT ORDER BY NAME ASC NULLS FIRST') && !s.contains('ASC')){ headervalue.add(s.trim()); } } List<ObjectValueMap> AccountList = new List<ObjectValueMap>(); for(Account accountObj : database.query(query)){ Map<String, Schema.SObjectField> objectFields = Account.getSObjectType().getDescribe().fields.getMap(); list<FieldValues> fieldValue=new list<FieldValues>(); for(string s:headervalue){ Schema.DescribeFieldResult dr; if (objectFields.containsKey(s)) dr = objectFields.get(s).getDescribe(); if(null!=dr) fieldValue.add(new FieldValues(string.valueof(null==accountObj.get(dr.getName())?'':accountObj.get(dr.getName())))); else fieldValue.add(new FieldValues(string.valueof(''))); } AccountList.add(new ObjectValueMap(accountObj,fieldValue)); } return new DynamicTableMapping(headervalue,AccountList); } }
Lightning component
<aura:component controller="ListViewController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" > <aura:handler name="init" value="{!this}" action="{!c.doInit}"/> <aura:attribute name="AccountListViewList" type="SelectOption[]"/> <aura:attribute name="AccountList" type="DynamicTableMapping"/> <aura:attribute name="fieldList" type="string[]"/> <ui:inputSelect class="slds-select slds-size_small" aura:id="selectedViewId" label="Account View" change="{!c.getFilteredAccount}"> <aura:iteration items="{!v.AccountListViewList}" var="listview"> <ui:inputSelectOption text="{!listview.value}" label="{!listview.label}"/> </aura:iteration> </ui:inputSelect> <br/><br/> <table class="slds-table slds-table_bordered slds-table_cell-buffer"> <thead> <tr class="slds-text-title_caps"> <aura:iteration items="{!v.fieldList}" var="item"> <th scope="col"> <div class="slds-truncate" title="{!item}">{!item}</div> </th> </aura:iteration> </tr> </thead> <tbody> <aura:iteration items="{!v.AccountList}" var="item" indexVar="index"> <tr> <aura:iteration items="{!item.values}" var="item1"> <td> {!item1.value} </td></aura:iteration> </tr> </aura:iteration> </tbody> </table> </aura:component>
Component controller JS
({ doInit : function(component, event, helper){ var action = component.get("c.getListViews"); action.setCallback(this, function(response){ var state = response.getState(); if (state === "SUCCESS") { component.set("v.AccountListViewList",response.getReturnValue()); } }); $A.enqueueAction(action); }, getFilteredAccount : function (component, event, helper) { var selected = component.find("selectedViewId").get("v.value"); var action = component.get("c.getFilteredAccounts"); action.setParams({filterId : selected}); action.setCallback(this, function(response){ var state = response.getState(); if (state === "SUCCESS") { component.set("v.AccountList",response.getReturnValue().value); component.set("v.fieldList",response.getReturnValue().headervalues); } }); $A.enqueueAction(action); }, })
Helper classes
public class DynamicTableMapping { @AuraEnabled public list<string> headervalues{get;set;} @AuraEnabled public list<ObjectValueMap> value{get;set;} public DynamicTableMapping(list<string> headervalues,list<ObjectValueMap> value){ this.headervalues=headervalues; this.value=value; } } --- Value map class-- public class ObjectValueMap { @AuraEnabled public account account{get;set;} @AuraEnabled public list<fieldValues> values{get;set;} public ObjectValueMap(account acc,list<fieldValues> values){ this.account=acc; this.values=values; } } -- Field values class-- public class FieldValues { @auraenabled public object value{get;set;} public FieldValues(object value){ this.value=value; } }
You can modify this code any other object you wish to implement.
Create listview button with the VF page.
- vijay kumar 495
- November 30, 2017
- Like
- 2
- Continue reading or reply