Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Disabling docu ref for form datasource

37 views
Skip to first unread message

Jonas

unread,
Sep 6, 2010, 2:20:11 AM9/6/10
to
Hi

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

Martin Drab

unread,
Sep 6, 2010, 3:17:03 AM9/6/10
to
Hi Jonas,
go to Basic > Setup > Document management. Open the Parameters form, check
"Use Active document tables" and set up them in the Actice document tables
form.
--
Best regards,
Martin Drab (Czech Blog: http://dax-cz.blogspot.com)


"Jonas" wrote:

> .
>

Jonas

unread,
Sep 6, 2010, 4:44:48 AM9/6/10
to
Thanks. I was not aware of those forms.
However, as far as I can see, activating this would require me to add all
other tables to the list of tables that can have a docuref, instead of just
blocking it for a single table. Correct?

/Jonas

"Martin Drab" <Marti...@discussions.microsoft.com> skrev i meddelandet
news:A8D3FAF5-7EFC-4371...@microsoft.com...

Martin Drab

unread,
Sep 6, 2010, 5:50:03 AM9/6/10
to
Yes, that's true. If it is not suitable, you have to modify the code. The
logic is implemented in class Docu, method.reSearch().


"Jonas" wrote:

> .
>

Jonas

unread,
Sep 7, 2010, 1:03:52 AM9/7/10
to
Ok, thanks.

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...

Michal

unread,
Sep 7, 2010, 5:57:44 AM9/7/10
to
Jonas,

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

Martin Drab

unread,
Sep 7, 2010, 6:43:04 AM9/7/10
to
Actually it doesn't help, because PurchParm* tables are not technically
temporary. BTW DocuRef for temporary tables (defined as temporary in AOT, not
set in run-time) is alredy disabled by Docu class.

--
Best regards,
Martin Drab (Czech Blog: http://dax-cz.blogspot.com)


"Michal" wrote:

> .
>

Jonas

unread,
Sep 8, 2010, 3:10:31 AM9/8/10
to
Yes, you are correct here Martin.
These tables are not temporary, they are just used for storing data
temporarily...

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...

Ronda Carrington

unread,
Oct 10, 2010, 8:02:35 PM10/10/10
to
Sorry i have been slow getting into this group i do apologize to you all.
"Jonas" <jonas....@scandisys.se> wrote in message
news:ubsHRokT...@TK2MSFTNGP02.phx.gbl...
0 new messages