SBX - Search With Button

SBX - Forum Post Title

AllowEdit on data source remains read only

Microsoft Dynamics AX Forum

Christiaan asked a question on 13 Oct 2018 6:55 PM
My Badges

Question Status

Verified

I am using CustInvoiceJour with a new data source linked to refrecid of the journal. the problem I am experiencing is the new data source allowedit = yes is not working. the new grid added to custinvoicejour remains readonly. I can delete and Add fine but not edit. 

I had tried several Form control overrides on the init data source, active on TAB and data source. but it remains read only. AutoDeclaration = yes was used on the data source and form control as well. 

This is AX 2009 fyi!

Reply
Rustem Galiamov responded on 14 Oct 2018 12:49 PM

Hi Christiaan!

What is the value of CustInvoiceJour allowedit properties? Is this your custom form or existing and customised form?

Can you provide some screenshots?

Reply
Christiaan responded on 14 Oct 2018 1:10 PM
My Badges

CutInvoiceJour Form has two data sources both AllowEdit, AllowDelete, add NO specifically. then inventdim data source is AllowEdit turned on. If I set my custom Datasource allowDelete and AllowAdd to Yes (or true) it does allow me to delete records, the odd thing is the AllowAdd does allow me to select new icon. but the grid fields do not show drop down boxes. I am not able to enter in values either. I am suspecting security plays a role or the linkage to CustInvoiceJour does not allow me to change records. I am System Admin of course. the CustInvoiceJour relation I prefer to use passive and at the time of TAB click I execute the executequery in PageActive method of the data source to load the grid with records. this works fine and is best form performance from my experience. I had also tried to use linktype: Active/delay with innerjoin and removed executequery() code entirely still allowedit on data source remains read only. I do not consider a linkage issue is the problem. Delete always works as expected. I had also explicit hardcoded the data source_ds.fieldnum(xx,xx,).allowedit = yes. in the Init() methods, Tab click method and even object control itself. No change to AllowEdit parameter. I do realize this is AX 2009 maybe I am missing a specific 2009 trick or technology fix?

Reply
Rustem Galiamov responded on 14 Oct 2018 1:38 PM
Suggested Answer

If the grid has DataSource property filled with DS table which AllowEdit = No you not be able to edit any field on the grid, no matter from which DS this field.

Reply
Christiaan responded on 14 Oct 2018 1:43 PM
My Badges

Here are the screen shots you asked for. CustInvoiceJour is a base AX SYS layer Form with three data sources. I am adding additional TAB with a new data source. InventDim is also a SYS layer data source but it has AllowEdit turned on. 

Fig: Base AX custInvoiceJour data source with AllowEdit, delete, create NO.

  

Adding data source passive linktype; with AllowCreate No (no adding of records) only allow Delete and Change = Yes

Tab and Grid modifications. AutoDeclaration is turned on for TabPage only.

Reply
Christiaan responded on 14 Oct 2018 1:47 PM
My Badges

Setting the Parent CustinvoiceJour data source to AllowEdit = Yes does not change the Tabpage custom grid to allow changes. It is probably same as putting allowEdit in code for the Grid itself.

Reply
Rustem Galiamov responded on 14 Oct 2018 1:57 PM
Verified Answer

Unfortunately i have not installed AX2009 environment. I can't check the code. Sorry.

But i've tried to add a new DS to CustInvoiceJournal form in AX2012R3, set AllowEdit = YES, create a new TabPage with custom grid and it works. But, my new DS not joined to any DS.

Reply
Christiaan responded on 14 Oct 2018 2:22 PM
My Badges

Thanks for double checking and it narrow down my options to custom code must have overwritten allowEdit on data source and it was in VAR layer under a method for Tab change event. Now I did try this before but did not change anything for me only until I made AllowEdit on two data sources : CustInvoiceJour and CustInvoiceTrans. they were set to AllowEdit No. Just setting AllowEdit Yes on custInvoiceJour is not enough. Appreciate your help!

Reply
Christiaan responded on 14 Oct 2018 2:25 PM
My Badges

Thanks for double checking on another platform, I found the issue had to be custom code and indeed in VAR layer a Tab change event manipulates the AllowEdit on CustInvoiceJour_ds. now I did see this before and disabled it but I realized there are two DS sources both with AllowEdit No: CustInvoiceJour and CustInvoiceTrans need to be set to AllowEdit before custom DS will actually work. basically I understood from this is if any DS is allowEdit No others are also No.

Reply
Rustem Galiamov responded on 14 Oct 2018 1:57 PM
Verified Answer

Unfortunately i have not installed AX2009 environment. I can't check the code. Sorry.

But i've tried to add a new DS to CustInvoiceJournal form in AX2012R3, set AllowEdit = YES, create a new TabPage with custom grid and it works. But, my new DS not joined to any DS.

Reply
Rustem Galiamov responded on 14 Oct 2018 1:38 PM
Suggested Answer

If the grid has DataSource property filled with DS table which AllowEdit = No you not be able to edit any field on the grid, no matter from which DS this field.

Reply

SBX - Two Col Forum

SBX - Migrated JS