In system method validateField there is a validation that I want to remove. Any suggestions?
*This post is locked for comments
I managed to achieve this with overriding validation on the form control.
[FormDataSourceEventHandler(formDataSourceStr(ProjTable, ProjTable), FormDataSourceEventType::Initialized)]
public static void ProjTable_OnInitialized(FormDataSource sender, FormDataSourceEventArgs e)
{
sender.object(fieldNum(ProjTable,WorkerResponsibleFinancial)).registerOverrideMethod(methodStr(FormDataObject, validate),methodStr(ProjTable_AdSv_Extension,validateWorkerResponsibleFinancial));
}
public boolean validateWorkerResponsibleFinancial(FormDataObject _targetField)
return true;
It would be helpful if you provide more details, like error message or code you are trying to use.
When I call cancel it throws an error.
Hi
Take a look at
community.dynamics.com/.../customizing-d365-with-event-handlers
EventHandler onValidatingField set parmResult to true in that case
You have the fieldname in the eventargs too.
Maybe you can try to set true in that case?
Sorry can't check.
regards Douglas
Did you try to call "cancel" ?
Thank you for the reply, but I cannot see how to skip validation using FormDataFieldCancelEventArgs.
As per my understanding with this class I could just stop the execution - throw an error.
Hi Marija Todorovic,
You can subscribe to Validating event on form data source field and cancel super(). To find example just do cross references for FormDataFieldCancelEventArgs class in AOT and see it's usage.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 2 Most Valuable Professional
Guy Terry 2 Moderator
Rahul Shah 2