Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
18%
200 - 500 GB
29%
500 - 800 GB
3%
800 - 1200 GB
8%
1200 - 1500 GB
8%
1500 - 2000 GB
13%
> 2000 GB
24%
Total votes: 80

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 13th November 2019, 18:04
OmeLuuk's Avatar
OmeLuuk OmeLuuk is offline
Guru
 
Join Date: Mar 2002
Location: The Netherlands
Posts: 1,101
OmeLuuk is on a distinguished road
Baan: Infor LN 6.1 10.2.1 > 10.7 - DB: MS SQL2008 - OS: VM WindowsServer2008R2
Picture update
Baan: Infor ERP 10.7
C/S: Both

So, with the LN UI (Mingle) my session again shows the picture field (which worked in the past in BW but was removed somewhere later).

I do not use it in the intended way though. The intended way is to link the field with data in the table by means of a GUID and the possibility to update the image in sets using ttaad710 / ttaad7100m000 etc.

This is what I have:
  • an alternative item code system (tcibd004) refering to a file share with all the item pictures.
  • And a field on the form (show.me) of type ttdyf.picture.

And code:
Code:
 function update.picture.field()
{
	domain	tcmcs.long	file.size

	if not isspace(tcibd004.aitm) and
	   tcibd001.active = tcyesno.yes then
		g.path.gif = path.dir & trim$(tcibd004.aitm) & path.ext
		
		if file.stat(g.path.gif, file.size) = 0 and 
		   change.picture("show.me", "warning.gif", g.path.gif) < 0 then
			g.ret = change.picture("show.me", "warning.gif")
		endif
	else
		if tcibd001.active = tcyesno.no then
			g.path.gif = trim$(tcibd004.aitm) & " inactive"
		else
			g.path.gif = ""
		endif
		g.ret = change.picture("show.me", "warning.gif")
	endif
}
When browsing the records, when a picture is found this code switches to the needed image, but when the item is not active or the picture cannot be found it does not revert to the default warning.gif but shows the previous image.

What did I do wrong?
__________________
Also read Luke 24:4-8
Reply With Quote
  #2  
Old 19th November 2019, 16:15
OmeLuuk's Avatar
OmeLuuk OmeLuuk is offline
Guru
 
Join Date: Mar 2002
Location: The Netherlands
Posts: 1,101
OmeLuuk is on a distinguished road
Baan: Infor LN 6.1 10.2.1 > 10.7 - DB: MS SQL2008 - OS: VM WindowsServer2008R2
Quote:
Originally Posted by OmeLuuk View Post
What did I do wrong?
Probably this is worth an incident
__________________
Also read Luke 24:4-8
Reply With Quote
  #3  
Old 20th November 2019, 15:47
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,387
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
So I never used this functionality - so pure speculation on my part about what you posted. So you said if the picture is preset(and item is active) then the picture gets displayed using this (my assumption) change.picture("show.me", "warning.gif", g.path.gif). So then I assume the g.path.gif points to the gif you want to show for the item. So why not put the warning.gif in the same directory - then set g.path.gif to the gif path + warning.gif. Then the same command could then be used change.picture("show.me", "warning.gif", g.path.gif) - in one case it points to an item picture. In the other case it points to warning.gif.

Keep in mind I am not even sure of the change.picture command. I found another thread on it, saying it was deprecated - but not really sure. Just me speculating if the above might be a work around.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #4  
Old 30th November 2019, 21:43
OmeLuuk's Avatar
OmeLuuk OmeLuuk is offline
Guru
 
Join Date: Mar 2002
Location: The Netherlands
Posts: 1,101
OmeLuuk is on a distinguished road
Baan: Infor LN 6.1 10.2.1 > 10.7 - DB: MS SQL2008 - OS: VM WindowsServer2008R2
Cool

Quote:
Originally Posted by mark_h View Post
... So then I assume the g.path.gif points to the gif you want to show for the item. So why not put the warning.gif in the same directory - then set g.path.gif to the gif path + warning.gif. Then the same command could then be used change.picture("show.me", "warning.gif", g.path.gif) - in one case it points to an item picture. In the other case it points to warning.gif.
Would be a perfect work around, but it would work around a standard error. One of the things we would never do in our company. Standard errors should be resolved in the standard.
Quote:
Originally Posted by mark_h View Post
Keep in mind I am not even sure of the change.picture command. I found another thread on it, saying it was deprecated - but not really sure. ...
Well to be honest, I wrote this session and found that function back in I think it was back 2013 or so, just when they found out problems with showing pictures in BW, when they decided the function should be implemented differently and thus got deprecated.

The implementation now is that you can link pictures to records in a main table using a GUID link to the image file on disk (so no need to store the blob in the database, just a link), You can do this also dynamically, so you can easily link new images (currently only one at the time, but that may change over time, as indicated in the programmers manual), Drag and drop is supported.

Well I did not want to use the entire link thing with GUID and drag and drop, but only to blank the image. Infor Support taught me how to debug webUI sessions and then I saw (the image field is a pointer that shows information like an XML tree in the debugger) that after the "reset" call still the "last used image" link was the previous image which I did not want to see for all inactive items. This also indicates that your work around might work.

So it seems the function did not clear it's internal variables which results in showing the wrong image: the third argument has priority over the two argument call... They are investigating and probably raising a defect to have it solved in the standard.
__________________
Also read Luke 24:4-8
Reply With Quote
Sponsored Links
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
tibom1213m000(Detect low level code and loop) Issue mark_h Tools Development 8 3rd December 2012 19:29
update session smusba Tools Development 4 7th March 2009 07:17
Table update problem Debdas Banerjee Tools Development 3 30th October 2003 20:10
Update in update Andron Tools Development 5 26th October 2002 01:47


All times are GMT +2. The time now is 07:06.


©2001-2018 - Baanboard.com - Baanforums.com