How do I disable the ok button on the PurchEditLine Form?

Hi there,

I have a requirement to disable the OK button on the PurchEditLines form within AX. Does anyone know the permissions that control this button on the standard AX form. If so it would be greatly appreciated.

Look forward to hearing from you.

Thanks and kind regards,
Tom

hi,

you can enable/disable buttons using “enablejournalbuttons”, and in the “active” method of the datasource…

you can refer the following link for future reference :

http://axforum.info/forums/showthread.php?t=15244

Hi,

Not sure why you want to disable ‘OK’ button.

The easiest way to do this - select ‘OK’ button from form design and change the visible property to No.

Otherwise you may do the following -

  1. rename the OK button to something else (for example ‘OK1’)

  2. Set auto declaration property to Yes

  3. In the form init method write this - OK1.enabled(false);

Thanks for the speedy response. Perhaps I should of been a bit more specific. I am required to disable the OK button for a specific user group within the PurchEditLine Form. Hope this helps clarify my requirement.

Regards,
Tom

Hi,

In that case you have to extend the code in my previous post. Something like this -

select firstOnly UserGroupList
where UserGroupList.userId == curuserid()
&& UserGroupList.groupId == ‘Admin’; // Change the group for whom you want to disable the button for

if (UserGroupList.RecId != 0)
{
//Write the code to disable the button mentioned in my earlier post
}

Do this in the form > init method.

Thanks for the reply Harish.

From what your saying it looks like the only way of acheiving this would be to apply code rather than use functionality within User Group Permissions functionality from the Admin Module. I was hoping to acheive this from here rather then applying code.

If anyone knows of how to achieve this from exisitng standard functionality then please let me know.

Thanks and kind regards,
Tom

Hi,

It is definitely not the only way.

By default command buttons such as ‘OK’ will not have any security keys. You can assign a security key for this command button and then configure the access.

Hi All,

I am trying to disable the Action button “OK” when ever the Purchase Order Creation screen is loaded(in the form ‘PuchCreateFromSalesOrder’) . Only when user click “VALIDATE” button system should enable “OK” button.

I have set the Autodeclaration property of the ‘OK’ button to Yes

I am trying to add code in the ACTIVE method of the corresponding data source.But not getting it right…Could some one please help me.I am new to AX2012

enable it in \Forms\PurchCreateFromSalesOrder\Methods\checkOK