When am trying to update the editable grid , the attached code throws an error

When am trying to update the editable grid , the attached code throws an error
Expression evaluation error in rule 'rule': Cannot select without a Value
Any solutions/changes to the code?


Sample Code

OriginalPostID-158041

OriginalPostID-158041

  Discussion posts and replies are publicly visible

Parents
  • @janaki I would like to suggest to change the way you make query and infact this will help you in increasing performance.

    Please find attached the modified code and here goes my observations and suggestions with regards to your code:

    1. It's better to associate the query with a SAIL component rather than keeping it in with(). The code you place in with() will be evaluated each and every time when you interact with any component (that has saveInto attribute) in the interface. (Anyhow I noticed that you are making use of a button called 'fetch', so I assume that you may want to make query upon clicking the button. Else you can also place it in 'CSI Request ID' text field)

    2. I guess ri!requestID is single valued. I guess its better to check the null value existence as follows: rule!APN_isBlank(ri!requestID). Because APN_isEmpty is generally used for arrays, complex data types or Appian objects such as User, Group etc.

    3. In the attached snippet, you are trying to assign a boolean value to local!staffingDetails when ri!requestID is blank. But in the same interface, you are trying to save complex data type values into it. I agree that local variable has the capacity to save any kind of data and this will be resolved at run time, but still I would like to suggest to save null values into it as you are further making null checks on the same variable. (local!staffingDetails: if(rule!APN_isEmpty(ri!requestID),false,a!queryEntity()))

    4. Finally here is the answer to your question - 'So my question is how do i save the updated information into a new variable which is null': Quiet simple,
    >> if your variable's scope is load, push values into it using saveInto of any component. For instance, if you want to update it upon the interaction with grid, pass the same variable (in addition to the inputs you are already passing) to the rule!CSI_renderCSIStaffingDetails() and make changes in it using saveInto of components in that row.
    >> if your variable's scope is with, push values into it by assigning values to it.
    Example:
    load(
    \tlocal!staffingDetails,
    \twith(
    \ tlocal!newStaffingDetails: local!staffingDetails,
    \ t/*where values are pushed into local!staffingDetails by using 'saveInto' of a button component or components in gridRowLayout etc*/
    \t)
    )

    Still I don't say that the problem will be completely resolved because it further depends on the data types of the inputs, their names and the way you are making calls to the rules. But still, come back with questions if you have any, so that any of the practitioners will respond to them.
Reply
  • @janaki I would like to suggest to change the way you make query and infact this will help you in increasing performance.

    Please find attached the modified code and here goes my observations and suggestions with regards to your code:

    1. It's better to associate the query with a SAIL component rather than keeping it in with(). The code you place in with() will be evaluated each and every time when you interact with any component (that has saveInto attribute) in the interface. (Anyhow I noticed that you are making use of a button called 'fetch', so I assume that you may want to make query upon clicking the button. Else you can also place it in 'CSI Request ID' text field)

    2. I guess ri!requestID is single valued. I guess its better to check the null value existence as follows: rule!APN_isBlank(ri!requestID). Because APN_isEmpty is generally used for arrays, complex data types or Appian objects such as User, Group etc.

    3. In the attached snippet, you are trying to assign a boolean value to local!staffingDetails when ri!requestID is blank. But in the same interface, you are trying to save complex data type values into it. I agree that local variable has the capacity to save any kind of data and this will be resolved at run time, but still I would like to suggest to save null values into it as you are further making null checks on the same variable. (local!staffingDetails: if(rule!APN_isEmpty(ri!requestID),false,a!queryEntity()))

    4. Finally here is the answer to your question - 'So my question is how do i save the updated information into a new variable which is null': Quiet simple,
    >> if your variable's scope is load, push values into it using saveInto of any component. For instance, if you want to update it upon the interaction with grid, pass the same variable (in addition to the inputs you are already passing) to the rule!CSI_renderCSIStaffingDetails() and make changes in it using saveInto of components in that row.
    >> if your variable's scope is with, push values into it by assigning values to it.
    Example:
    load(
    \tlocal!staffingDetails,
    \twith(
    \ tlocal!newStaffingDetails: local!staffingDetails,
    \ t/*where values are pushed into local!staffingDetails by using 'saveInto' of a button component or components in gridRowLayout etc*/
    \t)
    )

    Still I don't say that the problem will be completely resolved because it further depends on the data types of the inputs, their names and the way you are making calls to the rules. But still, come back with questions if you have any, so that any of the practitioners will respond to them.
Children
No Data