Is it possible to disable the docuref button for a form datasource.
I have some trouble with the PurchEditLines form. The records in this form
are created temporarily so when the user opens the form again, the records
are recreated and therefore all docurefs are gone (mapped to a non-existing
record).
So I would like to disable this button to avoid confusion.
/Jonas
"Jonas" wrote:
> .
>
/Jonas
"Martin Drab" <Marti...@discussions.microsoft.com> skrev i meddelandet
news:A8D3FAF5-7EFC-4371...@microsoft.com...
"Jonas" wrote:
> .
>
i solved this by adding the following lines to the research method:
if (formDataSourceHasMethod(formDataSource, 'DisableDocuRef'))
{
disableNoteButton();
return;
}
So, by just adding an empty method called DisableDocuRef to FormDataSources
of my choice I am able to disable the button.
There are probably better ways to do this, but this was the only thing that
I could come up with.
/Jonas
"Martin Drab" <Marti...@discussions.microsoft.com> skrev i meddelandet
news:F8666D3C-8321-4CFA...@microsoft.com...
You could also try:
// If no valid datasource
common = formRun.docCursor();
if (! common.RecId || ! common.dataSource()
//AXI
|| common.isTmp()
//AXI end
)
{
disableNoteButton();
return;
}
Regards
--
Michal
AXImprove | http://www.AXImprove.co.uk | Solutions for AX
performance and data storage
"Michal" wrote:
> .
>
Actually I have had some problems with these tables. We have a customer that
wants to save some DocuRefs for records in the PurchParmTable. But when the
form closes the data gets copied (moved) into the VendInvoiceInfoTable and
the next time the form is opened the data is copied back to a new record in
the PurchParmTable and the the docuref is lost. I had to create my own logic
to also change reftable and refrecid for these DocuRefs.
There really should be an easy way to disable docurefs both on form and
table level (just by setting a property).
/Jonas
"Martin Drab" <Marti...@discussions.microsoft.com> skrev i meddelandet
news:E4D13AC0-1CF8-4040...@microsoft.com...