Re: WritePro letter emailed to MS Outlook

2018-10-03 Thread Allan Udy via 4D_Tech

Hi Pat,
I'd suggest that you try using SMTP_Quicksend instead of the 
lower-level SMTP functions. Read up on SMTP_Quicksend and I think 
you'll find that you can do everything you need with that, and (in our 
pretty thorough testing) it sends emails that are accepted by Outlook, 
Yahoo, Gmail, Mail, and others.


Thanks for your reply.

We already have Write Pro letters going out using smtp_quicksend which 
are received correctly formatted as you note.


The issue is that smtp_quicksend does not allow for the sending of 
attachments hence the reason we are using smpt_body in some cases.




On Wed, 3 Oct 2018 at 21:26, Allan Udy (Golden Micro) via 4D_Tech 
<4d_tech@lists.4d.com > wrote:


Hi all,

We have an issue sending a Write Pro letter in the body of an
email to
Microsoft Outlook.

1. We export the Write Pro object into a variable:

*   WP EXPORT VARIABLE*($PrintLetter;$Email_Body;wk web page
html 4D)


2. Then we use IC's SMTP_body to build the body of the email,
specifying
that the format is HTML  ie option = 4

*/   SMTP_Body/* ($SMTP_ID;$Email_Body;4)


3. When this email is sent out, email clients such as Apple Mail
receive
the body correctly formatted.  However the body of the email in
Microsoft Outlook clients shows as Times New Roman, and some of the
other formatting of the document is lost.

Can anyone tell us how to get Microsoft Outlook to honour the
formatting



Cheers,
Allan Udy

Golden Micro Solutions Ltd, Blenheim, New Zealand
http://www.golden.co.nz

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: v13 - Relate One Selection issue

2018-10-03 Thread Timothy Penner via 4D_Tech
Hi Doug,

The latest post from Thomas Maul talking about Query By Formula that I find on 
the forums is from June:
http://forums.4d.com/Post/EN/24801062/1/24823734#24823734
^ this post is restricted to people with access to the R-releases.

Here is a full list: 
http://forums.4d.com/List_Message/EN:0/0/1/1/1/1/0/0/3985/1/-1/461451/1/0/0/0/0/352298223

Are you sure it wasn’t the blog post I referred to?

I am pretty sure you are referring to the blog post about driving with the 
parking brake on:
https://blog.4d.com/compatibility-settings-or-driving-with-the-parking-break-onpart-1/

-Tim


**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: v13 - Relate One Selection issue

2018-10-03 Thread Douglas von Roeder via 4D_Tech
Tim:

Thanks for posting those but I was thinking that it was a posting on the 4D
Forum. He posts some gems there.

Good links. Something to read and re-read.

--
Douglas von Roeder
949-336-2902


On Wed, Oct 3, 2018 at 3:34 PM Timothy Penner  wrote:

> > Thomas Maul posted a valuable, lengthy message about QbF on the 4D Forum
> that extolled its virtues. IIRC, he suggested using QbF if your query had
> two or more search clauses. (I've tried to find the posting recently and
> not been able to — if anyone finds it, it would be a great post to link to.)
>
>
> https://blog.4d.com/compatibility-settings-or-driving-with-the-parking-break-onpart-1/
>
> https://blog.4d.com/compatibility-settings-use-period-and-comma-as-placeholders-part-2/
>
> -Tim
>
>
>
> Timothy Penner
> Senior Technical Services Engineer
>
> 4D Inc
> 95 S. Market Street, Suite #240
> San Jose,CA 95113
> United States
>
> Telephone: +1-408-557-4600
> Fax:   +1-408-271-5080
> Email: tpen...@4d.com
> Web:   www.4D.com
>
>
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: v13 - Relate One Selection issue

2018-10-03 Thread Timothy Penner via 4D_Tech
> Thomas Maul posted a valuable, lengthy message about QbF on the 4D Forum that 
> extolled its virtues. IIRC, he suggested using QbF if your query had two or 
> more search clauses. (I've tried to find the posting recently and not been 
> able to — if anyone finds it, it would be a great post to link to.)

https://blog.4d.com/compatibility-settings-or-driving-with-the-parking-break-onpart-1/
https://blog.4d.com/compatibility-settings-use-period-and-comma-as-placeholders-part-2/

-Tim



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: WritePro letter emailed to MS Outlook

2018-10-03 Thread Pat Bensky via 4D_Tech
Alan,
I'd suggest that you try using SMTP_Quicksend instead of the lower-level
SMTP functions. Read up on SMTP_Quicksend and I think you'll find that you
can do everything you need with that, and (in our pretty thorough testing)
it sends emails that are accepted by Outlook, Yahoo, Gmail, Mail, and
others.
Pat

On Wed, 3 Oct 2018 at 21:26, Allan Udy (Golden Micro) via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi all,
>
> We have an issue sending a Write Pro letter in the body of an email to
> Microsoft Outlook.
>
> 1. We export the Write Pro object into a variable:
>
> *   WP EXPORT VARIABLE*($PrintLetter;$Email_Body;wk web page html 4D)
>
>
> 2. Then we use IC's SMTP_body to build the body of the email, specifying
> that the format is HTML  ie option = 4
>
> */   SMTP_Body/* ($SMTP_ID;$Email_Body;4)
>
>
> 3. When this email is sent out, email clients such as Apple Mail receive
> the body correctly formatted.  However the body of the email in
> Microsoft Outlook clients shows as Times New Roman, and some of the
> other formatting of the document is lost.
>
> Can anyone tell us how to get Microsoft Outlook to honour the formatting?
>
>
>
> Cheers,
> Allan Udy
>
> Golden Micro Solutions Ltd, Blenheim, New Zealand
> http://www.golden.co.nz
>
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **



-- 
*
CatBase - Top Dog in Data Publishing
tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Defining and documenting Objects

2018-10-03 Thread Aparajita Fishman via 4D_Tech
> BTW, I mimicked the OT GetArrayLong/Text/Date* commands and the Find in
> array command from Object Tools in my copy of OBJ_Module. The approach that
> I took was to extract the array from the object and do a find in array and
> I was thinking that, perhaps, that would incur a penalty. I don't have the
> metrics handy but, until it got into the thousands of hits, the operation
> was essentially instantaneous. And the reason, as 4D has pointed out over
> the years, is that we're dealing with references to data not the actual
> data itself so it's not a question of moving data in memory.

You *are* moving memory if you extract the array from an object. Not a huge 
amount, but not nothing. I’m not sure what the motivation was for implementing 
those commands yourself, but whatever.

- Aparajita
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: v13 - Relate One Selection issue

2018-10-03 Thread Chip Scheide via 4D_Tech
Thanks Doug, and Arnaud

The issue was one or more damaged indexes. After a repair everything 
seems to be working as it should.

Thanks for the insight into QbF, I'll look into it.

Chip

On Wed, 3 Oct 2018 09:21:19 -0700, Douglas von Roeder via 4D_Tech wrote:
> If you check the checkboxes in the Compatability tab so that Query by
> formula uses SQL joins, you can traverse the many to many using Query by
> formula. You'll want to run QbF on the server, as well.
> 
> Once that's set up, QbF becomes a very powerful tool.
> 
> Thomas Maul posted a valuable, lengthy message about QbF on the 4D Forum
> that extolled its virtues. IIRC, he suggested using QbF if your query had
> two or more search clauses. (I've tried to find the posting recently and
> not been able to — if anyone finds it, it would be a great post to 
> link to.)
> 
> --
> Douglas von Roeder
> 949-336-2902
> 
> 
> On Wed, Oct 3, 2018 at 5:57 AM Arnaud de Montard via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> 
>>> Le 2 oct. 2018 à 20:10, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com>
>> a écrit :
>>> 
>>> [...]
>>> 
>>> I ask because it is not, even after a restart of 4D
>> 
>> The doc says it should:
>> "The RELATE ONE SELECTION command creates a new selection of records for
>> the table oneTable, based on the selection of records in the table
>> manyTable and *** loads the first record of the new selection as the
>> current record ***."
>> 
>> I'd try something like this:
>> 
>> 
>>  
>> 
QUERY([Sample_Animal_Link];[Sample_Animal_Link]Sample_ID=[Samples]Sample_ID)
>>  If(found records([Sample_Animal_Link])>0)
>>RELATE ONE SELECTION([Sample_Animal_Link];[Animal])
>>If(found records([Animal])>0)
>>  ASSERT([Animal]primaryKey not empty)
>>End if
>>  End if
>> 
>> Or [Sample_Animal_Link] orphan of animal?
>> 
>> BTW:
>>//given a [Samples] selection
>>  RELATE ONE SELECTION([Samples];[Animal])
>> //Samples..Sample_Animal_Link..Animal
>> This use of RELATE ONE SELECTION is not documented but works (or used to
>> work, it's a while since I didn't try)
>> 
>> --
>> Arnaud de Montard
>> 
>> 
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Defining and documenting Objects

2018-10-03 Thread Kirk Brooks via 4D_Tech
Paul,
You touch on an excellent point about using objects. At the heart of it is
your naming convention. We haven't had to worry about naming too much in
the past. Variable names aren't case sensitive and you could always use the
COMPILER_ methods to document the IP and process variables. And the same is
true for the object variables themselves.

When it comes to the properties (or keys as in key:value) it's a different
story. Starting with them being case sensitive. I find a difference in how
I handle this between being able to handle native dot notation and not. The
difference being in v15 I used constants for (not IP vars) key names. You
can still do this in v17 but it's less useful. Looking through some
projects here are the main schemes I use for documenting how an object is
structured.

1) a disk file
Add a folder to Resources and keep templates for various objects there. Or
a single file with templates listed as objects. I do this for large
templates, for objects with lots of default data, for objects I want to be
able to configure for specific instances and for objects defined by some
other service I communicate with. Reading them is fast. Fast enough to use
when loading a form, for example, though obviously I wouldn't do this
inside a loop.

Working with large objects benefits by being able to open them in my text
editor. A line like:

$account_id:=$obj.source.data[2].customer.preferences.account.number

is easier for me when I can be looking at the object. Especially if it's
from some other source (like a API call).

2) in the method header
Perfect for defining keys as parameters.

// MyMethod (object)

// $1: { date: , person_id: , query_str: }

Handy because it pops up in the method editor to remind me what the keys
are.

I also do this to document moderate sized objects returned by a method.

3) initialization or getter methods

$obj:=Address_get_object

where the method initializes the object. This could include reading a disk
file or simply defining the object in code. Frequently I write these to
include an optional param for the key value of a record so it either
returns an empty object or a specific record. With a complementary SAVE
method it's a good way to manage record data.

4) readMe files for each module
Module? Addresses for example. I'd make a folder in Home named ADDRESS and
a method named Address_readMe. This method is where I make notes about
what's important and explain what is supposed to be going on. Like naming
conventions for addresses and the structure of objects.

Like I said at the start a good naming convention is your friend.
Especially in v17. Decide for yourself how you are going to manage key
names. Basically this comes down to camelCase or snake_case. The first
character of the name must be a letter, underscore or $. Decide what $ and
_ mean and be consistent. Avoid "stringly_typing" : using the key to imply
metadata like type, usage etc. These things are totally mutable in an
object. It can seem like a good idea in the short term but will bite you
eventually.

And don't forget you have JSON Validate. Validation schemas can be quite
complex but they don't have to be. Again, you can include a validation
document(s) in the Resources folder to check critical objects against
before using.

I encourage you to just begin working with them. When you find yourself
getting bogged down take a step back because you are likely trying to use
these new tools incorrectly. This is the hardest thing for long time 4D
devs - things we've done a certain way for years can be done with the new
tools a different, easier way.

Objects and collections are the gateway drug to ORDA and your programming
life will never be the same again.

Hope this helps.

On Wed, Oct 3, 2018 at 6:02 AM Paul Dennis via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> We have not started using objects in our application but I can see how they
> could be useful. However where I am struggling is how we are supposed to
> keep documentation as to the object definition. With database structure you
> can clearly see the definition of the table and fields and these are
> available in the method editor for lookup.
>
> Am I missing something as it seems to me that it would be very easy to get
> in a mess as to definition and contents of an object.  Would appreciate
> feedback as to have everyone is managing this. We are using V16 R6.
> Thanks
> Paul
>
>
>
> --
> Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **



-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
4D Internet 

Defining and documenting Objects

2018-10-03 Thread Paul Dennis via 4D_Tech
We have not started using objects in our application but I can see how they
could be useful. However where I am struggling is how we are supposed to
keep documentation as to the object definition. With database structure you
can clearly see the definition of the table and fields and these are
available in the method editor for lookup.

Am I missing something as it seems to me that it would be very easy to get
in a mess as to definition and contents of an object.  Would appreciate
feedback as to have everyone is managing this. We are using V16 R6.
Thanks
Paul



--
Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: v13 - Relate One Selection issue

2018-10-03 Thread Arnaud de Montard via 4D_Tech

> Le 2 oct. 2018 à 20:10, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> [...]
> 
> I ask because it is not, even after a restart of 4D

The doc says it should:
"The RELATE ONE SELECTION command creates a new selection of records for the 
table oneTable, based on the selection of records in the table manyTable and 
*** loads the first record of the new selection as the current record ***."

I'd try something like this:

 QUERY([Sample_Animal_Link];[Sample_Animal_Link]Sample_ID=[Samples]Sample_ID)
 If(found records([Sample_Animal_Link])>0)
   RELATE ONE SELECTION([Sample_Animal_Link];[Animal])
   If(found records([Animal])>0)
 ASSERT([Animal]primaryKey not empty)
   End if
 End if

Or [Sample_Animal_Link] orphan of animal?

BTW:
   //given a [Samples] selection
 RELATE ONE SELECTION([Samples];[Animal])  //Samples..Sample_Animal_Link..Animal
This use of RELATE ONE SELECTION is not documented but works (or used to work, 
it's a while since I didn't try)

-- 
Arnaud de Montard 



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**