srinivas
4th April 2002, 09:10
What is the equivalent 4GL command for the save button functionality in Baan IV C4?

MariaC
4th April 2002, 09:35
I think that would be db.update(tablename) or db.insert followed by a commit.transaction?

srinivas
4th April 2002, 09:56
But db.insert or db.update is not firing the events after.update.db.commit and before.write etc sections under main.table.io section

If I manually insert a record and press save button the above events are firing. If I give db.insert in init.form and commit the transaction the these events are not firing eventhough the records are getting saved.

MariaC
4th April 2002, 11:07
I can't remember exactly but I think that the events after.update.db.commit and before.write are only activated if you are doing an update of the main table linked to for eg. a maintain session.

What exactly are you trying to do in this case?

srinivas
4th April 2002, 11:33
Let me give the entire scenario.

Assume I have two tables a Transfer header table and a Transfer Lines table.

I have a maintain session for Tranfer header where I have some code in the main.table.io/after.write section where I am populating Transfer Lines table programmatically. That is I enter a record for header and as I save the record the Lines table is populated.

Now I am trying to enter data in Transfer header table by calling the maintain session from some other update session by exporting the values for the header table fields and save the record. That is the update session should call the maintain session - put values in the fields - save the record and close the session. Here only the header data is getting stored but the other events are not firing and hence lines data is not getting populated.

I want to save a record programmatically and want all the events to fire so that other tables also get updated.

evesely
4th April 2002, 16:53
How are you inserting the data when you call the maintain session from the update session? If you are not using the standard add.set, modify.set, etc., which would prompt the user for field entries -- hence, I'm guessing this is true -- the main.table.io sections and after.update.db.commit will not fire. If you wanted to call them individually, you could call before.write(), etc.

You can do something like this a couple of ways. You could call add.set and simply disable the input on each field (attr.input = false), set field values, and call individual field sections as necessary (e.g., when.field.changes.field.name()). Use update.occ() to mark the record as modified, and finally execute update.db.

You could also call the before.write section (and perhaps others)like a DLL function from your update session and never actually zoom to the maintain session.

I hope this helps.

srinivas
4th April 2002, 18:12
Thanks a lot Ed.

I will try this.

wgarcia
26th July 2003, 20:08
for type 1 form you must work with do.all.occ(), create a new function in wich you must use update.occ() command. In this function the [execute(update.db)] clause must been execute.

example:

baan code:

choice.cont.process:
after.choice:
do.all.occ(update.rec)


functions:

function update.rec()
{
update.occ()
tccom000.nama = "new value "
execute(update.db)
}

chanbaan
28th July 2003, 07:48
Hi srinivas,

May I know the Session Name ,where it will give all information
and transaction done by a user.

Thanx in Advance
chan

tjbyfield
28th July 2003, 10:14
Hi chanbaan - this is not srinivas but I thought I'de give you my answer.

There is a session "Print User History" ttaad2402m000" that lists date time session etc. However it depends on having the 'History' box checked in "Maintain User Data".

Hope this helps (and answers your question.)

Terry

chanbaan
28th July 2003, 10:17
Hi Terry

Thanx a lot for ur swift Reply


Regards
chan:)

en@frrom
27th August 2003, 11:07
User history

Hi chanbaan - this is not srinivas but I thought I'de give you my answer.

There is a session "Print User History" ttaad2402m000" that lists date time session etc. However it depends on having the 'History' box checked in "Maintain User Data".

Hope this helps (and answers your question.)

Terry



I work with Baan5.0b, and didn't know about this session ttaad2402m000. I entered the session, but for anything I tried got "no data within selection". When I look in the user data I don't find a checkbob 'history'. Do you hava an idea where I could find it for Baan5?? Also, please explain to me which transactions / movements it logs exactly. Can I for instance also check which user has ran certain sessions or/and updated certain tables/records??


Kind regards,

En.

baanlover
27th August 2003, 12:18
Hi,

There is a session called ttams1110m000, there u can find option "History". Create a new template and check this option. Attached this template to the required users in User data template in session ttaad2500m000. This is available in baan 5.0c. Dont forget to do the Convert Runtime DD for that particular user.

Regards,
BL

en@frrom
27th August 2003, 12:32
Thanks very much! Will be usefull to me. Do you know if there is a standard / available setting for automatically cleaning up the file with certain frequency? (for instance every two days).

Hitesh Shah
27th August 2003, 16:37
Hi Srinivas,

Use of attr.input = false (as suggested by Ed ) will require you to fire the field input events manually and to know the exact sequence/frequency in which Baan standard program fires the same.

Alternatively , you may call following function separately in before.input function instead of attr.input =false.

|Function to generate a TAB Event in the Session
function tab()
{
long event_2(EVTMAXSIZE)
evt.type(event_2) = EVTCHANGEFOCUS
evt.client.sender(event_2) = pid
evt.client.command(event_2) = 1
evt.focus.key(event_2) = KEY_TAB
if not send.event(get.pgrp(pid),event_2) then
message("Press Tab")
endif
}

In any case , u will have to take care off error handling for errors encountered in check.input section while entering data automatically.