Jump to content

Replacing the content of the field


fmbug

This topic is 2108 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi Everyone,

We have a field called "Log History" in every record where we basically store the EmpId of the user with change details, whenever any change taken place. For example, content can be like "

"

Emp 502706627 on 5/15/2018 9:44:48 AM
Emp 504384332 on 5/15/2018 9:44:45 AM changed Project status from  Active to Parking Lot
Emp 501234627 on 5/15/2018 9:37:05 AM
Emp 501234567 on 5/15/2018 9:32:27 AM
Emp 502673233 on 5/15/2018 9:32:23 AM changed Project status from  Active to Parking Lot
Emp 504358927 on 5/15/2018 9:31:49 AM
Emp 5027090927 on 5/15/2018 9:31:34 AM changed Project status from  Active to Parking Lot
Emp 502706627 on 5/6/2018 7:15:33 AM
Emp 502343447 on 5/3/2018 10:21:07 AM

"

Basically we would like to create a script that will replace EmpId with Email Id. 

Project and Employee table are different.

Any help will be highly appreciated. 

Regards,

fmbug

Edited by fmbug
Link to comment
Share on other sites

I'd suggest moving these log entries to a separate audit_trail table, with each entry a record.

Are you asking to substitute the "Emp 502706627" value in this text field with the user's current email? Or, are you asking to start populating the employee's email in this field going forward?

Link to comment
Share on other sites

7 minutes ago, bcooney said:

I'd suggest moving these log entries to a separate audit_trail table, with each entry a record.

Are you asking to substitute the "Emp 502706627" value in this text field with the user's current email? Or, are you asking to start populating the employee's email in this field going forward?

I want to start populating the employee's email in this field. I  have corrected the sequence.

Link to comment
Share on other sites

Not sure what the obstacle is. How do you know the employee ID?  I would think you query the employee table and store it in a $$var on startup. So, switch that $$var to his email. 

Link to comment
Share on other sites

This topic is 2108 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.