• shivram survase
  • NEWBIE
  • 23 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 7
    Replies
Is it possible to do bulk record update in my Child Record using Process Builder and Flows Combination ?

My Scenario is - Whenever the Account Owner Changes (in Bulk), the related Contact Owners should be changed. 

Can someone help me how to achieve this using Process Builder and Flows Combination ?
<aura:attribute name="native" type="boolean" default="true"/>
    <aura:attribute name="accounts" type="Account[]"/> 
    <div class="pink">
    <table style="width:100%">
        <aura:iteration var="acc" items="{!v.accounts}">
            <aura:if isTrue="{!acc.Id != ' '}">
            <aura:if isTrue="{!v.native}">
            <tr>
                <th>Account Id</th>
                <th>Name</th>
                <th>Country</th>
                <th>City</th>
                <th>Email</th>
            </tr>
                {!v.native}=false;
                 component.set("v.native",'false');
                 {!v.native};

            </aura:if>
            <tr>
                <td>{!acc.Id} </td> 
                   <td>{!acc.Name} </td> 
                   <td>{!acc.Country__c} </td>
                   <td> {!acc.City__c} </td>
                   <td>{!acc.Email__c}</td>            
            </tr>
            </aura:if>
      </aura:iteration>
    </table>  
    </div>

I wanted to set "native" attribute to false  without using the client controller.If anyone having another solution to this problem.
Please share it.
My code is as follow:
public class AccountController {
    @AuraEnabled
    public static List<Account> getAccounts(String accName,String accCountry) {
        List<Account> objAccount = [SELECT Id, Name, Country__c FROM Account where name like '%:accName%' ];
        return objAccount;
    }
    
}

I need to perform searching on 'accName' value as a substring.
Create an Apex class that returns an array (or list) of strings: 
Create an Apex class that returns an array (or list) of formatted strings ('Test 0', 'Test 1', ...). The length of the array is determined by an integer parameter.The Apex class must be called 'StringArrayTest' and be in the public scope.
The Apex class must have a public static method called 'generateStringArray'.
The 'generateStringArray' method must return an array (or list) of strings. Each string must have a value in the format 'Test n' where n is the index of the current string in the array. The number of returned strings is specified by the integer parameter to the 'generateStringArray' method.

MyApexClass to above Challenge:

public class StringArrayTest {
    
    public static List<string> generateStringArray(Integer n)
    {
        List<String> myArray = new List<String>();
        
        for(Integer i=0;i<n;i++)
        {
            myArray.add('Test'+i);
            System.debug(myArray[i]);
        }
        return myArray;
        
    }


It's compile and execute as per requirement in Developer console. But Traihead showing the below error:

Challenge not yet complete... here's what's wrong: 
Executing the 'generateStringArray' method failed. Either the method does not exist, is not static, or does not return the proper number of strings.

Anyhelp would be greatly appreciated. Thanks.