Page 1 of 1

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

Posted: 2017-11-05 13:20
by Sai chi
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?

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

Posted: 2017-11-19 07:44
by Abeer
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.

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

Posted: 2017-11-24 05:59
by Sai chi
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.

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

Posted: 2017-12-10 09:44
by R Tammam
Hello Sai chi,
i think you can insert your automatic values in one of hooks function like before insert

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

Posted: 2017-12-10 10:00
by Sai chi
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?

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

Posted: 2017-12-12 17:29
by R Tammam
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

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

Posted: 2017-12-24 10:04
by Sai chi
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?

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

Posted: 2017-12-26 20:56
by R Tammam
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

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

Posted: 2017-12-27 22:49
by R Tammam
i want just add little thing to the ubove query messagefield='{$message}' where id='{$data['selectedID']}'

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

Posted: 2017-12-29 11:59
by Sai chi
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.

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

Posted: 2017-12-29 12:00
by Sai chi
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.

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

Posted: 2017-12-29 12:19
by Sai chi
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'] ?

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

Posted: 2018-01-13 22:53
by R Tammam
no ,the sql query must be written in after add or after update hook function

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

Posted: 2018-01-13 22:54
by R Tammam
no ,the sql query must be written in after add or after update hook function

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

Posted: 2018-01-20 15:03
by Sai chi
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.

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

Posted: 2018-02-04 09:50
by Sai chi
Hi Tamman

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

Thanks.

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

Posted: 2018-02-25 04:56
by R Tammam
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 ?