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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Form datasource field validate method extension is not executing

(0) ShareShare
ReportReport
Posted on by 6
Hi, I have written coc for inventjournaltranfer form ds field. But it is not executing. I kept debugger but not hitting, I also tried to build project many times.
Installed product version : 10.0.31 (10.0.1406.139)Installed platform version : Update55 (7.0.6651.122)
 
Here is my code :
 
[ExtensionOf(formDataFieldStr(InventJournalTransfer, InventJournalTrans, ItemId))]
final class InventJournalTransferFormDSItemField_XXX_Extension
{
    public boolean validate()
    {
        InventJournalTrans  inventJournalTrans;
        InventTable         inventTable;
        boolean             ret;
        FormDataObject formDataObject = any2Object(this) as FormDataObject;
        FormDataSource formDataSource = formDataObject.datasource();
        ret = next validate();
        inventJournalTrans = formDataSource.cursor();
        select FIELD1 from inventTable where inventTable.ItemId == inventJournalTrans.ItemId;
        if(inventTable.FIELD1 == NoYes::Yes)
        {
            Error(strFmt(/%1 MESSAGE/,inventTable.ItemId));
            return false;
        }
        return ret;
    }
}
---------------
And FYI - the extension is working for control validate (but not datasource field validate)
I have the same question (0)
  • GirishS Profile Picture
    27,833 Moderator on at
    Hi,
     
    Have you tried adding the info log inside the method without any condition?
    Does the symbols are loaded while debugging?
    Have you tried the same at onValidating event handler?
     
    Thanks,
    Girish S.
  • Martin Dráb Profile Picture
    238,743 Most Valuable Professional on at
    It tried a simple example on the same field and it didn't work out. Then I look into our application (code from Microsoft, ISVs and our customizations) and I didn't find a single CoC extension of validate() method on a data source field. There may be reason why nobody used it.
     
    Use Validating event instead.
     
    It's off-topic, but couldn't your code be written simply like this?
    public boolean validate()
    {
        boolean ret = next validate();
    
        InventTable inventTable = inventJournalTrans.inventTable();
    
        if (inventTable.Field1)
        {
            return checkFailed(strFmt("%1 MESSAGE", inventTable.ItemId));
        }
    
        return ret;
    }
  • NA-17030952-0 Profile Picture
    6 on at
    Even modified() is not executed for this form datasource datafield extension

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 583 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 378

#3
Diego Mancassola Profile Picture

Diego Mancassola 255

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans