Question Re build an application step 9

I am re building the Dev training app and this is only thing I cannot get to work from the training guidance and I am not sure why.  I have rebuilt up to step 13 and every thing else and other tips have worked. 

On the add Vehicle form.

a tip is "TIP: Use the Visibility Setting to Conditionally Show Interface Components ● In some cases, you might want to display a component based on a condition. ● To do this, use the Visibility setting in the Component Configuration pane. Select Only Show When and enter an expression in the Expression Editor. ● For example, imagine that you want to display a Comments field if a vehicle’s mileage is above 150,000 miles. You can enter the expression ri!vehicle[recordType!AX Vehicle.fields.vehicleMileage] > 150000. ● This expression determines whether the Comments component is displayed on the interface. When set to false, the component is hidden and not evaluated. The default is set to true."

I have the following in

How ever I get the following message when I try this tip.

Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!paragraphField [line 156]: Cannot compare incompatible operands of type Null and type Number (Integer).

The reference application in community does not have this tip in it so its hard to see why and I don't fully understand why following the tip is not working correctly. 

Any comments on how to fix it would be appreciated. 

  Discussion posts and replies are publicly visible

Parents Reply Children
  • This is what I ended up with. just need to adjust process model to pass the info on now. 

    a!paragraphField(
    label: "Vehicle Comments",
    labelPosition: "ABOVE",
    helpTooltip: "Why should this high mileage vehicle be added to the fleet",
    saveInto: ri!vehicle['recordType[AX Vehicle.fields.vehicleAddcomment'],
    refreshAfter: "UNFOCUS",
    height: "MEDIUM",
    showWhen: and(
    a!isNotNullOrEmpty(ri!vehicle['recordType[AX Vehicle.fields.vehicleMileage']),
    ri!vehicle['recordType![AX Vehicle.fields.vehicleMileage'] > 150000
    ),
    validations: {}
    )

  • +1
    Certified Senior Developer
    in reply to aland3033

    You are not displaying the comment on the interface Cry

    pass the saveInto value in "value" parameter too.

    And please try this.

     

  • You spotted it faster than myself Sanchit.

    I was wondering why it did not display I then realised I had missed the value and was in the process of doing that when I had to step away.

    Below is what it shows now.

    a!paragraphField(
    label: "Vehicle Comments",
    labelPosition: "ABOVE",
    helpTooltip: "Why should this high mileage vehicle be added to the fleet",
    value: ri!vehicle['recordType!AX Vehicle.fields.vehicleAddcomment'],
    saveInto: ri!vehicle['recordType!AX Vehicle.fields.vehicleAddcomment'],
    refreshAfter: "UNFOCUS",
    height: "MEDIUM",
    showWhen: and(
    a!isNotNullOrEmpty(ri!vehicle['recordType!AX Vehicle.fields.vehicleMileage']),
    ri!vehicle['recordType!AX Vehicle.fields.vehicleMileage'] > 150000
    ),
    validations: {}
    )

    I am also happy to say I was able to trouble shoot why it was not showing on the supervisor form when running through the process model. 

    I was able to a amend the supervisor form with the following 

    a!paragraphField(
    label: "Vehicle Comments",
    labelPosition: "ABOVE",

    helpTooltip: "Only applicable if vehicle is classed as high mileage",
    value: a!defaultValue(
    ri!vehicle['recordType!AX Vehicle.fields.vehicleAddcomment'],
    "–"),
    saveInto: {},
    refreshAfter: "UNFOCUS",
    height: "MEDIUM",
    readOnly: true,
    validations: {}
    )
    },

    which results in the below.

    Thanks again for your suggestion & guidance on this.