Query on milestone

hi,

i created interface using milestone. In interface it executes all steps but in process model when i click next/submit buttton flow got stopped.

a!localVariables(
  local!milestonesteps:rule!M_TSA_MilestoneSteps(
    Delivered:ri!OrderTracking['recordType!{6600bb25-98dd-46fe-8391-fbabecac3729}M_TSA Records.fields.{549e9802-7500-4ad2-ab51-144c175dd513}DeliveryStatus']
  ),
  local!Activestep:1,
a!formLayout(
  label: "Order Status",
  contents: {
    a!sectionLayout(
      label: "",
      contents: {
        a!milestoneField(
          label: "",
          labelPosition: "ABOVE",
          steps: local!milestonesteps,
          links: a!startProcessLink(),
          active: local!Activestep,
          color: 
          if(
            isnull(ri!OrderTracking['recordType!{6600bb25-98dd-46fe-8391-fbabecac3729}M_TSA Records.fields.{549e9802-7500-4ad2-ab51-144c175dd513}DeliveryStatus']),
            {},
            if(
              ri!OrderTracking['recordType!{6600bb25-98dd-46fe-8391-fbabecac3729}M_TSA Records.fields.{549e9802-7500-4ad2-ab51-144c175dd513}DeliveryStatus']=true,
              "POSITIVE",
              "NEGATIVE"
              
            )
          )
        ),
        a!sectionLayout(
          label: "",
          contents: {
            rule!M_TSA_Ordered(
              Step: local!Activestep
            ),
            rule!M_TSA_Packed(
              Step: local!Activestep
            ),
            rule!M_TSA_Shipped(
              Step: local!Activestep,
              Delivered: ri!OrderTracking['recordType!{6600bb25-98dd-46fe-8391-fbabecac3729}M_TSA Records.fields.{549e9802-7500-4ad2-ab51-144c175dd513}DeliveryStatus']
            ),
            rule!M_TSA_OrderStatus(
              Delivered: ri!OrderTracking['recordType!{6600bb25-98dd-46fe-8391-fbabecac3729}M_TSA Records.fields.{549e9802-7500-4ad2-ab51-144c175dd513}DeliveryStatus'],
              Step: local!Activestep
            )
          }
        )
      }
    ),
    
  },
  buttons: a!buttonArrayLayout(
    buttons: {
      a!buttonWidget(
        label: if(local!Activestep<3,"Next","Submit"),
        saveInto: {
          if(
            local!Activestep<4,
            a!save(
              local!Activestep,local!Activestep+1
            ),
            {}
           ),
          a!save(ri!Button,local!Activestep+1)
          },
        value: if(local!Activestep<3,"Next","Submit"),
        submit: true,
        style: "SOLID",
        loadingIndicator: true,
        showWhen: local!activestep<4
      ),
       a!buttonWidget(
        label: "Back",
        value: ri!Button,
        saveInto: {
          if(
            local!Activestep>1,
           a!save(
            local!Activestep,local!Activestep-1
          ),
          {}
          ),
          a!save(ri!Button, local!Activestep-1
            )
 
        },
        submit:true(),
        style: "OUTLINE",
        showWhen: local!Activestep>1,
        validate: false
      )
    }
  )
)
)
https://sovq.appian.community/suite/sites/order-status

  Discussion posts and replies are publicly visible

Parents
  • Reading through the SAIL, it looks like you're defining local!Acttivestep to be 1 on load of the interface, and only updating it when the user clicks on a button. There's no call to start a process model, and no query to get the current active step from a process or database. So, like Stefan, I'm struggling to understand what you're wanting the interface to do in relation to a process model, since it doesn't look like there's any connection to one here.

    In general, for a milestone indicator to work, you'd want to query the current status into a local variable and use that to drive the "active" node on the bar. It's rare for the active milestone to change without submitting the page and loading a new interface, so the dynamic logic you've got for advancing/backing up the local!Activestep isn't usually necessary, though I can see the value in doing that to prove that your milestone bar can properly show all of the statuses as active.

    Hope that helps!

Reply
  • Reading through the SAIL, it looks like you're defining local!Acttivestep to be 1 on load of the interface, and only updating it when the user clicks on a button. There's no call to start a process model, and no query to get the current active step from a process or database. So, like Stefan, I'm struggling to understand what you're wanting the interface to do in relation to a process model, since it doesn't look like there's any connection to one here.

    In general, for a milestone indicator to work, you'd want to query the current status into a local variable and use that to drive the "active" node on the bar. It's rare for the active milestone to change without submitting the page and loading a new interface, so the dynamic logic you've got for advancing/backing up the local!Activestep isn't usually necessary, though I can see the value in doing that to prove that your milestone bar can properly show all of the statuses as active.

    Hope that helps!

Children
No Data