I am trying to create a Time Field in Warehouse table which will auto populate the time at the time of posted warehouse movements. I have created a field Time data type “Time” in 50000 ranges. Can you please tell me where should I put the code to auto populate the time and what will be the code?
You mean while registering from Warehouse Movement?
Yes. I have created a new field named Time in Warehouse Entry table and I want this field to be auto populated at the time of posting the Item Reclass journal.
I find it best to put it in the OnInsert trigger. You will have to make sure that all of the places that call that trigger do so like INSERT(TRUE) with the optional boolean parameter, though.
Thanks Matt for you reply. Do you know the code that I need to put on the oninsert trigger?
I put Time := Time; on the oninsert. I am in a warehouse table design view > field 50000 Time > F9 in C/AL Editor and then I wrote Time := Time; on the onisert trigger. It didn’t work. After assigning the code, I transfered the inventory and then I checked the warehouse entry table to see if the time gets registered. The field is blank. Any thoughts?
As I stated, you will also have to find everywhere that actually inserts the record, and change it from INSERT to INSERT(TRUE). You can do this using the Developer’s Toolkit.