Guys,
While opening the VendInvoice info list page i need the info of all the Invoice Account but the value is not coming . Can you please give me some suggestion.
This is the code I tried out.
[PostHandlerFor(formStr(VendInvoiceInfoListPage), formMethodStr(VendInvoiceInfoListPage, init))]
public static void VendInvoiceInfoListPage_Post_init(XppPrePostArgs args) { FormRun fr = args.getThis(); Common common = fr.args().record(); VendInvoiceInfoTable vendInvoiceInfoTable = common; Info(strFmt("%1",VendInvoiceInfoTable.InvoiceAccount)); }
A general comment: could you please always make sure you share all the details that you can, when you are asking for help. "Does not work" doesn't contain much information. Was there an error? Did you get too many records? Did you get no records? The more you share, the better help you get.
As Martin pointed out in another thread, post_init of the form might be too early in the process, since the query has not yet been executed.
So maybe you could try to hook your code in the post event of executeQuery method of the form data source.
This code does not work for us. Can you please give some alternative or reference.
public static void VendInvoiceInfoListPage_Post_init(XppPrePostArgs args) { FormRun fr = args.getThis(); FormDataSource fds = fr.dataSource(); VendInvoiceInfoTable vendInvoiceInfoTable = fds.getFirst(); while (vendInvoiceInfoTable) { info(strFmt("%1",vendInvoiceInfoTable .InvoiceAccount)); vendInvoiceInfoTable = fds.getNext(); } }
Does this work for you?
In general I don't know what you are trying to achieve but it sounds like it's not going to be a very good solution for performance.
Imagine if your customer has 1 000 000 records in this table. Every time when they open the form your code would iterate the 1 000 000 records, taking many minutes.
If you need help designing a better solution, you can share your business requirement and describe what you are actually trying to achieve.
To get all the Invoice Account. I followed the Above link but not able to achieve.
All invoice accounts of the list page? Or what?
Here you can find how to show Invoice account of the active record: community.dynamics.com/.../311551
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,134 Super User 2024 Season 2
Martin Dráb 229,928 Most Valuable Professional
nmaenpaa 101,156