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?

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

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

#1
Martin Dráb Profile Picture

Martin Dráb 372 Most Valuable Professional

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 291

#3
Saalim Ansari Profile Picture

Saalim Ansari 209

Overall leaderboard

Product updates

Dynamics 365 release plans