web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Mandatory Document Handling Field

(0) ShareShare
ReportReport
Posted on by 30

Hey! I am new in AX 2012 and I have to task where:

1. When I edit Confirmed Ship date from SalesTable > Delivery to open automatically a Document Handling form.

2. I have to make the Notes field Mandatory.

Screenshot-2022_2D00_06_2D00_01-132211.png

I created an Override Method on SalesTable form > SalesLine (Datasource) > Fields > ShippingDateConfirmed.

This is my method

public void modified()
{
	DocuType docuType;
	DocuRef docuRef;
	docuType = docuType::find('Note');

	docuRef.RefCompanyId = salesline.dataAreaId;
	docuRef.RefTableId = salesline.TableId;
	docuRef.RefRecId = salesline.RecId;
	docuRef.TypeId = docuType.TypeId;
	docuRef.Name = 'Confirmed Ship Date Change';
	docuRef.Notes = '';
	docuRef.insert();

	info('Please document reason the ship confirmation has changed');


	if (!infolog.docu().isDocuViewSet())
	{
		infolog.docu().note(element);
	}
	else
	{
		infolog.docu().setActive();
	}
}



I would need some help to make the 2. Part, where I have my Notes Field mandatory.
Can seombody show me the code? I tried using the datasource_ds.object(FieldNum(DocuRef, Notes)).mandatory();
But the problem is that I don't have DocuRef as a datasource in this form, and I don't have the permission to add it. I have to use what I have. Can somebody help me with the code please?

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans