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, ...
Answered

How to use the second parameter _arrayIndex in common.modifiedFieldValue method

(0) ShareShare
ReportReport
Posted on by 573

Hi experts,

Can anybody tell me how to use parameter _arrayIndex of table method modifedFieldValue?

Field Result is an array field, and when any of them is modified, another field value is updated accordingly.

But when I implements by following codes, the parameter _fieldName is Result[1], and the code RED won't hit.

pastedimage1641867297512v1.png

However, when I try to change the code like below, the compile error found

pastedimage1641867398475v2.png

Thanks in advance.

I have the same question (0)
  • Verified answer
    bernardqin Profile Picture
    573 on at

    Resolved, use _fieldName directly in case.

    public void modifiedFieldValue(FieldName _fieldName, int _arrayIndex = 1)

       {

           super(_fieldName, _arrayIndex);

           switch (_fieldName)

           {

               case fieldStr(DWFS_FilmSplittingInstructLineReqDetails, Returned):

                   this.modifyReturned();

                   break;

               case _fieldName:

                   boolean result = this.result();

                   this.JudgeResult = result ? DWFS_FilmLabelJudgeResult::OK : DWFS_FilmLabelJudgeResult::NG;

                   this.Returned = !result;

                   this.modifiedFieldValue(fieldStr(DWFS_FilmSplittingInstructLineReqDetails, Returned));

                   break;

           }

       }

  • huijij Profile Picture
    19,811 on at

    Thanks for your sharing.

  • Suggested answer
    ergun sahin Profile Picture
    8,826 Moderator on at

    This usage is not correct. It will always work, unless the top row cases are running. In short, it is no different from the default, I don't think that's what you want.
    What you have to do is find the fieldNum. You can find it as below.

    fieldId2Ext(fieldNum(Table, Field), 2)

  • bernardqin Profile Picture
    573 on at

    Thanks Ergün, yes I am sure that my solution is not exactly correct. But I am going to switch field name in case, not find the field number. I want to know the usage of parameter _arrayIndex.

  • Suggested answer
    ergun sahin Profile Picture
    8,826 Moderator on at

    "2" is arrayIndex in the example I gave above

    pastedimage1641895770727v2.png

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
Martin Dráb Profile Picture

Martin Dráb 592 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 305 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans