Hello All
I have two data items, Item and Item Ledger Entry.
Sometimes, no records will exist within the Item Ledger Entry.
I still want the Item section to be output and my question is therefore, what approach should I take to output a message of "item ledger history does not exist", if no records exist in the Item Ledger Entry table.
Currently, the sections I have are Item body, Item Ledger Entry body(i dont output this as this is used to calculate totals only) and Item Ledger entry footer for the totals.
Ideas?
Thanks
0
Comments
VarDispNoILE:=(DataItemLedgerEntry.COUNT=0)
and use this var to condition the display of the message
if you need the item ledger entry's for totals, can't you do it using the existing flowfields in combination with flowfilters on the item card ?
Thanks for the message. This did give me alot more ideas.
Unfortunately, its still not working.
(Although I "think" I have tried every section, what section would you place the label and subsequent onpresection code in?
Also, should I definately place the integer data item in this order?
Item
Item Ledger Entry
Integer
Thanks again
If you decide to use the Integer dataitem remember to set maxiteration to 1.
Add a variable type boolean set it to true in the Item Ledger Entry dataitem if it finds a related item ledger entry for the item.
Then on the body section for the integer display your message if the boolean is false else don't display the message.
Remember to reset the boolean for each item.
You can also just a a second body section for the item which will display the message. Insert code on the related section to see if it can find any related item ledger entry. If it FIND('-') don't display the section else display.
Hope it helps
Regards
Rabe
You don’t need ILE body section if you never show it. Delete it. If you have some calculation there behind, you should move it to ILE-OnAfterGetRecord Trigger.
Now define a Global Boolean “EntriesExist”.
In ILE-OnPreDataItem write: In ILE-OnAfterGetRecord write: Then Add another ILE Footer section after your’s Totals footer and put a single label there with caption “No entries for this item…”
Then put following code in first ILE-Footer OnPreSectionTrigger (for totals):
And on the second ILE-Footer OnPreSectionTrigger
It means if entries exist for item the “totals footer” will be displayed (OnAfterGetRecord will set entriesExist=TRUE).
If Entries does not exist then the second footer will be shown (OnPreDataItem will set entriesExist=FALSE, but ILE-OnAfterGetRecord will not happen for this item).
No additional dataitems, no additional counting…
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯