List_SortColumn_GetOrderBy causes internal error?

Hello,

I am new to OutSystems and I'm learning in OutSystem 11 Web App course.

In 11.4 Advanced UI pattern Exercises, I set up List_SortColumn_GetOrderBy(MovieTable.Id, "{Movie}.[Title]") in Dynamic Sort, as the material said. After that, the internal error causes.
When I deleted the above statement, the error was gone.

However, how could I solve this problem with remaining List_SortColumn_GetOrderBy?


Here, the error is,

Message: The given key was not present in the dictionary.

Stack:
The given key was not present in the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at OutSystems.HubEdition.RuntimePlatform.BaseAppUtils.rp#tiapuigr(IDMLIdentifiers fc, Match fd, String[] fe, IDictionary`2[] ff)
   at System.Text.RegularExpressions.RegexReplacement.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat)
   at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator)
   at OutSystems.HubEdition.RuntimePlatform.BaseAppUtils.ReplaceEntityReferencesAndAttributesInOrderBy(IDMLIdentifiers dmlIdentifiers, String paramValue, String[] entityNames, String[] entityAliases, IDictionary`2[] entityNamesToAttributes)
   at ssOSMDb_mg.Flows.FlowMainFlow.ScrnMovies.FuncssPreparation.datasetGetMovies(HeContext heContext, Int32 maxRecords, IterationMultiplicity multiplicity, Int64& outParamCount, String qpstList_SortColumn_GetOrderBy, Boolean qpboMovieDvdFilter, Int32 qpinGenreId, String qpstMovieNameOrPlotFilter)
   at ssOSMDb_mg.Flows.FlowMainFlow.ScrnMovies.Preparation(HeContext heContext)
   at ssOSMDb_mg.Flows.FlowMainFlow.ScrnMovies.Page_Load(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Best regards,

Mai

Solution

Hi Mai,

Normally this error means the attribute you are trying to sort on does not exist in the entity. Please make sure the column exists in the table.

Regards,

Nordin

Solution

Nordin Ahdi wrote:

Hi Mai,

Normally this error means the attribute you are trying to sort on does not exist in the entity. Please make sure the column exists in the table.

Regards,

Nordin

Hi Nordin,

Thank you for your reply!
I don't know why but it was working, even though I used the same sentence.
I guess that the cause was related to session.

Anyway, thank you for your help and that link was helpful.

Best regards,
Mai

You're most welcome! I'm glad it's working now Mai.

Regards,

Nordin

Hi Mai,

The List_SortColumn pattern uses the session to store the current sorting criteria, if you originally made a mistake on the sorting criteria (very easy) and caused your application to show the Internal Error page... until you log out that wrong sorting criteria will be in session and will be used on your aggregate (that runs in the Preparation of your screen)... and will cause more Internal Error pages until you completely close the browser.

In this situation, the best way is to always use a different browser after fixing any original problems you had.

Hi Mai,

It happened to me too yesterday. It was caused by my own mistyping. In the column property of the List_SortColumn widget I typed: 

"{Movie}.{Title}"

instead of:

"{Movie}.[Title]"

I completely overlooked that... After testing it in another session, problem was solved.