• Nevin O'Regan 3
  • NEWBIE
  • 110 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 52
    Questions
  • 81
    Replies
Hi guys,

I've created a custom screen flow and I want to add it to a community page, launched from a custom button on the Homepage. 
The flow guides users through creating a case. I am getting the following error when I add the component to the page: "Action failed: c:CustomCaseCommunityComponent$controller$init [flowData is not defined]"

This is my component. 

<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,forceCommunity:availableForAllPageTypes,force:hasRecordId,force:lightningQuickActionWithoutHeader" access="global">

    <aura:handler name="init" value="{!this}" action="{!c.init}"/>
    <lightning:flow aura:id="flowData"/>
    
</aura:component>


({
init : function (component) {
var flow = component.find(flowData);
flow.startFlow(CaseFlow);
},
})
Hi guys,

I have a custom object called Year__c whis has a picklist field called Period__c which has values 1 - 10. I have built a screen flow which includes the creation of a Year__c object.
Each time a new Year__c record is created I want the Period__c to automatically update with the next picklist value.
How can I do this in a flow?
Hi guys,

I'm looking for some help with a trigger that I have built on a custom object which has a lookup field to itself. 

I object Payment__c has a custom picklist field Payment_Status__c with a value of 'Cleared'. I only want the Recovered_Amt_Ex_VAT__c field of the parent Payment__c to update when the child Payment__c status is updated to 'Cleared'. I have built the below code but it is updating the parent Payment__c regardless of the status.

NOTE: there will be nested child Payment__c scenarios.

//Rolls up the related payment total amounts to parent payment record // 
trigger RecoveredAmountOnPayment on Payment__c (after insert, after update, after delete, after undelete) {
Set<ID> setID = new Set<ID>();
    List<Payment__c> lstPay = new List<Payment__c>();
    
    if(trigger.isinsert || trigger.isundelete){
        for(Payment__c p : trigger.new){
            setID.add(p.Replaced_Payment__c);
        }
    }
    else if(trigger.isDelete){
        for(Payment__c p : trigger.old){
            setID.add(p.Replaced_Payment__c);
        }
    }
    
    else if(trigger.isUpdate){
         for(Payment__c p : trigger.new){
            if(p.Replaced_Payment__c != null){
                if(trigger.oldmap.get(p.id).Replaced_Payment__c != p.Replaced_Payment__c){
                    setID.add(p.Replaced_Payment__c);     
                }
            } 
            setID.add(trigger.oldmap.get(p.id).Replaced_Payment__c);
         }
    }
    if(setid.size() > 0){
        lstPay = [Select id,Recovered_Amt_Ex_VAT__c ,(Select id,Payment_Amount__c from Replaced__r) from Payment__c where id IN : setID];
    }
    for(Payment__c pay : lstPay){
        Decimal val = 0;
        for(Payment__c rep : pay.Replaced__r){
            
            val += rep.Payment_Amount__c;
            
        }
        pay.Recovered_Amt_Ex_VAT__c = val;
    }
    update lstPay;
}

 
Hi guys, 

My users would like to be able to create Accounts from the Home Page. I have created a simple custom button component which I have added to the page but I am unable to get the a working syntax for controller.

Has anyone configured something similar in the past?

User-added image
Hi guys,

I have a custom object called Payment__c, which has a lookup field to itself. I have a custom field called Replaced_Amount__c which I want to sum up the total amount of related payment records. I think the only way of doing this is through a trigger.

I have seen a lot of answers in the community on how to achieve a similar requirement but I haven't seen one where the object has a lookup to itself. 

Could anyway help me with this?
Hi guys,

I'm looking to build an Autolaunch Flow which will update a lookup field in the OpportunityLineItemsSchedule object when a field has been update on another object.
I have created a custom object Pronto__c which is a placeholder for inbound data from an external database. I have a custom field on this object called LineItemScheduleId__c. The data coming from the external database also includes the recordId of the OpportunityLineItemSchedule record. Once the LineItemScheduleId__c is updated I want the Pronto__c record to link the the correct OpportunityLineItemSchedule record.
Can anyone guide me with the correct steps I need to take to get this to work using Flow and Process Builder?
Hi guys,

I created an AutoLaunch flow in my sandbox, along with the Process Builder. It works perfectly in the sandbox but when I deploy it, it doesn't work. 
I have activated both the Flow and the Process Builder.

Anyone any ideas?
Hi guys, 

I'm looking to try and build a custom button which creates a new record and also update a value in another record.
The object in question is a custom object called Payment. The purpose of this button is to allow users replace a payment with another payment. So if a user clicks on this button from within a payment record they will input the field values of the new payment record and the status value of the payment record from which the action was triggered will update to 'Replaced'. 
Is this possible through Quick Actions or Buttons and could anyone help me with it?
I have a custom object called Year__c which is related to the Opportunity object.
On the Opp object I have a custom picklist field Period__c where has values 1 to 10. 
What I am trying to do is to automatically create Year__c records based on the Period__c picklist field. So if a user selects the value "2" in the Period__c field then I would like 2 Year__c records to be created.
Along with this I have a Start Date and End Date on the Opportunity and on the Year__c object. I need the Start Date in Year 1 record to = the Start Date on the Opportunity, the end Date should be 12 months after the Start Date on Year 1. On Year 2 the Start Date should be the day of the End Date of Year 1 and the End Date of Year 2 should = the End Date of the Opportunity. 

Would anyone be able to help me with this?
Hi guys,

I have created 12 custom number fields in the OppLineItem, each labeled a month of the year. I have also created a custom formula text field in the OppLineItemSchedule object called Month which defines the month based on the scheduled date.
I am trying to create a trigger to map the Quantity value from the related OppLineItemSchedule record to the relevant OppLineItem Month field. I have created the below trigger but the issue is that it is populating every Month field on the OppLineItem with a value even if there is not a related OppLineItemSch Quantity. 

trigger MapMontsOnSchedule on OpportunityLineItemSchedule (after insert, before update) {
    Map<Id,Integer> MapMonths = new Map<Id, Integer>();
 
    for(OpportunityLineItemSchedule sch:trigger.new) {
         MapMonths.put(sch.OpportunityLineItemId, Integer.valueOf(sch.Quantity));
    }
 
    List<OpportunityLineItem> OppLineItemList = new List<OpportunityLineItem>();
 
    for(OpportunityLineItem oli:[Select id, January__c, 
                                            February__c, 
                                            March__c, 
                                            April__c, 
                                            May__c, 
                                            June__c, 
                                            July__c, 
                                            August__c, 
                                            September__c, 
                                            October__c, 
                                            November__c,
                                            December__c From OpportunityLineItem Where Id IN :MapMonths.Keyset()])
    {
        if(MapMonths.containsKey(oli.id))
        {
            OppLineItemList.add(new OpportunityLineItem(Id = oli.id, January__c=MapMonths.get(oli.id), 
                                                                     February__c=MapMonths.get(oli.id),
                                                                        March__c=MapMonths.get(oli.id), 
                                                                     April__c=MapMonths.get(oli.id),
                                                                     May__c=MapMonths.get(oli.id),
                                                                     June__c=MapMonths.get(oli.id),
                                                                     July__c=MapMonths.get(oli.id),
                                                                     August__c=MapMonths.get(oli.id),
                                                                     September__c=MapMonths.get(oli.id),
                                                                     October__c=MapMonths.get(oli.id),
                                                                     November__c=MapMonths.get(oli.id),
                                                                     December__c=MapMonths.get(oli.id)));
                                                                                    
        }
    }
    update OppLineItemList;
}