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