- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2017 08:26 AM
We have a requirement to update a flag x on the user record depending on the value on another field y.
We have 3 options:
1) Write a after BR which executes when the record is updated or inserted and update the flag x depending on y flag - Will get called with every update
2) Scheduled job (nightly) which will run right after the the user records are transformed and get all the records where field y is changed and set the flag x.
3) Write an on After transform script - This might delay the transform
Performance wise which one is better, thoughts ?
Thanks,
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2017 08:18 AM
What you propose is perfectly do-able in the transform map script. You don't need an additional business rule. That's just overhead that can slow down your import.
target.x is available because it's part of sys_user. source.x is what came in from the import.
if (source.x == '1' || source.x == '2' || source.x == '3') {
target.y = true;
} else {
target.y = false;
}
Something like that sounds like a simple approach to what you described. Just make sure "Y" isn't in the field mapping.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2017 04:07 PM
Ravali,
My first question is are the fields X and Y are mapped from the imported data? You can use Transform Maps and Transform scripts in your nightly job to set fields X and Y. That is a cleaner way of doing it as it does not need an extra scheduled job or a Business rule.
The following thread should help with sequence of Transform scripts
Sequence of transform scripts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2017 07:46 AM
Field X is updated via transform, but field Y need to get updated based on X. I need to understand if value is X on the target record be available before Y field map is written as they belong to same transform map.
if(target.X == 'something')
{
target.Y == 'true';
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2017 07:51 AM
Yes, you can do that in the transform script. The record isn't written until the transform is complete.
For what it's worth 'true' is not the same as true. The first is a string and the second is a boolean value. Be careful when making statements like
target.Y = 'true';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2017 09:46 AM
If the value of X is not effective until the entire row transformation is complete, then I cannot do the transform way as per your answer Chuck
!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2017 10:33 AM
Is X on the same import record as Y? Is it part of the source or part of the target? Some specifics would be helpful.
Example: I am importing records from LDAP to sys_user. I want to set the active field based on the incoming field "termination_date". If the termination date is empty, set active=true, otherwise set active=false.