Hi All,
I have used the custom task box thats been uploaded in this discussion.
I triggered the BPT and a Human task has been assigned and I Opened the human task and clicked logout button in the page.
On log out I am getting error like below while executing advanced query.Not sure how to resolve.Please let me know what does this error message means any pointers are helpfull
Error:Error in advanced query GetUserActivities in BPT_GetUserActivities in CustomTaskBox in GateKeeperAndCompliance ( SELECT {Activity}.[Id] AS IActivityId, IFNULL({Activity_Definition_Lang}.[Label], {Activity_Definition}.[Label]) AS Label, {Activity}.[Inbox_Detail] AS Detail, {Activity}.[Created] AS StartDate, {Activity}.[Due_Date] AS DueDate, CASE WHEN {Activity}.[Due_Date] IS NULL or {Activity}.[Due_Date]=@NullDate THEN 0 ELSE TIMESTAMPDIFF(day, {Activity}.[Due_Date], getdate()) END AS DaysOverdue, IFNULL({Activity_Definition_Lang}.[Inbox_Instructions], {Activity_Definition}.[Inbox_Instructions]) AS InboxInstructions, {Activity_Definition}.[Skippable] AS Skippable, {Process}.[Id] AS ProcessId, IFNULL({Process_Definition_Lang}.[Label], {Process_Definition}.[Label]) AS ProcessLabel, {User}.[Id] UserMasterId, {User}.[Name] UserName, {Group}.[Id] GroupId, {Group}.[Name] GroupName, {ACTIVITY_INBOX}.* FROM {Activity} INNER JOIN {Activity_Status} ON {Activity}.[Status_Id] = {Activity_Status}.[Id] AND {Activ ...): Could not assign 'GateKeeper1' to 'InboxItem.GroupId'... Input string was not in a correct format.
Hi Rajasekhar,
You must understand that we are using an advanced query to get all relevant information from the database and afterward map it into 2 OutSystems structures (InboxItem and ACTIVITY_INBOX). to make sure that it's working properly, each attribute that you fetch from the database must map into the attribute of each structure using the same order. If you didn't change anything, check the sample code attached, you should have the following:
Based on the error stack, it seems that you change some elements of the first list (14 attributes), either the SELECT statement or the InboxItem.
If you are not able to find the issue, please share with the OML file where you have the query.
Regards,Paulo Garrudo
Rajasekhar Hasti wrote:
Hi Paulo,
Thanks for the reply.I have the entities and structure as like in the OML provided by you.
I have an entity called Product and on creation of new product triggering a human activity by sending the product Id to process.
Here is the scenario where I am getting this error.
Note: I have not changed the order of attributes in Activity_Inbox not in Inbox Item also not changed any attributes.
Attaching the OML for your reference
Error in advanced query GetUserActivities in BPT_GetUserActivities in CustomTaskBox in GCMod1 (SELECT {Activity}.[Id] AS IActivityId, ISNULL({Activity_Definition_Lang}.[Label], {Activity_Definition}.[Label]) AS Label, {Activity}.[Inbox_Detail] AS Detail, {Activity}.[Created] AS StartDate, {Activity}.[Due_Date] AS DueDate, CASE WHEN {Activity}.[Due_Date] IS NULL or {Activity}.[Due_Date]=@NullDate THEN 0 ELSE DATEDIFF(day, {Activity}.[Due_Date], getdate()) END AS DaysOverdue, ISNULL({Activity_Definition_Lang}.[Inbox_Instructions], {Activity_Definition}.[Inbox_Instructions]) AS InboxInstructions, {Activity_Definition}.[Skippable] AS Skippable, {Process}.[Id] AS ProcessId, ISNULL({Process_Definition_Lang}.[Label], {Process_Definition}.[Label]) AS ProcessLabel, {User}.[Id] UserMasterId, {User}.[Name] UserName, {Group}.[Id] GroupId, {Group}.[Name] GroupName, {ACTIVITY_INBOX}.* FROM {Activity} INNER JOIN {Activity_Status} ON {Activity}.[Status_Id] = {Activity_Status}.[Id] AND {Activity ...): Could not assign 'Rajasekhar Hasti' to 'InboxItem.GroupId'... Input string was not in a correct format.
Paulo Garrudo wrote:
Like Paulo Garrudo stated, the output structure needs to match (in number of columns, data types and their order) the selected columns from the query.
Your InboxItem structure seems modified, and a clue is in the error detail - Could not assign 'GateKeeper1' to 'InboxItem.GroupId'. GateKeeper1 is the username, and this is being incorrectly assigned to GroupId, which causes the runtime error.
To solve it, just reposition (use drag&drop) the UserName attribute - it should be right after UserId.
Thanks a lot.Issue got resolved.
An alternative version provided by Customer Support.
Alan Telford(Maxtel) wrote:
Awesome, thanks for sending this, the 2010 version is awful lol.