• Ronak L
  • NEWBIE
  • 0 Points
  • Member since 2017
  • Salesforce Developer

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

I'm hoping someone can help with what I think should be quite straightforward to achieve, but it's appearing not so easy..

Basically, I have 2 Objects (I'll call them ParObject and ChldObject).  A specific field change on ParObject should trigger scheduled emails (sent in 3 hours) for ChldObjects with a specific status.

I've created a Flow on the ParObject which is triggered by the field change, and which then updates a field on the ChldObject.
And I've created a Workflow Rule on the ChldObject which picks up the field change from the Flow and sends the Email Alert (using a Timed/Scheduled action).  From what I've read Scheduled Emails can only be sent from Workflow Rules.

I can't get these flows to run correctly. 
If the ParObject flow uses an Update object a CPU limit error is shown when the field is updated by the users.
If the ParObject flow uses a Loop and Update in the loop it hits a governor limit.

I've read that Autolaunched and Screen flows can use a Wait action inside a loop which should get around the governer limits but am not sure how to create this.

Anyone created something like this previously, or got any ideas?

Thanks in advance

 

  • August 13, 2021
  • Like
  • 0
Hi ,
Need to refresh lwc components two independent components .

i used messgae lightning service to pass the value . based on value api call and child components i have data table so how to refresh the page.
AM not using apex class using apex continution . need to auto refresh the LWC.

Can you please help on this.

Thanks
C.Nagarajan
Hello,

If I add the component to my visualfoce page the buttons doesn't work. If I run the component alone it works.

VISUALFORCE PAGE
<apex:page >
    <apex:includeLightning />
    <div id="Con" />
    <script>
        $Lightning.use("c:buttontest_app", function() {
            $Lightning.createComponent(
                "c:buttontest",
                {},
                "Con",
                function(cmp) {
                    console.log("Component is created!");
                    console.log(cmp);
                });
            });        
      </script>
</apex:page>

COMPONENT APP
<aura:application access="GLOBAL" extends="ltng:outApp" >
    <aura:dependency resource="c:buttontest"/>
</aura:application>

COMPONENT
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global">
    
    <lightning:quickActionAPI aura:id="quickActionAPI" />
    
    <aura:attribute name="buttonLabel1" type="String" default="new Event"/>
    <aura:attribute name="objectName1" type="String" default="Contact"/>
    <aura:attribute name="actionName1" type="String" default="new_Event"/>
    <aura:attribute name="variantType1" type="String" default="brand" />
    <aura:attribute name="isButton1" type="Boolean" default="true" />
    
    <aura:attribute name="buttonLabel2" type="String" default="new Task" />
    <aura:attribute name="objectName2" type="String" default="Contact"/>
    <aura:attribute name="actionName2" type="String" default="new_Task" />
    <aura:attribute name="variantType2" type="String" default="brand" />
    <aura:attribute name="isButton2" type="Boolean" default="true" />

    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
    
    <lightning:card>
        <div class="{!'slds-size_' + v.containerSize + '-of-12 slds-form-element'}">
            <div class="container">
                <lightning:layout multipleRows="true">
                    <lightning:layoutItem size="{!v.setSize}" padding="around-small">
                        <aura:if isTrue="{!v.isButton1}">
                            <lightning:button class="{!v.buttonClass}" variant="{!v.variantType1}" label="{!v.buttonLabel1}" onclick="{!c.selectAction1}" />
                        </aura:if>
                    </lightning:layoutItem>
                    <lightning:layoutItem size="{!v.setSize}" padding="around-small">
                        <aura:if isTrue="{!v.isButton2}">
                            <lightning:button class="{!v.buttonClass}" variant="{!v.variantType2}" label="{!v.buttonLabel2}" onclick="{!c.selectAction2}" />
                        </aura:if>
                    </lightning:layoutItem>
                </lightning:layout>
            </div>
        </div>
    </lightning:card>
    
</aura:component>

COMPONENT CONTROLLER
({
    doInit: function (component, event, helper) {
        console.log('Label 1: [' + component.get("v.buttonLabel1") + ']');
        if (component.get("v.buttonLabel1"))
            component.set("v.isButton1", true);
        console.log('Label 2: [' + component.get("v.buttonLabel2") + ']');
        if (component.get("v.buttonLabel2"))
            component.set("v.isButton2", true);
        var calcCount = 12 / parseInt(component.get("v.buttonCount"),10);
        component.set("v.setSize", calcCount);
        if (component.get("v.buttonSize").toLowerCase() == 'full')
            component.set("v.buttonClass", 'slds-size_full');
    },

    selectAction1 : function( component, event, helper) {
        var actionAPI = component.find("quickActionAPI");
        var quickAction = component.get("v.objectName1")+"."+component.get("v.actionName1");
        console.log(quickAction);
        var args = {actionName: quickAction, entityName: component.get("v.objectName1")};
        actionAPI.selectAction(args).then(function(result) {
            var fields = result.targetableFields;
            console.log(fields);            
        }).catch(function(e){
            if(e.errors){
                console.log(e);
            }
        });
    },

    selectAction2 : function( component, event, helper) {
        var actionAPI = component.find("quickActionAPI");
        var quickAction = component.get("v.objectName2")+"."+component.get("v.actionName2");
        console.log(quickAction);
        var args = {actionName: quickAction, entityName: component.get("v.objectName2")};
        actionAPI.selectAction(args).then(function(result) {
            var fields = result.targetableFields;
            console.log(fields);            
        }).catch(function(e){
            if(e.errors){
                console.log(e);
            }
        });
    },

})

Thanks,
Sascha
 
Input Field Resize for LWC
Is it possible to add more # of visible lines from a lightning-input-field inside lightning-record-edit-form?
I imported a long text field from Salesforce object to LWC and I want to increase height (add more number of visible lines) to be displayed in LWC. Currently, the field displays 3 lines and it has something in the bottom right that is used to resize the text field. Could we disable this and add more lines in the text field?
I tried using CSS and inline styling but I still have no luck