Simplicty and flexibility!


Image associated to a record - product number


Started by Handles
Search
You will need to Sign In to be able to add or comment on the forum!

Image associated to a record - product number

Download: Screenshot 1.png

I would like to get an image to load once I have entered a product number :

  -MaterialCode Field-  (Enter Code) 

   10.2000.PT

  -PDFCode Field- Preventing data entry-   (Derivation) ".JPG" 

.jpg 

-ConcatMaterialCode Field Preventing data entry

(Derivation)   (if ( Firstc (MaterialCode , 5 ) = ".SPEC" or Firstc(MaterialCode ,5) = "SPEC.", concat (lastc(MaterialCode , 5) , upper (PDFCode )) , concat (midc(MaterialCode , 4,4) ,upper (PDFCode )))  entry resolt 2000.jpg


What Derivation if any could  I place in the image field to pick up an image that is saved on the computer as 2000.jpg 

Using a button - ShellExecuteA(0,"Open",ConcatMaterialCode,"","",1) seems to work but not if using same formular in the image field.

Any help please.  


Written by Handles 16/02/22 at 20:09:54 LegEasy 6 Windows

Re:Image associated to a record - product number

Sorry just just realized that the button associated to :

ShellExecuteA(0,"Open",ConcatMaterialCode,"","",1) 

with above the image opens outside the DataEase program,  and I would like the image to show in the image field within the form.   


Written by Handles 16/02/22 at 21:37:50 LegEasy 6 Windows

Re:Image associated to a record - product number

Sorry just just realized that the button associated to :

ShellExecuteA(0,"Open",ConcatMaterialCode,"","",1) 

with above the image opens outside the DataEase program,  and I would like the image to show in the image field within the form.   


Written by Handles 16/02/22 at 21:37:50 LegEasy 6 Windows

Re:Image associated to a record - product number

Are the image field a virtual field?

If the field are virtual it will be recalculated as soon as a field it depends on is changed.


Written by DataEase 17/02/22 at 09:28:09 LegEasy 6 Windows

Re:Re:Image associated to a record - product number

Hi thanks for comming back  - No the image field is not a virtual field at this time, but virtual or not no image will display untill I know how to inform the field to look for the image .  


Written by Handles 17/02/22 at 09:32:34 LegEasy 6 Windows

Re:Re:Re:Image associated to a record - product number

An image field is just a field that show what is the result of its derivation as an image.

So the result should simply be the complete path to the image you want to show. Now wizzardry so forget all about CDF's and ShellExecuteA etc.

That is a wild goose chase.

So 

"C:\Pictures\MyImage.jpg" will show that image.
concat("C:\",path,ImageName")

Etc


Written by DataEase 17/02/22 at 09:51:13 LegEasy 6 Windows

Re:Re:Re:Re:Image associated to a record - product number

Thanks for the help... now all  working. If it helps anyone else in future , the only way for me was !

Field (ProductCode)  enter product code. 

Field (PDFCode)  Derivation ".TIF" being the picture file format on computer, this is virtual.

Field (ConcatMaterialCode) Derivation Concat the  ProductCode ,.TIF  together 

Field (ImageDisplayCode)  Derivation ConcatMaterialCode  "being the code you want the picture field to look up,  2000.TIF"  

Image field with derivation - ImageDisplayCode.  will now show the picture. 2000.TIF 

Any otherway I tried the image field was seeing a half completed code ,so kept throwing error cant find image.

Thanks Again


Written by Handles 17/02/22 at 10:35:21 LegEasy 6 Windows

Re:Re:Re:Re:Re:Image associated to a record - product number

We are kind of working blind here as we don't really have the real environment to work with. The best thing in these situation is to make a small sample app with the problem and attach it.

The default field length in DFW 6.x is 15 characters and if your field is only 15 characters long it will simply not be long enough to have a full path as the result will never be more than 15 characters.

There is no space saving in a virtual field by not making it 255 long.

There is a lot of traps to fall into, and if your problem is a combination of more than one "bug" then the debugging gets that much harder as correcting a bug doesn't solve the problem.

Here we can see the combination being:
1. Not virtual
2. Field length ?
3. Wrong derivation


Written by DataEase 17/02/22 at 11:13:14 LegEasy 6 Windows

Re:Re:Re:Re:Re:Re:Image associated to a record - product number

We are kind of working blind here as we don't really have the real environment to work with. The best thing in these situation is to make a small sample app with the problem and attach it.  I can do but fortunatley I now have this working perfect, hope it makes sens, Thanks again      


Written by Handles 17/02/22 at 12:37:41 LegEasy 6 Windows

Re:Re:Re:Re:Re:Re:Re:Image associated to a record - product number

Great i.e. working perfectly!
Like you I write for posterity here ;-) The comment was meant for people that read this, so next time we will get there quicker. Luckily we have supported DataEase for a long time so we know where most bones are berried, but to quickly get a specific answer a sample app is the route to follow.

All the best. 


Written by DataEase 17/02/22 at 13:02:08 LegEasy 6 Windows

Re:Re:Re:Re:Re:Re:Re:Re:Image associated to a record - product number

Hi All! I have told and will repeat again and again. Datamaster is the best tool on the planet in various forms depending on OS and the DataEase team is powerful too. thx. Good luck!


Written by Ihor Zakharchenko 18/02/22 at 05:17:48 LegEasy 6 Windows
DG3_ForumList