• Sundar rajan A
  • NEWBIE
  • 0 Points
  • Member since 2016

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

I need to archive the files related to Task object, In future i suppose to import the files with related Task record, Please help to achive this requirement.

Thanks in Advance!!!

Regards,
Sundar Rajan. A
Hi Friends,
My requirement is disable the Quick action button after 14 days from the record creation date.There is no option to disable to Lightning quick option button,so i plan to show a popup window i calculated the days between created Date and today date and stored in the wrapper list variable . My problem is I not able  to access the field value in helper from the controller returned List variable. I am new to Lightning .

My component :

<aura:component controller="SelectBuyersController" implements="force:hasRecordId,force:lightningQuickActionWithoutHeader">
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
    <aura:attribute name="recordId" type="Id" />
    <aura:attribute name="people" type="Object[]" />
    <aura:attribute name="selPerson" type="Object" />
    <aura:attribute name="days" type="Decimal" />
    <aura:handler name="change" value="{!v.selPerson}" action="{!c.newPerson}" />
    <aura:attribute name="errorMsg" type="String" />
    <aura:attribute name="alertMsg" type="String" />
    <aura:attribute name="remdays" type="Decimal" />
    <aura:attribute name="orderlist" type="List" />
    <aura:attribute name="includeSender" type="Boolean" default="false" />
    
    <div aura:id="alertmsgform" class="hide" style="font-weight:bold;color:red">
        {!v.alertMsg}
        </div>
    <div aura:id="recordviewform" class="hide">
    <div class="container">
        <header class="slds-modal__header">
            <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">Add Tag On Buyers </h2>
        </header>
        <div style="font-weight:bold;color:red">{!v.errorMsg}</div>
        <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
            <h3>Buyers</h3>
</div>
</div>
</div>


My Lightning Controller:

({
    // Initializing function
    doInit : function(cmp, event, helper) 
    {
    
        helper.getCurrentTagOnBuyers(cmp);
       
    },


My Lightning Helper:

({
    
    getCurrentTagOnBuyers : function(cmp) 
    {
        var recordId = cmp.get("v.recordId");
        
        var action = cmp.get("c.getTagOnBuyers");
        action.setParams({ orderTrackerId : recordId});
        
        
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                var res = response.getReturnValue();
                component.set('v.wraperlist', response.getReturnValue());
                var recordviewform = cmp.find('recordviewform');
                var alertmsgform = cmp.find('alertmsgform');
                cmp.set("v.alertMsg", "TagOn Buyer Only added within 14 days.");
                
                
               
                 if(!res.RemainingDays  < 14)
                {
                    alert('Less days');
                    
                    $A.util.addClass(alertmsgform, 'hide');
                  $A.util.removeClass(recordviewform, 'hide');
                    
                    
                }
               else if(!res.RemainingDays > 14)
                {
                 alert('More days');
                    $A.util.removeClass(alertmsgform, 'hide');
                    $A.util.addClass(recordviewform, 'hide');
                    
                }
});
        
        $A.enqueueAction(action);
        
    },





My Apex controller:
public class SelectBuyersController{

    
    public class CustomResponse
    {
        @AuraEnabled
        public String id = NULL;
        @AuraEnabled
        public String name = NULL;
        @AuraEnabled
        public Decimal RemainingDays ;
        
        
        public CustomResponse(String id, String name, Decimal RemainingDays )
        {
            this.id = id;
            this.name = name;
            this.RemainingDays = RemainingDays;
        }
    }
    
   
    @AuraEnabled
    public static List<CustomResponse> getTagOnBuyers(Id orderTrackerId)
    {
    Decimal days;
   
     Decimal RemainingDays ;
        List<Order_TagOn_Buyer__c> TagOnOrderbuyer= 
            [SELECT Internal_Contact__r.Id, 
                    Internal_Contact__r.Name,Order_Tracker__r.DaysFromCreatedDate__c 
                    FROM Order_TagOn_Buyer__c
             WHERE Order_Tracker__c = :orderTrackerId];
             
        System.debug('Order buyer'+TagOnOrderbuyer);
        
        List<CustomResponse> people = new List<CustomResponse>();
        
        
        List<Order_Tracker__c> OrderTrackerLst= 
            [SELECT Id,name,OwnerId,S_Number__c,Cancel_Date__c,Buyer_Account__c,Buyer_Account__r.name,
             Walkthrough_Expected_Date__c, Walkthrough_Required__c,CreatedDate
             FROM Order_Tracker__c 
             WHERE Id = :orderTrackerId];
        for(Order_Tracker__c OT : OrderTrackerLst )
        {
        Date dueDate = System.today();
    Integer daysBetween = date.valueof(OT.CreatedDate).daysBetween(dueDate);
    System.debug('Days Between'+daysBetween);
    if(daysBetween <= 14)
    {
    RemainingDays = 14 - daysBetween ;
    
    }
    else
    {
    RemainingDays = daysBetween - 14 ;
    
    }
    System.debug('RemainingDays '+RemainingDays);
        }
        
        for(Order_TagOn_Buyer__c TagOnBuyer: TagOnOrderbuyer)
        {
            CustomResponse person = NULL;
           days =  TagOnBuyer.Order_Tracker__r.DaysFromCreatedDate__c;
            if(TagOnBuyer.Internal_Contact__r.Id != NULL)
            {
                person = 
                    new CustomResponse(TagOnBuyer.Internal_Contact__r.Id,
                                       TagOnBuyer.Internal_Contact__r.Name , RemainingDays );
            }
           /* else
            {
                person = 
                    new CustomResponse(stakeholder.Internal_User__r.Id,
                                       stakeholder.Internal_User__r.Name);
            } */
            
            people.add(person);
        }
        
        return people;
       
    }
    
 
Hi Friends,
         My requirement is , I need to send a email with the document in the attachment related list, as a zip file.  How to add attachment by zippex class,

                       Many thanks in Advance
   
Hi all,
I have one picklist value Status on master object if status value changes from New to Pending i want to prevent user from stop editing child record anyone know how to achieve that..??
Hi Friends,
My requirement is disable the Quick action button after 14 days from the record creation date.There is no option to disable to Lightning quick option button,so i plan to show a popup window i calculated the days between created Date and today date and stored in the wrapper list variable . My problem is I not able  to access the field value in helper from the controller returned List variable. I am new to Lightning .

My component :

<aura:component controller="SelectBuyersController" implements="force:hasRecordId,force:lightningQuickActionWithoutHeader">
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
    <aura:attribute name="recordId" type="Id" />
    <aura:attribute name="people" type="Object[]" />
    <aura:attribute name="selPerson" type="Object" />
    <aura:attribute name="days" type="Decimal" />
    <aura:handler name="change" value="{!v.selPerson}" action="{!c.newPerson}" />
    <aura:attribute name="errorMsg" type="String" />
    <aura:attribute name="alertMsg" type="String" />
    <aura:attribute name="remdays" type="Decimal" />
    <aura:attribute name="orderlist" type="List" />
    <aura:attribute name="includeSender" type="Boolean" default="false" />
    
    <div aura:id="alertmsgform" class="hide" style="font-weight:bold;color:red">
        {!v.alertMsg}
        </div>
    <div aura:id="recordviewform" class="hide">
    <div class="container">
        <header class="slds-modal__header">
            <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">Add Tag On Buyers </h2>
        </header>
        <div style="font-weight:bold;color:red">{!v.errorMsg}</div>
        <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
            <h3>Buyers</h3>
</div>
</div>
</div>


My Lightning Controller:

({
    // Initializing function
    doInit : function(cmp, event, helper) 
    {
    
        helper.getCurrentTagOnBuyers(cmp);
       
    },


My Lightning Helper:

({
    
    getCurrentTagOnBuyers : function(cmp) 
    {
        var recordId = cmp.get("v.recordId");
        
        var action = cmp.get("c.getTagOnBuyers");
        action.setParams({ orderTrackerId : recordId});
        
        
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                var res = response.getReturnValue();
                component.set('v.wraperlist', response.getReturnValue());
                var recordviewform = cmp.find('recordviewform');
                var alertmsgform = cmp.find('alertmsgform');
                cmp.set("v.alertMsg", "TagOn Buyer Only added within 14 days.");
                
                
               
                 if(!res.RemainingDays  < 14)
                {
                    alert('Less days');
                    
                    $A.util.addClass(alertmsgform, 'hide');
                  $A.util.removeClass(recordviewform, 'hide');
                    
                    
                }
               else if(!res.RemainingDays > 14)
                {
                 alert('More days');
                    $A.util.removeClass(alertmsgform, 'hide');
                    $A.util.addClass(recordviewform, 'hide');
                    
                }
});
        
        $A.enqueueAction(action);
        
    },





My Apex controller:
public class SelectBuyersController{

    
    public class CustomResponse
    {
        @AuraEnabled
        public String id = NULL;
        @AuraEnabled
        public String name = NULL;
        @AuraEnabled
        public Decimal RemainingDays ;
        
        
        public CustomResponse(String id, String name, Decimal RemainingDays )
        {
            this.id = id;
            this.name = name;
            this.RemainingDays = RemainingDays;
        }
    }
    
   
    @AuraEnabled
    public static List<CustomResponse> getTagOnBuyers(Id orderTrackerId)
    {
    Decimal days;
   
     Decimal RemainingDays ;
        List<Order_TagOn_Buyer__c> TagOnOrderbuyer= 
            [SELECT Internal_Contact__r.Id, 
                    Internal_Contact__r.Name,Order_Tracker__r.DaysFromCreatedDate__c 
                    FROM Order_TagOn_Buyer__c
             WHERE Order_Tracker__c = :orderTrackerId];
             
        System.debug('Order buyer'+TagOnOrderbuyer);
        
        List<CustomResponse> people = new List<CustomResponse>();
        
        
        List<Order_Tracker__c> OrderTrackerLst= 
            [SELECT Id,name,OwnerId,S_Number__c,Cancel_Date__c,Buyer_Account__c,Buyer_Account__r.name,
             Walkthrough_Expected_Date__c, Walkthrough_Required__c,CreatedDate
             FROM Order_Tracker__c 
             WHERE Id = :orderTrackerId];
        for(Order_Tracker__c OT : OrderTrackerLst )
        {
        Date dueDate = System.today();
    Integer daysBetween = date.valueof(OT.CreatedDate).daysBetween(dueDate);
    System.debug('Days Between'+daysBetween);
    if(daysBetween <= 14)
    {
    RemainingDays = 14 - daysBetween ;
    
    }
    else
    {
    RemainingDays = daysBetween - 14 ;
    
    }
    System.debug('RemainingDays '+RemainingDays);
        }
        
        for(Order_TagOn_Buyer__c TagOnBuyer: TagOnOrderbuyer)
        {
            CustomResponse person = NULL;
           days =  TagOnBuyer.Order_Tracker__r.DaysFromCreatedDate__c;
            if(TagOnBuyer.Internal_Contact__r.Id != NULL)
            {
                person = 
                    new CustomResponse(TagOnBuyer.Internal_Contact__r.Id,
                                       TagOnBuyer.Internal_Contact__r.Name , RemainingDays );
            }
           /* else
            {
                person = 
                    new CustomResponse(stakeholder.Internal_User__r.Id,
                                       stakeholder.Internal_User__r.Name);
            } */
            
            people.add(person);
        }
        
        return people;
       
    }
    
 
Hi Friends,
         My requirement is , I need to send a email with the document in the attachment related list, as a zip file.  How to add attachment by zippex class,

                       Many thanks in Advance