Cloning X times a record with specific fields

  • 1
  • Question
  • Updated 2 years ago
  • (Edited)
Hi,

I'm trying to accomplish something and not sure how to proceed.

Part 1) Our Data Entry team often has to enter 6-18 statements in a child object of account named 'Statements'.

those statement record have many fields which contain the same info across all of them, and instead of having them retype info on each or clone record 1 by 1,

I'm trying to find a way using skuid to be able to do either of those 2 scenarios

- a popup in which i basically enter the info that is the same across all records (example  bank name, account number, Related Account ID and the # of Statement I want to create/clone. Then basically Skuid would create # of rows i indicated with the info entered for all of them.

-We create manually the first row/record, and then maybe have a row action with popup to indicate how many times i want to clone this record (and by default it would clone only the fields I need to clone)

These above seem doable, but not sure how to best approach it

Part 2) hard part , if possible, would be for the statement's month to be entered automatically . So we would start with the most recent month and the clone records would go backward from there

Our statement month "date"  always use the first of the month.

So example if the first statement I create with date 9/1/2016, the next one cloned would be 8/1/2016 and the next one 7/1/2016 and so on until the # of cloned record requested is done.

I currently accomplish this with Process builder in salesforce, but often I hit CPU Limit because of it's complexity

In case needed this is the formula i use in order to get "previous calendar months"

One month ago: 
DATE( 
YEAR( Statement_Date__c ) + 
FLOOR((MONTH(Statement_Date__c ) - 1) / 12) - 
IF (MONTH(Statement_Date__c ) <= 1, 
1, 
0), 

MOD((MONTH(Statement_Date__c ) + 12000 - 1 - 1), 12) + 1, 

DAY(Statement_Date__c ) 
)


two months ago:
DATE( 
YEAR( Statement_Date__c ) + 
FLOOR((MONTH(Statement_Date__c ) - 2) / 12) - 
IF (MONTH(Statement_Date__c ) <= 2, 
1, 
0), 

MOD((MONTH(Statement_Date__c ) + 12000 - 2 - 1), 12) + 1, 

DAY(Statement_Date__c ) 
)

Any help/advise would be welcome, even if only to accomplish first part

Thank you



**UPDATE  #1

After playing with it  a little I was able to add a Mass action to create  new row(s) , with some of the field's values from the record i want to clone. I was even able to use my formula fields for previous months, but 1 problem left

The way I see i would need to create 18 different Mass actions and show conditionally the proper one depending on # of Statement to clone field indicated on first row (anywhere from 1 to 18)

There must be a better way?

Thx
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb

Posted 2 years ago

  • 1

Be the first to post a reply!