cancel
Showing results for 
Search instead for 
Did you mean: 

Writing Currency Value To an MIKG

Not applicable

I'm pulling out my hair over this, and I'm sure I'm just overlooking something simple.

I have a Unity Script (C#) where I am performing an operation in a called external SQL query (% times an amount) and am trying to write the result to a currency keyword in an MIKG. 

If I attempt to set the keyword value using this "Keyword keyword = resultKeys.CreateKeyword(result);", I get an error saying " The keyword type (AP Allocation Amount) is incompatible with the desired value type: string."

Same error with this: "Keyword keyword = resultKeys.CreateKeyword(string.Format("C",result));"

And with this "Keyword keyword = resultKeys.CreateKeyword(decimal.Parse(result));" I get an error that says "Keyword AP Allocation Amount : '498.90' is not valid for AddKeyword."

Any ideas where I've gone wrong?

1 ACCEPTED ANSWER

Bryan_Sorensen
Confirmed Champ
Confirmed Champ

Hello Robert, 

It looks like you may be adding a MIKG nested keyword as a standalone keyword, which will not exist on the Document. 

Are you creating an EditableKeywordRecord in your process to add / update the MIKG keyword?

Bryan Sorensen

API Analyst| OCAPI - OCI

API Support Team

View answer in original post

2 REPLIES 2

Bryan_Sorensen
Confirmed Champ
Confirmed Champ

Hello Robert, 

It looks like you may be adding a MIKG nested keyword as a standalone keyword, which will not exist on the Document. 

Are you creating an EditableKeywordRecord in your process to add / update the MIKG keyword?

Bryan Sorensen

API Analyst| OCAPI - OCI

API Support Team

Not applicable

Bryan, Thanks - that is exactly what the problem was.