Showing posts with label Get Form Controls. Show all posts
Showing posts with label Get Form Controls. Show all posts

Thursday, May 23, 2024

Cursor moves to top when refreshing list page grid in D365F&O

    My requirement is to be the cursor on the same record when a button is clicked, but the cursor is moving according to the formdatasource setposition property, but it should be on the same record.

            FormDataSource              inventTestGroup_ds = sender.formRun().dataSource();

           int position = inventTestGroup_ds.getPosition();

            inventTestGroup_ds.refresh();

            inventTestGroup_ds.reread();

            inventTestGroup_ds.research(true);

            inventTestGroup_ds.setPosition(position);



Tuesday, July 11, 2023

How to get Cursor record in COC of clicked method in D365 X++

         FormControl                 callerButton    = any2Object(this) as FormControl;

        FormRun                     formRun         = callerButton.formRun();

        FormDataSource              formDataSource  = formRun.datasource();

        CustTableChangeProposal     custTableChangeProposal = formDataSource.cursor();

How to get Cursor record in COC of FormDatasourceField methods in D365 X++

 FormDataObject formDataObject = any2Object(this) as FormDataObject;

FormDataSource formDataSource = formDataObject.datasource();

FormRun formRun = formDataSource.formRun();

CustTable   custTable = formDataSource.cursor();

Wednesday, May 31, 2023

How to get reference group form control D365 X++


 str  functionalid;

FormReferenceGroupControl control = this.design().controlName(formControlStr(EntAssetFunctionalLocationObjectInstall, FunctionalLocation)) as FormReferenceGroupControl;

 FormStringControl   subStringControl = control.controlNum(1) as FormStringControl; 

  functionalid = subStringControl.text();

Tuesday, May 16, 2023

How to get one datasource cursor record in another datasource field method in d365

 

 FormDataObject formDataObject = any2Object(this) as FormDataObject;

        FormDataSource formDataSource,formdatasourceloc;

        formDataSource = formDataObject.datasource();

        formdatasourceloc = formDataSource.formRun().dataSource("WHSLoadTable");

        wHSLoadTable = formdatasourceloc.cursor();

Thursday, January 26, 2023

How to get one form controls in other form in D365

How to get one form controls in other form in D365    



FormRun formRunloc;

formRunloc = this.formRun().args().caller();

 FormStringControl  nameloc =   formRunloc .design().controlName(formControlStr(PurchTable,Name1));

FormStringControl  nameloc1 = formRunloc .design().controlName(formControlStr(PurchTable,Description));