declare an EntityStore as local variable

Hi All,
is there a method to define a variable as a Entity Data?
I am using the function a!writeToDataStoreEntity(<dataStoreEntity>, <valueToStore>)

I would create data object (valueToStore) to fill it with data inserted by the user

I have tried to declare it as local!newContainmentAction:a!entityData(cons!NCContainmentAction, null)

I am am receiving the message

Could not display interface. Please check definition and inputs.
Interface Definition: Expression evaluation error at function a!textField [line 327]: Invalid index: Cannot index property 'delegateMail' of type Text into type EntityData

OriginalPostID-248689

  Discussion posts and replies are publicly visible

Parents
  • Ciao karthiksaik,
    I have just solved using this code

    local!newContainmentAction: fn!cast('type!NonConformityContainment',{}),

    The cast function returns an empty object

    So we can use it to save data

    label: "Delegate e-mail address",
    value: local!newContainmentAction.delegateMail,
    saveinto: local!newContainmentAction.delegateMail


    Then to write into DB the entire object

    local!writeToDataStoreEntity(cons!NCContainmentAction,local!newContainmentAction),


    Is this approach correct ?
Reply
  • Ciao karthiksaik,
    I have just solved using this code

    local!newContainmentAction: fn!cast('type!NonConformityContainment',{}),

    The cast function returns an empty object

    So we can use it to save data

    label: "Delegate e-mail address",
    value: local!newContainmentAction.delegateMail,
    saveinto: local!newContainmentAction.delegateMail


    Then to write into DB the entire object

    local!writeToDataStoreEntity(cons!NCContainmentAction,local!newContainmentAction),


    Is this approach correct ?
Children
No Data