Four Js Development Tools Forum

Discussions by product => Genero BDL => Topic started by: Najmi N. on August 19, 2013, 11:46:01 am



Title: Call microsoft outlook when the field data is email address
Post by: Najmi N. on August 19, 2013, 11:46:01 am
Hi

I'm using latest Genero BDL 2.41. I try to look for solution for form field TEXTEDIT type which stored the email address record ; by click at email address the Genero BDL will open the microsoft outlook and copy the email address into "To sender " column field in outlook.

Example :

   Email Address john.smith@gmail.com

I also look for solution when run the application on GWC via mobile. When the user click at phone number field which contain the person phone number, the GWC will directly make the call to that person. Was there any specific feature in Genero can do this?


Regards
Najmi



Title: Re: Call microsoft outlook when the field data is email address
Post by: Reuben B. on August 20, 2013, 12:05:15 am
One solution is to use a LABEL with the presentation style textFormat set to HTML.  Then it is a case of displaying to this the same HTML you would use in a webpage to trigger the launch of the mail tool, or a phone call.

In your form ...

Code
  1. LABEL f01 = formonly.email_address, STYLE="html";
  2. LABEL f02 = formonly.phone_number, STYLE="html";

In your stylesheet ...
Code
  1. <Style name="Label.html">
  2.   <StlyeAttribute name="textFormat" value="html" />
  3. </Style>

In your 4gl ...

Code
  1. DISPLAY '<a href="mailto:name@example.com">Mail Name</a>' TO email_address
  2. DISPLAY '<a href="tel:99999999">Phone Name</a>" TO phone_number


Hope that helps,

Reuben


Title: Re: Call microsoft outlook when the field data is email address
Post by: Najmi N. on August 20, 2013, 08:32:33 am
Thanks Reuben

I have created as the attach files unfortunately I got an error when doing fglrun.

Program stopped at 'test.4gl', line number 6.
FORMS statement error number -8003.
Dom: A node is inserted somewhere it doesn't belong.
StlyeAttribute

Appreciate an advice


Title: Re: Call microsoft outlook when the field data is email address
Post by: Reuben B. on August 20, 2013, 09:13:55 am
Its a typo on my part.  Should be StyleAttribute.

Also one of the DISPLAY lines, I haven't quite my quotes matching.

Browsers don't have syntax checkers :-)


Title: Re: Call microsoft outlook when the field data is email address
Post by: Najmi N. on August 20, 2013, 11:58:26 am
Thanks Rueben

It's worked. I tested using GDC.

I saw the line statement inside Genero BDL 2.41 documentation that said that this approach only applicable for GDC.

Attach i shared statement.

Another approach to use Edit style attribute with dataTypeHint.

//






Title: Re: Call microsoft outlook when the field data is email address
Post by: Reuben B. on August 21, 2013, 12:14:12 am
...

It's worked. I tested using GDC.

I saw the line statement inside Genero BDL 2.41 documentation that said that this approach only applicable for GDC.

Attach i shared statement.

...






I am surprised the documentation says that, I believe it is incorrect.  If you look inside the Label snippet (FGLASDIR/tpl/SetAjax/Label.xhtml, FGLASDIR/tpl/SetHtml5/Label.xhtml etc) you will see that it refers to the textFormat=html style attribute.