Cannot compare incompatible operands of type Null and type Number(Integer)

Certified Senior Developer


I'm getting this weird whenever I pass in the rv!identifier of a record 

Here is my related record action below. I'm only passing in the rv!identified which should be stored in the corresponding rule input ri!projectPlanId

When I pass a test (i.e projectPlanId = 82) the interface works like I want it to. But when t is passed through the related record action, and test it through the site, the error persists. 

is there a typo I missed or am I missing something more complicated here. Isn't the interface supposed to take in the rv!identifier, which I know is a number. Or am I messing up somewhere else? If anyone likes to see snippets of code, I'd be happy to provide some.

Appreciate all the help!

  Discussion posts and replies are publicly visible

  • 0
    Certified Senior Developer

    Could you please share your Start form node or the User Input Task node configurations? Can you check if you have passed the pv!projectPlanId as the input value for the form?

  • 0
    Certified Senior Developer
    in reply to Konduru Chaitanya

    Hi Konduru, this is what I'm querying the interface.

    I have two rule inputs that are coming in from two seperate related actions that use the same process model.

    On related action #1, it takes in the projectId 

    On related action #2, it takes in the projectPlanId

    I want to store the query in one single local variabl (local!project) where if projectId is null/zero, then the condition where the projectPlanId triggers. If projectPlanId is null/zero, the condition where projectId triggers and queries the data

    Here is the code that I think is breaking the whole interface. I think the if statements are not set up properly

    (note: local!isUpdate is checking whether projectId is null)

  • 0
    Certified Lead Developer
    in reply to Tamara Saadeh

    Can you screenshot the configuration of your start form from within the process model?  I'm concerned that your form isn't actually getting any value passed to the IDs correctly (also i'm slightly unclear whether your form requires ri!projectId, ri!projectPlanId, or both, etc.)

    What happens when you test your interface with NULL supplied to both of those rule inputs?  Does it show the same/similar error message?

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    Thank you Mike, the problem has been resolved! I wasn't passing in the pv into the process model and that caused it to glitch.

    If you don't mind me asking another question below:

    the idea here is to create a new project on an existing plan (so say a Walmart Plan has 3 projects and I need to create a 4th project without updating the 3rd project). The idea of the interface is to take in the latest project (i.e project #3 here) and prepopulate the fields with that value. 

    When the "Add new project" related action is clicked, the projectPlanId and the customerId are passed.

    The data is then queried using the projectPlanId in the form and stored in a local variable to populate the fields. What should happen is when the user clicks on "save project" the process model should create a new project instead of updating the latest project.

    Right now, in the process model, it is only checking the projectId (which we usually pass in if we are using the "Create New Project" related action and the projectId is passed in there), this related action is sing the same form and process model so we are passing both projectPlanId and projectId but using them in different related actions.

    right, now, the process model checks if projectId is null, and if it is it creates a new project, if not, it updates it.

    I'm still not sure how I can create a new project when passing the projectPlanId when passing that in since the projectId is usually always notNull since we're getting back the latest project in a plan and that project has an id, so what is happening now, instead of creating a new project off of the latest project, it is just updating the latest project

    My question here is: is there a way to make the projectId coming in from the latest project null when queying or can I do something within the process model to check that. Can we query a record type and refuse to get the proejctId or will that always be in the metadata? 

    Here are some screenshots to help 

    the below queries the record depending on which id is being passed in (projectId or projectPlanId)

    local!lastProject variable gets the latest project in the plan

    Values are populated with the latest project is projectPlanId is passed in

    in one of the scripts in the process model, it is checking the projectId and it it null, it creates a new. 

    Please let me know if this enough information, I really appreciate your help. if you have any question or need any clarification/more screenshots of specific things, let me know!

  • +1
    Certified Lead Developer
    in reply to Tamara Saadeh
    is there a way to make the projectId coming in from the latest project null

    generally speaking, what you'd do is, before the DB write, set just the primary key ID field to NULL, and a new row will be created (with a new ID), along with the data from the other populated fields of your data.

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    omg yes! That could actually work, I'll try it now. Thank you!

Reply Children
No Data