Rabu, 14 April 2021

Mengaktifkan tombol di Docuview

https://community.dynamics.com/ax/f/microsoft-dynamics-ax-forum/188370/how-to-enable-disable-delete-button-in-the-attachment-document-handling-based-on-enum-status/474532

Hi,

please have a look inside DocuView form, doReSearch method, around line number 160 and below. Hopefully you will see that there is already some code there that sets variable called 'allowEditBasedOnActualForm'.

In my installation there is even some code for Norway, which checks the calling table and sets the variable based on some fields - looks like exactly what you need ?

   if (SysCountryRegionCode::isLegalEntityInCountryRegion([#isoNO]) &&

      (testCursor.TableId == tablenum(CustInvoiceJour) || testCursor.TableId == tablenum(ProjInvoiceJour)))

   {

       switch (testCursor.TableId)

       {

           case tablenum(CustInvoiceJour):

               custTable = CustTable::find(CustInvoiceJour::findRecId(testCursor.RecId).InvoiceAccount, false);

               break;

           case tablenum(ProjInvoiceJour):

               custTable = CustTable::find(ProjInvoiceJour::findRecId(testCursor.RecId).InvoiceAccount, false);

               break;

       }

       if (custTable.EInvoice)

       {

           allowEditBasedOnActualForm = true;

       }

   }

Thanks,

Maciej

Tidak ada komentar:

Posting Komentar

Erorr CS1963 - An expression tree may not contain a dynamic operation.

Kali ini saya mendapatkan erorr dengan code CS1963, padahal sebelumnya saya sudah mendefinisikan 'var item in Model' di @foreach(var...