Hello
I need some support please.
I have set up to send me an email when a record is added.
Everything works well. BUT on a field that is Integer -> Lookup field is only showing me a number (the ID of the raw that i selected).
So i have :
ID Name
1 Ion Marin
2 Cercel Adrian
3 Andrei Victor
And on the email is shows me 2 (the ID). How can i search to table that is Integer and show me directly in email the Name?
Thank you
Integer and email on insert
- aarlauskas
- Veteran Member
- Posts: 127
- Joined: 2019-04-28 18:03
- Location: Medway, UK
Re: Integer and email on insert
Put this at the beginning of your email script, new line for each lookup field (change parent table & field names accordingly). Lets say your field name is: employee
Then where you have your current code for your field put this instead.
Code: Select all
$employee = sqlValue("select PARENT_FIELD_NAME from PARENT_TABLE_NAME where id='{$data['employee']}'");
Then where you have your current code for your field put this instead.
Code: Select all
"Employee Name: $employee \n" .
Re: Integer and email on insert
Thank you verrrrrryyyy muuuuuccccchhhhhh! :X
I have one more question.. please please please :X
So i have 2 fields with Check box. If it is checked in database is 1 and if it is not in 0.
How can i make in email to show me in sted of 1 to be shown YES and if it is 0 to be shown NO in the email ?
I apriciate your help!!!!
I have one more question.. please please please :X
So i have 2 fields with Check box. If it is checked in database is 1 and if it is not in 0.
How can i make in email to show me in sted of 1 to be shown YES and if it is 0 to be shown NO in the email ?
I apriciate your help!!!!
Re: Integer and email on insert
Hi,
try similar top aarlauskas solution (code not tested):
Olaf
try similar top aarlauskas solution (code not tested):
Code: Select all
$checkbox_word = (sqlValue("select CHECKBOX_FIELD from TABLE_NAME where id='{$data['selectedID']}'") == 1 ? 'Yes' : 'No';
Some postings I was involved, you might find useful:
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view