while i am trying to map a process variable which is a forigen key in another table, i got an an error saying that integer cannot be cast into the datatype "EMS_DATATYPE", so i thought to cast it , but my cast is showing the same error ...
this is the code that i written in scrip task
cast( 'type!{urn:com:appian:types:EMS}EMS_J_PROJECT_MEETING'("PROJECT_ID"), pv!PROJECT_ID)
and the error is
An error occurred while evaluating expression: EMS_J_PROJECT_MEETING.PROJECT_ID:cast( 'type!{urn:com:appian:types:EMS}EMS_J_PROJECT_MEETING'("PROJECT_ID"), pv!PROJECT_ID) (Expression evaluation error at function 'cast': Could not cast from EMS_J_PROJECT_MEETING to Number (Integer). Details: CastInvalid) (Data Outputs)
any suggestions?
Discussion posts and replies are publicly visible
Is the pv!PROJECT_ID an object that would cast into the urn:com:appian:types:EMS or is it an integer?
i get the an integer value for this pv!PROJECT_ID from start form, and made it as parameter
is my syntax for casting from data type is rite ?
EMS_J_PROJECT_MEETING.PROJECT_ID: cast(...) looks like you're trying to cast something to be whatever type the PROJECT_ID is.
Maybe try creating the EMS_J_PROJECT_MEETING object like this...
EMS_J_PROJECT_MEETING: cast( 'type!{urn:com:appian:types:EMS}EMS_J_PROJECT_MEETING'("PROJECT_ID"), {emsJProjectMeetingField: pv!PROJECT_ID} )
where emsJProjectMeetingField would be whatever field in EMS_J_PROJECT_MEETING the pv!PROJECT_ID would map to.
This should create an EMS_J_PROJECT_MEETING object with the field for emsJProjectMeetingField set to your pv!PROJECT_ID value
For example, to create a ACME_Object object with the filed for commenter set you would do the following
local!acmeObject: cast('type!{urn:com:appian:types}ACME_Object', {commenter: loggedInUser()}),
Expression evaluation error: Syntax error. Details: Expression evaluation error: Keyword and non-keyword arguments must not be mixed. Used in: cast.
Can you show me what the code you have that threw that error please?
I had a typo error,I got it reslove, thanks for your code...
Awesome! Good job and good luck.