• Gaurgk
  • NEWBIE
  • 5 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
Hi All,

I created aura component to display open activity records and to download all the records in the component using custom button (export to csv). For calling aura component as button I created vf page with lightning outapp. 
When I am previewing the vf page on console its displaying the related recordsScreenshot and downloading record in csv format(which is perfectly fine).

Problem: But when I am adding button on related list of open activities its showing the related records but not downloading in csv format. Its downloading in some unformatted file format and not able to see any records.

Kindly provide the suggestions. I am stuck with that I checked lots of link but nothing helpful.

Thanks in advance.
Need button at marked as yellowHI Community members,
I need to have a similar button as highlighted on this component. FYI, the component is manage package of task. I have created one aura component and tried to add the button using button, links & action but that is not helping me out. 
You can consider this component as task.

Please provide your smart ideas and solutions.

Thanks in advance.
public class NSPThresholdHelper {
    
    private static void NSPHelper(list<PriceApproval__c> plist){
        system.debug('nsp trigger running');
        set<id> ppaId = new set<Id>();
        for(PriceApproval__c pa: plist){
            if(pa.Country__c != null){
                ppaId.add(pa.Id);
            }
            
        }
        
        list<PriceApproval__c> ppalist = [select id, name , Country__c, ApprovalStatus2__c, Product__c 
                                                   from  PriceApproval__c where id in: ppaId limit 1];
        
        list<PriceApprovalPrice__c> paplist = [SELECT Id,Name,Product__c,Product__r.TherapeuticArea__c,Product__r.Tier__c,CountryProductSKU__c,
                                                        CountryProductSKU__r.id,CountryProductSKU__r.name,  CountryProductSKU__r.ProductSKU__r.name,
                                                        CountryPriceType__r.name, CountryPriceType__r.Channel__r.name
                                                        FROM PriceApprovalPrice__c where PriceApproval__r.id in: ppaId limit 20];
        
        
        
        
        
        string prodconfname = paplist[0].CountryProductSKU__r.name+'_'+paplist[0].CountryPriceType__r.Channel__r.name;
        system.debug('Paplist size: '+paplist.size());
        list<ProductConfidential006__c> prodconf = [select id, name, MnIRP__UniqueID__c, MnIRP__FloorType__c from ProductConfidential006__c where MnIRP__FloorType__c= 'Floor'];
        
      //  string uniqueId =MnIRP__FloorType__c +'_' +Country__c +'_' +Product2__c +'_' +Channel__c +'_' +CountryProductSKU__c +'_' +CalendarMonth__c.month() +'_' +CalendarMonth__c.year();
        string Uniqueprodcon = 'Floor' +'_' +ppalist[0].Country__r.name +'_' +ppalist[0].Product__r.name +'_' +paplist[0].CountryPriceType__r.Channel__r.name +'_' +paplist[0].CountryProductSKU__r.name +'_' +date.today().month() +'_' +date.today().year();        
        for(integer x=0; x < prodconf.size(); x++){
            if(Uniqueprodcon == prodconf[x].MnIRP__UniqueID__c){
                system.debug('already existing');
            }
        }
        
        list<ProductConfidential006__c> prodconlist = new list<ProductConfidential006__c>();
        for(PriceApproval__c ppa : plist){
            for(integer i=0; i< paplist.size(); i++){
             //   string Uniqueprodconf = 'Floor' +'_' +ppalist[0].Country__r.name +'_' +ppalist[0].Product__r.name +'_' +paplist[i].CountryPriceType__r.Channel__r.name +'_' +paplist[i].CountryProductSKU__r.name +'_' +date.today().month() +'_' +date.today().year();

                if(paplist.size() > 0 && ppalist[0].ApprovalStatus2__c == 'Finalized'){
                    prodconlist.add(new ProductConfidential006__c(
                        name = paplist[i].CountryProductSKU__r.name+'_'+paplist[i].CountryPriceType__r.Channel__r.name,
                        Product2__c = ppalist[0].Product__c,
                            
                        Channel__c = paplist[i].CountryPriceType__r.Channel__c,
                        Country__c = ppalist[0].Country__c,
                        MnIRP__FloorType__c = 'Floor',
                      //  Product_Group__c = pgpm.ParentProductGroup__r.name,
                        Tier__c = paplist[0].Product__r.Tier__c,
                        CountryProductSKU__c =paplist[i].CountryProductSKU__c,
                        ProductSKUNumber__c = '',
                        CalendarMonth__c = date.today()
                    ));
                }
            }
        }
        if(prodconlist.size()>0){
            system.debug('prodconfidential size:'+prodconlist.size());
           // insert prodconlist;
            for(ProductConfidential006__c prodc : prodconlist){
                system.debug('names :'+prodc.name);
            }
        }
    }
}
  • April 01, 2021
  • Like
  • 0
HI All,

I am trying to write a trigger on object1 i.e after insert/ after update to create record on object2. But I am getting error (Apex heap size too large: 39897844) on saving record on object1.

Thanks in advance. 
  • March 31, 2021
  • Like
  • 0
Hi All,

I created aura component to display open activity records and to download all the records in the component using custom button (export to csv). For calling aura component as button I created vf page with lightning outapp. 
When I am previewing the vf page on console its displaying the related recordsScreenshot and downloading record in csv format(which is perfectly fine).

Problem: But when I am adding button on related list of open activities its showing the related records but not downloading in csv format. Its downloading in some unformatted file format and not able to see any records.

Kindly provide the suggestions. I am stuck with that I checked lots of link but nothing helpful.

Thanks in advance.
i need a formula like when the box is checked the text field should be visible
Hi Everyone,
i have a requirement
i am having two users with system administrator role , and having custom object with rating component , if user 1 is giving 5 rating and user 2 is giving 4 rating , then we need to take these two users value add them and show average of both
for example : user 1 rating = 5
                      user 2 rating = 4 

average rating =user1 rating + user 2 rating / 2 = 5+4/2

having rating__c(number) field & averagerating__c (text) field in custom object

different users with different records  on creating record need to show an average of  these ratings

for best example  , when we give rating for a movie in bookmyshow , we need to get rating average from different users and display the result

please let me know how to solve this
thanks in advance

please let me know if this is possible,
thanks in advance