Praveen
12th February 2003, 22:11
Hi

What does baan store in the record buffers (rcd.tppmmxxx) which is a string buffer? Does it store the actual values of all the fields in the table record or does it just store a pointer to the memory location where all the field data is stored?

Another question: if we have two different record buffers for the same table, is it possible to compare these record buffers and check if they have the same values or not?

What I am trying to do is in Baan Vb, whenever we run "Generate Outbound Advice" for an order, a record is inserted in the outbound history table even though nothing has been adviced for the outbound line. I am trying to see if there is any simple way to make sure that the outbound order line is indeed changed (atleast one field is modified) before inserting a line in the history table. I was wondering if we can use the record buffers to check this.

Any help will be greatly appreciated.

Thanks
Praveen.

NPRao
12th February 2003, 22:51
Here is some info-

What does baan store in the record buffers (rcd.tppmmxxx) which is a string buffer? Does it store the actual values of all the fields in the table record or does it just store a pointer to the memory location where all the field data is stored?

NULL characters in strings (http://www.baanboard.com/programmers_manual_baanerp_help_3gl_features_null_characters_in_strings)

There is one exception to this rule. When the left or right side in an assignment is a record buffer (rcd. <table name>), all bytes in the buffer will be copied. For example:

table tttadv999
strbuf = rcd.ttadv999 | NULL characters are copied
rcd.ttadv999 = strbuf | NULL characters are copied
strbuf2 = strbuf | NULL characters are NOT copied
In all other cases, if NULL characters are meaningful, use copy.mem(). This copies NULL characters as well as ordinary characters.


Another question: if we have two different record buffers for the same table, is it possible to compare these record buffers and check if they have the same values or not?

You can use cmp.mem() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_memory_operations_cmp_mem) and copy.mem() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_memory_operations_copy_mem)

I am trying to see if there is any simple way to make sure that the outbound order line is indeed changed (atleast one field is modified)

You can refer to the usage of update.occ() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_form_and_form_field_operations_update_occ) and before.save.object() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_dal_before_save_object)

Use this to update referenced tables after a record has been added or updated. The mode argument is set by the 4GL engine. The possible values are:

DAL_NEW indicates a new record
DAL_UPDATE indicates a record being updated

NPRao
25th February 2003, 01:56
I am trying to see if there is any simple way to make sure that the outbound order line is indeed changed (atleast one field is modified)

I found another tools function - changed() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_variables_checking_changes_changed)

There is also a predefined variable -

long attr.changed 4R
Indicates if the current field has changed.


Also, refer to the link - Validation for input (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=1791&highlight=changed)

maxime
25th February 2003, 21:21
A much simpler way is to check for the status of the Order Line. If the status is not advised then simply return from the After.save.object of the dal of whinh220.

Hope this helps.

Maxime.