Hi All,
In my graph there are two custom buttons called Test1 and Test2. Initially I need to disable Test2 button and based on the condition in Test1 button need to Enable the Test2 button.
Here is my sample code
public PXAction<HMRCVendorRegisterDetail> Test1;
[PXButton(CommitChanges = true)]
[PXUIField(DisplayName = "Button 1", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select, Enabled = false)]
protected virtual IEnumerable test1(PXAdapter adapter)
{
if(x == 1)
{
Test2 button need to setEnable true here
}
else
{
Test2 button need to setEnable false here
}
return adapter.Get();
}
public PXAction<HMRCVendorRegisterDetail> Test2;
rPXButton(CommitChanges = true)]
tPXUIField(DisplayName = "Button 2", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select, Enabled = false)]
protected virtual IEnumerable test2(PXAdapter adapter)
{
return adapter.Get();
}
Can someone help me out?
Thanks