Re: ORDA/Collections

2019-10-30 Thread Cannon Smith via 4D_Tech
Hi Justin, Have you taken a look at the extract function on collections? I think it would do what you want. -- Cannon.Smith Synergy Farm Solutions Inc. Aetna, AB Canada > On Oct 30, 2019, at 2:45 PM, Justin Will via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > $oRecs:=ds.Complex.query("Doma

Re: ORDA/Collections

2019-10-30 Thread Keisuke Miyako via 4D_Tech
"For each" loop is a good place to start. once you've familiarised yourself with collections and objects, you might want to look into collection methods such as map() for this kind of work. 2019/10/31 9:11、Justin Will mailto:jw...@willwerks.com>>のメール: I couldn't seem to get Selection To JSON wi

RE: ORDA/Collections

2019-10-30 Thread Justin Will via 4D_Tech
I couldn't seem to get Selection To JSON with a template to do what I wanted to. I ended up writing this and it fits the bill. For each ($oRec;$oRecs) $oComplex:=New object $oComplex.key:=$oRec.ID $oComplex.label:=$oRec.Name $oComplex.open:=True ARRAY OBJ

Re: ORDA/Collections

2019-10-30 Thread Keisuke Miyako via 4D_Tech
rather than using ORDA, you could use classic QUERY and call Selection to JSON with a template. https://doc.4d.com/4Dv15/4D/15.6/Selection-to-JSON.301-3817892.en.html the feature allows you rename and reorder your selection of fields however way you like. > 2019/10/31 5:45、Justin Will via 4D_Te

Re: ORDA/Collections

2019-10-30 Thread Kirk Brooks via 4D_Tech
Justin, The replace string approach is not what you want to do. Editing strings and mapping data are not the same thing. You also want to avoid hard coding such maps. Any little change and you have to change code. A fairly easy way to manage what you need to do is save an entity as a stringified J

ORDA/Collections

2019-10-30 Thread Justin Will via 4D_Tech
I need a json object output in a particular format and 4D's new datastore and collections do this out of the box in 3 lines of code for me. It's almost magical. $oRecs:=ds.Complex.query("Domain_ID = :1";_Domain_ID) $coll:=$oRecs.toCollection("ID, Name, Facilities.ID, Facilities.Name") $vtReturn

[solution] printing PDFs on windows from 4D

2019-10-30 Thread Chuck Miller via 4D_Tech
Hi All There is a program named PDFtoPrinter.exe which I am using to print PDFs on windows from cmd using LEP form inside 4D If the files desired do not print correctly, you will need to download PDF Exchange and print PDF form there. When it prints and is sized correctly, you will need to exp

RE: Deprecated constants

2019-10-30 Thread Timothy Penner via 4D_Tech
Hi David, > For example, _o_Index compacting is not mentioned. The "_o_Index compacting " constant was part of SET/GET DATABASE PARAMETER and it looks like it was already disabled in v11... Here is a snippet from the v11 Language Reference page 168 showing it as "selector disabled": https://im

Re: Components and external data

2019-10-30 Thread Tim Nevels via 4D_Tech
On Oct 30, 2019, at 2:00 PM, Chip Scheide wrote: > Given the following situation: > [Host_Database] <- [component] -> [external_for_Component] > > - in the case of client/server how is the external database managed? > -- would I place it in the component's resource folder? You could if you wante

Re: Components and external data

2019-10-30 Thread Chip Scheide via 4D_Tech
Patrick, THANKS! Chip On Wed, 30 Oct 2019 11:08:35 -0700 (MST), Patrick Emanuel via 4D_Tech wrote: > > Hi, > I understand that if a component needs to have access to 1 or more > tables there are 2 ways to do this: > - Inject the table definition(s) into the host > - USE DATABASE and connect to

Components and external data

2019-10-30 Thread Patrick Emanuel via 4D_Tech
Hi, I understand that if a component needs to have access to 1 or more tables there are 2 ways to do this: - Inject the table definition(s) into the host - USE DATABASE and connect to an external database/datafile. I have some questions about using external databases in the context of a compone

Re: VP IMPORT DOCUMENT in v17R6

2019-10-30 Thread Jeremy Roussak via 4D_Tech
Chip, Thanks, but using a POSIX path produces an error. Jeremy > On 30 Oct 2019, at 14:44, Chip Scheide <4d_o...@pghrepository.org> wrote: > > Try using Posix - I know you should not have to > follows a posix converter - 4D's (at least as of v15 is > incomplete/incorrect) > > > //fileut

Deprecated constants

2019-10-30 Thread David Rose via 4D_Tech
Is there a list of all deprecated constants, and how to replace them, in the knowledgebase or 4D Docs? I'm referring to all constants that show up as "_o_ ..." in v17. I don't think this page is complete: https://doc.4d.com/4Dv17R6/4D/17-R6/Deprecated-or-removed-features-in-v17-product-range.200-

Re: Write Pro Hide/clear pictures when printing

2019-10-30 Thread ADeeg via 4D_Tech
4D Tech mailing list wrote > Hi, > > We want to print a Write Pro document without printing the contained > pictures > Say we print to paper that has corporate identity, we don’t want to print > the logo that is inside the Pro document > So we want copy the pro document to a new one, and in this n

Re: Write Pro Hide/clear pictures when printing

2019-10-30 Thread Bernd Fröhlich via 4D_Tech
Piotr Chabot Stadhouders: > We want to print a Write Pro document without printing the contained pictures > Say we print to paper that has corporate identity, we don’t want to print the > logo that is inside the Pro document > So we want copy the pro document to a new one, and in this new documen

RE: OPEN DATA FILE gets endless loop

2019-10-30 Thread David Ringsmuth via 4D_Tech
Carl, There is a setting to match the default datafile by name. If you choose that setting, a previously unopened structure will automatically open it’s name-matched datafile. Place a name-matched empty datafile next to your structure file. In the “Startup…” method, detect that the name-matche

Components and external data

2019-10-30 Thread Chip Scheide via 4D_Tech
Hi, I understand that if a component needs to have access to 1 or more tables there are 2 ways to do this: - Inject the table definition(s) into the host - USE DATABASE and connect to an external database/datafile. I have some questions about using external databases in the context of a componen

Re: VP IMPORT DOCUMENT in v17R6

2019-10-30 Thread Chip Scheide via 4D_Tech
Try using Posix - I know you should not have to follows a posix converter - 4D's (at least as of v15 is incomplete/incorrect) //fileutl_Path_Convert_to_Posix // $1 - Text - Path to convert //$2 - Pointer (Optional) - to Error Return Text //Original from JorgeChB via iNug //Conver

Re: Write Pro Hide/clear pictures when printing

2019-10-30 Thread Tom Benedict via 4D_Tech
This just a wild guess, I haven’t tried it, but if you put a “white” (opaque) picture into the logo, does the black rectangle go away? Tom Benedict > On Oct 30, 2019, at 06:32, Piotr Chabot Stadhouders via 4D_Tech > <4d_tech@lists.4d.com> wrote: > > Hi, > > We want to print a Write Pro docume

Re: VP IMPORT DOCUMENT in v17R6

2019-10-30 Thread Jeremy Roussak via 4D_Tech
Here’s a minuscule database and a version of the xlsx file, with useful data removed. https://www.dropbox.com/s/ls7e695n046y63f/vp%20test.zip?dl=1 Open “Form1” and run it. Choose “test.xlsx”. Under R5, it loads. Under R6, i

Write Pro Hide/clear pictures when printing

2019-10-30 Thread Piotr Chabot Stadhouders via 4D_Tech
Hi, We want to print a Write Pro document without printing the contained pictures Say we print to paper that has corporate identity, we don’t want to print the logo that is inside the Pro document So we want copy the pro document to a new one, and in this new document hide/clear the pictures (lo

Re: Migrating to 4D Write Pro

2019-10-30 Thread ADeeg via 4D_Tech
Hi for converting old 4W/ or 4W6 write documents to Write Pro, there is a technote Link: https://blog.4d.com/migrate-4d-write-documents-stored-in-picture-fields/ but you have to adjust the component to make it work in 64 bit. See this forum post from me: Link: https://forums.4d.com/Post/DE/3113

Re: VP IMPORT DOCUMENT in v17R6

2019-10-30 Thread Jeremy Roussak via 4D_Tech
Forgot to mention: the document is a simple xlsx Excel document, with four sheets, 23k in size. Jeremy > On 30 Oct 2019, at 11:30, Jeremy Roussak via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > I call VP IMPORT DOCUMENT(“vp”;Form.path) in the On VP Ready form event. > Form.path contains a pat

VP IMPORT DOCUMENT in v17R6

2019-10-30 Thread Jeremy Roussak via 4D_Tech
I call VP IMPORT DOCUMENT(“vp”;Form.path) in the On VP Ready form event. Form.path contains a path in Mac system format, colon-delimited. In v17R5, it works fine. In R6, on the same document, I get an empty spreadsheet. No error; just an empty sheet. Mac, Mojave. Any suggestions gratefully rec

SV: OPEN DATA FILE gets endless loop

2019-10-30 Thread wangel--- via 4D_Tech
Hallo Chip, Yes I am aware of that. I was experimenting with OPEN DATA FILE to avoid 4D asking for a datafile. My idea was to distribute at standalone program with the structure in one folder and the datafile in another folder. That way the datafile would not be deleted when updating the structu