suspect this error happened becuse i move the function Get_Scheme to anohter module within the same application. 
i tried to update the referrence, change the function name.create the same function using different name.
it is still giving the error.
-----------------------------------------------------------------------------------------------------
Error:
Invalid key

An internal error occurred and was logged.
Please try again later or contact the administration team.

Sorry for any inconvenience.
---------------------------------------------------------------------------------------


Stack:
Invalid key
   at ssTCM_Functions.RCTextPM_DISC_COMM_PLANRecord.AttributeGet(GlobalObjectKey key)
   at ssTanChongScheme.RCTextPM_DISC_COMM_PLANRecord.FillFromOther(IRecord other)
   at ssTanChongScheme.RsseSpaceTCM_Functions.MssGet_Scheme_v2(HeContext heContext, String inParamIn_SC_CODE, String inParamIn_CUST_CODE, String inParamIn_PRODUCER_CODE, DateTime inParamIn_ISSUE_DATE, RecordList& outParamOut_scheme_list, IRecord& outParamOut_scheme_record_default)
   at ssTanChongScheme.Actions.ActionGet_Scheme_v2(HeContext heContext, String inParamIn_SC_CODE, String inParamIn_CUST_CODE, String inParamIn_PRODUCER_CODE, DateTime inParamIn_ISSUE_DATE, RLTextPM_DISC_COMM_PLANRecordList& outParamOut_scheme_list, RCTextPM_DISC_COMM_PLANRecord& outParamOut_scheme_record_default)
   at ssTanChongScheme.Flows.FlowMainFlow.ScrnTCM_Quote.Preparation(HeContext heContext)
   at ssTanChongScheme.Flows.FlowMainFlow.ScrnTCM_Quote.Page_Load(Object sender, EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Hi Linguo,

That seems to be an error due an inconsistent consumer.

You need to refresh and publish all eSpace consumers of that entity.

Other option to make sure that your application is "consistent" is to publish one solution with all eSpace and dependencies as components.

Hope it helps you,

Best regards,

Daniel Martins
Daniel Martins wrote:
Hi Linguo,

That seems to be an error due an inconsistent consumer.

You need to refresh and publish all eSpace consumers of that entity.

Other option to make sure that your application is "consistent" is to publish one solution with all eSpace and dependencies as components.

Hope it helps you,

Best regards,

Daniel Martins
 Hi Daniel,

Thanks for the reply, I tried to refresh and pusblish all comsumers, but it is still happens.
I suspect it is due to the output parameter of the function:
it has a record and a list and both has a user defined field as attached image.
Not sure whether this is true.

Meantime I will just keep the function inside the application and not move it out.


I had this error too. Googling for an answer brought me here, so I bet others will come here too, so to confirm Daniel's response, I had to go deep into the module stack and republish consumers up to the end consumer.

I got the error after adding a couple fields to an Entity. The module where I was getting the Invalid Key error was in a separate module which consumed the Entity, which my module also consumed so Outsystems didn't say in my module that I needed to republish it, but since my module consumed another module, that OTHER module also had to be republished.

Republish all consumers would likely fix the error, however, ain't nobody got time for that, so I published the two core dependent modules and the error went away.