Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

Modifying enum field based on another field value

$
0
0

I am working on a project about making reservations. I have a reservation table that holds the enum field Status. And reservation lines table that holds the NoYes - Paid field.
The task is I have to iterate through all lines in res lines table and see if the NoYes Paid field is yes. If this field is yes on all lines in a given reservation, the field Status in res table has to change its status to Paid.
Any suggestions how should I implement this?

This is the code I tried, but nothing changes

public void modifiedField(FieldId _fieldId)
{
         axmResLines_SJ reslines;
         super(_fieldId);

switch (_fieldId)
{
    case fieldNum(axmReservation_SJ, ReservationStatus):
        while select* from reslines
           where reslines.ReservationId == this.ResId
      {
           if (reslines.Paid == NoYes::Yes)
          {
                this.ReservationStatus = AXMReservationStatus_SJ::Paid;
          }
      }
     break;

}

}


Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>