最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

在D365O中循环显示窗体中的所有记录 / Loop through all the records on a form in D365O

网络文摘 William 260浏览 0评论
Below sample code can be used to loop through all the records on a form in D365O Assuming that we want to infolog a field value for all the records on the screen on the click of a button. Step 1: Create a new class Step 2: Add the below code which should be called on the click of the button and info the required field details static class Test_LoopThruRecords_Extension {     /// <summary>     /// </summary>     /// <param name="sender"></param>     /// <param name="e"></param>     [FormControlEventHandler(formControlStr(InventItemOrderSetup, Test_BtnLoopThruRecords), FormControlEventType::Clicked)]     public static void Test_BtnLoopThruRecords_OnClicked(FormControl sender, FormControlEventArgs e)     {                 FormDataSource              InventItemPurchSetup_ds  = sender.formRun().dataSource("InventItemPurchSetup"); //DataSource form InventItemPurchSetup         InventItemPurchSetup        localInventItemPurchSetup = InventItemPurchSetup_ds.getFirst() as InventItemPurchSetup;         if(localInventItemPurchSetup)         {             while(localInventItemPurchSetup)             {                     info(localInventItemPurchSetup.FieldName);                               localInventItemPurchSetup = InventItemPurchSetup_ds.getNext() as InventItemPurchSetup;             }         } Cheers!
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址