Disable New in the tool bar

Hi all,

I have a grid with header and lines. In the header ther is a field called CancelledDate field. Intially the header is created without the CancelledDate and for each header few lined are created. Later the user will update the cancelled date.Once the cancelled date is updated then everythng sould be disabled. Like the grid lines adding new or delete to be disabled.I tried by writing method like

public void setFieldAccess()
{

caeSecurityProj_ds.object(fieldnum(caesecurity,CancelledDate)).allowCreate(!caesecurity.CancelledDate);
}

But its throwing error. The table having CancelledDate is caeSecurity and the below line grid table is caeSecurityProj which the new/delete to be disabled on updating the CancelledDate

Thanks…

It should be like this, not necessary to access the field

caeSecurity_ds.allowCreate(!caesecurity.CancelledDate);

caeSecurity_ds.allowDelete(!caesecurity.CancelledDate);

caeSecurity_ds.allowEdit(!caesecurity.CancelledDate);

Hi Thanks for your response. But with the above method its not working .Its allowing me to add a new line. .Please let me know how to avoid adding a new line or deleting a new line in the grid

ya i got a solution.Its working now.