Baanboard.com

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

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
41%
Installation Wizard into new VRC
29%
Manual into existing VRC
6%
Manual into new VRC
24%
Total votes: 17

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 16th March 2017, 18:32
andy2609 andy2609 is offline
Member
 
Join Date: Feb 2011
Posts: 37
andy2609 is on a distinguished road
Baan: IVc4 - DB: Informix - OS: HP-UX
Cool Input field on Type 3 Form Header
Baan: iBaanERP 5.0b
C/S: None/Unknown

I have created a type-3 form with a form field (input type) in the header, into which I would like users to be able to enter a date, which can then be used to perform table updates via an external function in the session's 4GL program script.

The function has been created and needs the value of the variable, as entered by the user. However, although the input field is declared as an external variable in the script, whatever value is entered into the field is ignored and does not get read into the program - therefore a zero date is passed to the function. Debugging the script shows that the 'when.field.changes' and 'check.input' field sections are not executed.

Any ideas as to a resolution, anyone?
Reply With Quote
  #2  
Old 17th March 2017, 03:16
Ajesh's Avatar
Ajesh Ajesh is offline
Guru
 
Join Date: Feb 2009
Posts: 429
Ajesh is on a distinguished road
Baan: LN 10.4 - DB: Oracle - OS: HP-Unix
Have you put the field as Input field and as a View Field?

If so when.field.changes section for that field has to get executed.
Reply With Quote
  #3  
Old 17th March 2017, 06:17
srprks srprks is offline
Member
 
Join Date: May 2016
Location: Bangalore
Posts: 53
srprks is on a distinguished road
Baan: 10.4,Baan IV - DB: Oracle,SQL - OS: Unix,Windows
Have you used DAL ??
Reply With Quote
  #4  
Old 17th March 2017, 09:30
andy2609 andy2609 is offline
Member
 
Join Date: Feb 2011
Posts: 37
andy2609 is on a distinguished road
Baan: IVc4 - DB: Informix - OS: HP-UX
Form not dynamic, no DAL for table

Thanks for your replies, guys.

Ajesh - the form is not dynamic (hence declaring as a view field is not relevant in this case).

srprks - the table of the session has no DAL and the input field is for user-entered data that will fill a program variable, rather than a table field.
Reply With Quote
  #5  
Old 17th March 2017, 09:49
srprks srprks is offline
Member
 
Join Date: May 2016
Location: Bangalore
Posts: 53
srprks is on a distinguished road
Baan: 10.4,Baan IV - DB: Oracle,SQL - OS: Unix,Windows
Check this if its useful
Quote:
function void unlink.from.maintable (string field, ...)

Description

By default, when a session has a maintable, all form fields are treated as if they have a link to the maintable. When such fields are modified by the user, the maintable's update.status is set and the current record is marked as changed.

In some cases this behaviour is unwanted, e.g. if the fields are used as a kind of filter, or in case fields are used to select records (by means of checkboxes).

This function can be used to remove this link with the maintable. In that way when such fields are modified by the user, the update.status of the maintable is not set and the record is not marked as changed.

This will also prevent that when the session ends, the user is asked if data should be saved in case these fields have been modified.


Arguments
string field, ... One or more fields to unlink from the maintable. Use the format "field" or "field(element)".


Context
This function is implemented in the 4GL Tools and can be used in all script types.

Preconditions
field cannot be a maintable field
Example
after.form.read:
| Unlink 3 fields from the maintable
unlink.from.maintable("writeoff", "post.diff", "amount(3)")
Reply With Quote
  #6  
Old 17th March 2017, 14:54
andy2609 andy2609 is offline
Member
 
Join Date: Feb 2011
Posts: 37
andy2609 is on a distinguished road
Baan: IVc4 - DB: Informix - OS: HP-UX
unlink.from.maintable function

Hi srprks

Thanks for your suggestion. I have tried using the function 'unlink.from.maintable("...")' in the 'after.form.read' section, as you suggest, but am getting a compile error (Unresolved reference to function). Is there an include function that should be added to the script, in order to compile? Also, I can't find any documentation on this - perhaps you could tell me where you sourced this information?

(I'm using Tools 7.1 in Baan Vb)

Thanks!

Last edited by andy2609 : 17th March 2017 at 15:21.
Reply With Quote
  #7  
Old 20th March 2017, 08:01
srprks srprks is offline
Member
 
Join Date: May 2016
Location: Bangalore
Posts: 53
srprks is on a distinguished road
Baan: 10.4,Baan IV - DB: Oracle,SQL - OS: Unix,Windows
Quote:
Originally Posted by andy2609 View Post
Hi srprks

Thanks for your suggestion. I have tried using the function 'unlink.from.maintable("...")' in the 'after.form.read' section, as you suggest, but am getting a compile error (Unresolved reference to function). Is there an include function that should be added to the script, in order to compile? Also, I can't find any documentation on this - perhaps you could tell me where you sourced this information?

(I'm using Tools 7.1 in Baan Vb)

Thanks!
Its in proguide. But I am not sure if it will work for Baan V as well.
Reply With Quote
  #8  
Old 20th March 2017, 10:32
andy2609 andy2609 is offline
Member
 
Join Date: Feb 2011
Posts: 37
andy2609 is on a distinguished road
Baan: IVc4 - DB: Informix - OS: HP-UX
unlink.from.maintable - Baan Vb

Thanks again for your response, srprks - I guess you are using LN.

Can't find anything referencing this function and don't know which Tools function or library it might be in.

Does anyone else know if this is usable in Baan Vb, or have any ideas as to a solution to the problem described at the top of this thread?

Andy
Reply With Quote
  #9  
Old 21st March 2017, 02:18
shah_bs's Avatar
shah_bs shah_bs is offline
Guru
 
Join Date: Jan 2002
Location: Lewisville, Texas
Posts: 387
shah_bs is on a distinguished road
Baan: BAAN IVc3 with A&D2.2b - DB: ORACLE 9 - OS: HPUX
So to understand a bit better what functionality that you are trying to achieve.

To the best of my understanding, a type 3 form is used for MAINTAIN or DISPLAY of a main-table. So the view field has to be a part of the INDEX of the main table.

Assuming that the session was generated properly with a main-table behind it, the view field by default will accept values and display the first set of matching records (assuming that the start option is FIND-DATA).

So, if you can specify in bit more detail what functionality you are trying to achieve - you may not even need a type 3 form, all it needs to be could be a (Print Session) form, if you are using the entered field value to call some function.

You could attempt the after.input event of the field, that is just a vague suggestion without much understanding what you are trying to do.
Reply With Quote
Sponsored Links
  #10  
Old 21st March 2017, 15:08
andy2609 andy2609 is offline
Member
 
Join Date: Feb 2011
Posts: 37
andy2609 is on a distinguished road
Baan: IVc4 - DB: Informix - OS: HP-UX
Requirement Clarification

Thanks for your contribution, shah_bs.

The session is bespoke and has a type-3 form (for specific internal spares order lines), with spares order header details at the top and lines below, in the multi-line section (which also allow input on all occurrences). This all works fine.

The requirement is to have an input field - independent of the main table - that allows a date to be entered. This date will then be used when a function is activated by a new button on the form and will update date fields of all lines on the current spares order.

The functionality is all OK, except that the input field will not accept any input. The function 'unlink.from.maintable' sounds promising, but the script will not compile when it is added - either it is not supported in Baan Vb, Tools 7.1, or it is in a function / library that I have not identified.

I can work around this by simply creating and calling a new sub-session with a date entry field, that will then pass the date back to the main session and allow processing of the function. The preference, however, would have been to have the date input field on the form of the main session itself, to accept the value - but if this is not feasible, I will use the workaround.

Thanks again for your comment - hope this is clear!

Andy
Reply With Quote
  #11  
Old 22nd March 2017, 02:29
shah_bs's Avatar
shah_bs shah_bs is offline
Guru
 
Join Date: Jan 2002
Location: Lewisville, Texas
Posts: 387
shah_bs is on a distinguished road
Baan: BAAN IVc3 with A&D2.2b - DB: ORACLE 9 - OS: HPUX
If you have not proceeded with your sub-session plan, here is a possibility. Although the solution will not seem very polished, because BAAN 4GL being an event oriented language, we are constrained to work with its underlying standard program.

So, if I understand, you have created an input field in the header. Let us say that this is the first field and once filled will not be modified too often. The next enterable field will obviously be the Order Number.

NOW, if you click on the Start View button (in my system, it looks like a bow-tie, and the users actually call it by that name), the standard program will be waiting in the first field for input (in this case the date field). Enter the required date, then TAB to move to the order number, enter the order number being considered and TAB. This will display the lines according to your functionality.

The value of the date will then be available in the field, and can be used in the function called by the new button that you are planning. No doubt you have considered the fact that you are actually updating the main-table records, so that will need some special treatment.

I had done a similar modification to the standard tdilc1515m000 session to allow for entry of Project Code, which I could then use in the various A&D related zoom sessions that the user might want to call when needed.

If you are going the sub-session way, I would recommend to encapsulate the updating of the line records in that subsession. It will have many advantages, since when you return back to the calling session, all you will need to do is a find.data. Of course, then you have to also pass into the sub-session the order number being worked on, and the date would be entered there.
Reply With Quote
  #12  
Old 22nd March 2017, 11:53
andy2609 andy2609 is offline
Member
 
Join Date: Feb 2011
Posts: 37
andy2609 is on a distinguished road
Baan: IVc4 - DB: Informix - OS: HP-UX
Cool Will have to use sub-session as a workaround

Hi shah_bs

Thanks for the suggestion. However, the session is primarily used as a viewing session, which when started up retrieves the saved settings from the user defaults.

Users can change views between different order headers, each view showing the lines associated with that order (much like standard 'Sales Order Lines' session, tdsls4501m000). The required functionality will be used whenever a user wants to update lines globally - filling the new field in the header with the date and pressing a form button to carry out the update on all lines on the current order.

The 'Start View' option will indeed make the new field accessible for data entry, but this is not how it needs to be used.

In the absence of any forthcoming feasible solution to this, I will adopt the sub-session option - you're right; as this is a 4GL script, the standard program is controlling and restricting the field access and there doesn't seem to be a tidy option to override it!

Thanks for your time.

Andy
Reply With Quote
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
Value of an input field in the form to report script mnmhema Tools Development 4 2nd May 2012 13:27
execute(db.update) loses changes on form type 2 RobertP Tools Development 2 11th November 2011 11:11
Form Type 3 Calculated Field rduncan10 Tools Development 1 18th October 2011 18:16
Right align form field - type string en@frrom Tools Development 2 29th March 2007 12:05


All times are GMT +2. The time now is 09:05.


©2001-2017 - Baanboard.com - Baanforums.com