Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field value can be computed from the value of a previous record #2

Closed
inksword opened this issue Aug 19, 2018 · 0 comments
Closed

Field value can be computed from the value of a previous record #2

inksword opened this issue Aug 19, 2018 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@inksword
Copy link
Contributor

inksword commented Aug 19, 2018

After discussion with my colleague, they sometime have to create records based on sequential dates. For example:

  1. record (from: 2018-1-1, to: 2018-1-31)
  2. record (from: 2018-2-1, to: 2018-2-30)
  3. record (from: 2018-3-1, to: 2018-3-31)
  4. and so on...

Initially, I think this could not be possible. But after a second thought, I came up with some immature ideas. I can create some arithmetic expressions along side with a parameter pattern to reference dynamic record such as

  1. $0 (current record)
  2. $1 (the record before current record)
  3. $2 (the record before $1)
  4. and so on...
fields(new Map<String, Object> {
    'StartDate__c' => '{!dates.addDay($1.EndDate__c, 1)}',
    'EndDate__c' => '{!dates.addMonth($1.EndDate__c, 1)}',
    'Bigger__c' => '{!number.add($0.Smaller__c, 10)}'
})

Could this be useful? or it just complicates the generation logic. Anything simpler can be achieved?

@inksword inksword changed the title Value of a field from one record depends on the value from a previous record Field value can be computed from the value of a previous record Aug 20, 2018
@inksword inksword added this to the v1.0.0-beta.1 milestone Aug 24, 2018
@inksword inksword added the enhancement New feature or request label Aug 24, 2018
@inksword inksword self-assigned this Aug 24, 2018
@inksword inksword closed this as completed Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant