How to show my update message in the field that shows with editing date, time and editor name?

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
Sai chi
Posts: 19
Joined: 2017-08-26 15:29

How to show my update message in the field that shows with editing date, time and editor name?

Post by Sai chi » 2017-11-05 13:20

I set the data type to long text
Default to <%%editingDateTime%%><%%editorUsername%%>


the field is shown nothing but just the message I type.
I need to type my message into the field that shows my message together with editing date & time, & editor name for each message, so my company can following in future. the attachment also was shown my setting, what is wrong?
Attachments
editor name date time.jpg
editor name date time.jpg (128.8 KiB) Viewed 3234 times

Abeer
Posts: 18
Joined: 2017-03-12 09:19

Re: How to show my update message in the field that shows with editing date, time and editor name?

Post by Abeer » 2017-11-19 07:44

I think you should first set update_Info field to read only so it takes its value automatically when any record is updated, and then you should separate your message in a different field.

Sai chi
Posts: 19
Joined: 2017-08-26 15:29

Re: How to show my update message in the field that shows with editing date, time and editor name?

Post by Sai chi » 2017-11-24 05:59

I need to show: Example

The message is "Price is 7.8 Million" show editing date, time and editor name beside this message.

How?

I had set it to read-only field but it just showed the date or time without my message that is no use for me, how can it showed both for each of my update.

R Tammam
Veteran Member
Posts: 113
Joined: 2017-08-26 15:35

Re: How to show my update message in the field that shows with editing date, time and editor name?

Post by R Tammam » 2017-12-10 09:44

Hello Sai chi,
i think you can insert your automatic values in one of hooks function like before insert

Sai chi
Posts: 19
Joined: 2017-08-26 15:29

Re: How to show my update message in the field that shows with editing date, time and editor name?

Post by Sai chi » 2017-12-10 10:00

what kinds of Automatic value? like

$data['total'] = $data['quantity'] * $data['unit_price'];

any example codes that can show the edit time and editor name for each of update?

R Tammam
Veteran Member
Posts: 113
Joined: 2017-08-26 15:35

Re: How to show my update message in the field that shows with editing date, time and editor name?

Post by R Tammam » 2017-12-12 17:29

for each update or insert , you can inject this code where you have your insert query

you can get the date or time of the edit time using php date() function and it get time also
to get information of the editor (user who edited) you can use $memberInfo which is an argument of after update function
and to get the user name use
$memberInfo['username']
also you can get all getMemberInfo() fields in
http://bigprof.com/appgini/help/advance ... Info-array

now you have all your data ready to be inserted (date or time , user who updated)
so now you need to append them to your message

if you will insert $message append the rest if parameters to it (date or time , user who updated)

$message.=$time.$user

i hope that helps you

Sai chi
Posts: 19
Joined: 2017-08-26 15:29

Re: How to show my update message in the field that shows with editing date, time and editor name?

Post by Sai chi » 2017-12-24 10:04

My Code is the following

function Property_after_update($data, $memberInfo, &$args){


getMemberInfo()

$data['UpdateInfor']=$message.

$message.=$time.$user

return TRUE;

or I tried this

getMemberInfo()

$data['UpdateInfor']=$time.$user

Both are not working and the whole system is no run, why?
my message field is "UpdateInfor" and all users have to show their (date or time, user who updated) so getMemberInfo() shall be applied

http://bigprof.com/appgini/help/advance ... Info-array
this link doesn't show an example where shall I find an example code?

R Tammam
Veteran Member
Posts: 113
Joined: 2017-08-26 15:35

Re: How to show my update message in the field that shows with editing date, time and editor name?

Post by R Tammam » 2017-12-26 20:56

Hello Sai chi ,

i think you are in the right way through this example


return TRUE;

but it will need some modifications

$user=$memberInfo['username'] ;
$time=//you can get it through php function
$data['UpdateInfor']=$message;
$message.=$user.$time

now you have the message ready to be update the message field of this table
i mean that you will need to make a sql query to update the message field using the $message
something like
update Property set messagefield=$message where id=$data['selectedID']

i hope it would help you

R Tammam
Veteran Member
Posts: 113
Joined: 2017-08-26 15:35

Re: How to show my update message in the field that shows with editing date, time and editor name?

Post by R Tammam » 2017-12-27 22:49

i want just add little thing to the ubove query messagefield='{$message}' where id='{$data['selectedID']}'

Sai chi
Posts: 19
Joined: 2017-08-26 15:29

Re: How to show my update message in the field that shows with editing date, time and editor name?

Post by Sai chi » 2017-12-29 11:59

Hi Tamman

Something I am not sure about

getMemberInfo() gets all login users name that can be shown in my field "UpdateInfor" right? if yes: shall I write getMemberInfo ([memberID or membername])?

$time=//you can get it through php function (shall I write "Stime.=toMySQLDate.time12" ? )

do you mean the sql query is in the main software, the lookup field (advanced lookup options)? so I need to add messagefield=$message id=$data['selectedID'] ?

did you mean messagefield=$message convent to my codes "UpdateInfor=$message" or $data['UpdateInfor']=$message ?

thanks for your reply and help.

Sai chi
Posts: 19
Joined: 2017-08-26 15:29

Re: How to show my update message in the field that shows with editing date, time and editor name?

Post by Sai chi » 2017-12-29 12:00

Hi Tamman

Something I am not sure about

getMemberInfo() gets all login users name that can be shown in my field "UpdateInfor" right? if yes: shall I write getMemberInfo ([memberID or membername])?

$time=//you can get it through php function (shall I write "Stime.=toMySQLDate.time12" ? )

do you mean the sql query is in the main software, the lookup field (advanced lookup options)? so I need to add messagefield=$message id=$data['selectedID'] ?

did you mean messagefield=$message convent to my codes "UpdateInfor=$message" or $data['UpdateInfor']=$message ?

thanks for your reply and help.

Sai chi
Posts: 19
Joined: 2017-08-26 15:29

Re: How to show my update message in the field that shows with editing date, time and editor name?

Post by Sai chi » 2017-12-29 12:19

do you mean the sql query is in the main software, the lookup field (advanced lookup options)? so I need to add messagefield=$message id=$data['selectedID'] ?
Attachments
sql.jpg
sql.jpg (153.67 KiB) Viewed 2920 times

R Tammam
Veteran Member
Posts: 113
Joined: 2017-08-26 15:35

Re: How to show my update message in the field that shows with editing date, time and editor name?

Post by R Tammam » 2018-01-13 22:53

no ,the sql query must be written in after add or after update hook function

R Tammam
Veteran Member
Posts: 113
Joined: 2017-08-26 15:35

Re: How to show my update message in the field that shows with editing date, time and editor name?

Post by R Tammam » 2018-01-13 22:54

no ,the sql query must be written in after add or after update hook function

Sai chi
Posts: 19
Joined: 2017-08-26 15:29

Re: How to show my update message in the field that shows with editing date, time and editor name?

Post by Sai chi » 2018-01-20 15:03

Hi Tamman

Something I still not get it

getMemberInfo() gets all login users name that can be shown in my field "UpdateInfor" right? if yes: shall I write getMemberInfo ([memberID or membername])?

$time=//you can get it through php function (shall I write "Stime.=toMySQLDate.time12" ? )


did you mean messagefield=$message convent to my codes "UpdateInfor=$message" or $data['UpdateInfor']=$message ?

thanks for your reply and help.

Sai chi
Posts: 19
Joined: 2017-08-26 15:29

Re: How to show my update message in the field that shows with editing date, time and editor name?

Post by Sai chi » 2018-02-04 09:50

Hi Tamman

I still wait for your reply, can you answer my above question?

Thanks.

R Tammam
Veteran Member
Posts: 113
Joined: 2017-08-26 15:35

Re: How to show my update message in the field that shows with editing date, time and editor name?

Post by R Tammam » 2018-02-25 04:56

Hello sai ,
i read the thread over and over and i feel confused so , could you please tell me what exactly you have in the table and what you want to have ?

Post Reply