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, ...
Suggested Answer

Add new event Block process for the special order type and document type in Invent Test Association

(0) ShareShare
ReportReport
Posted on by 290

There is a business process which requires to add new event block process for the special order and document type in quality association form.

For example for the order type  Transfer order value and transfer order ship event type we want to able user to select transfer order ship as a block process if the execution is Before. I have read the inventtestAssociation Table class code. In order to show Block Process items which are related to the selected order type and event type, I have found the  isEligibleForBlockProcess method. If I could use the COC to append my logic to this method ( i.e., say if order type is transfer order , event type is transfer order ship and the execution is before then Block Process items will be transfer order ship), my problem will be solved. How ever this method is private and I could not write COC. I think another solution is overriding  lookupBlockProcess method.

I want to know that there is a reason isEligibleForBlockProcess  method is not protected? we should not define new event block ?

I have the same question (0)
  • Suggested answer
    Rahul Mohta Profile Picture
    21,032 on at

    if CoC is limiting then have you tried framework events

    e.g. when opening table/Form in designer, could see under the triggers under the events node

  • Nastaran Profile Picture
    290 on at

    Dear Rahul,

    Actually, I have tried event handlers as well. But the issue is not solved. I am familiar with COC and limitations and approaches to overcome on COC limitations. My issue should be investigated in a case which I explain in my question. Here I explain it more.

    I have added some custom block process to InventTestBlockProcess enum. I want to modify the lookup of the block process form control based on the order type and document type which the user selects. I have checked the InventTestAssociationTable class and find the lookupBlockProcess method. 1513.PNG

    In this method, The code which set lookup value dynamically is :

    ttsbegin;

    dictEnum = new DictEnum(enumNum(InventTestBlockProcess));
    for (i = 0; i < dictEnum.values(); i++)
    {
    if (this.isEligibleForBlockProcess(any2Enum(dictEnum.index2Value(i))))
    {
    addType(any2Enum(dictEnum.index2Value(i)));
    }
    }

    ttscommit;

    isEligibleForBlockProcess is the key method. If this method was not private then I would add my logic using class augmentation. However, I tried to override lookup. first I started using class augmentation and overridden the lookupBlockProcess but I faced two issues:

    1) first I lose the buffer of the super inventTestblockProcesstmp table which is set on the sys lookup of the field.

    2) second, the error comes because we are defining two lookups for one field (one is in the super method and the other is in my method).

    I think a lot to find a solution. for example, finding the way to get form control lookup and then updating (instead of assign a new lookup). 

    After I disappointed, I tried another idea. I tried to override BlockProcess form control lookup by using the OnLookUp event handler. But the event handler is not going to hit. I do not know exactly the reason. Maybe this is caused because the edit method is assigned to the block process field. I do not know I just guess.

    8400.PNG

  • Nastaran Profile Picture
    290 on at

    Dear D365 developers, I'm hoping you can assist me with this issue.

    Thanks.

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
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans