Forum Discussion
hi ,Gopikrishnan
First of all, thank you for your reply!
I tested this code, but I get the error message "parent.thisItem is undefined" or "menuFrame.populateAccessMenu is not a function".
Later I changed the
aras.uiReShowItem(parent.thisItem.getID(), parent.thisItem.getID());
changed to
"aras.uiReShowItem(document.thisItem.getProperty("id"), document.thisItem.getProperty("id"));
There is still the error message "menuFrame.populateAccessMenu is not a function"...
And it also seems to cause infinite loops when placed under this event
Hi Mavis
Can you try below steps
Remove all the methods and event added as per my previous suggestion.
Step 1: Create new C# Server Method and add below code
Innovator inn = this.getInnovator();
int currentValue = Int32.Parse(this.getProperty("score_1"));
Item relItm = inn.newItem("Performance_SelfScore", "get");
relItm.setProperty("source_id", this.getID());
relItm.setAttribute("select", "self_score");
relItm = relItm.apply();
int sum_self_score = 0;
for (int i = 0; i < relItm.getItemCount(); i++)
{
sum_self_score = sum_self_score + Int32.Parse(relItm.getItemByIndex(i).getProperty("self_score","0"));
}
if(currentValue != sum_self_score)
{
Item updateItem = inn.newItem("Performance_Self_Evaluation", "edit");
updateItem.setAttribute("id", this.getID());
updateItem.setProperty("score_1", sum_self_score.ToString());
updateItem = updateItem.apply();
}
return this;
Add this method to Performance_Self_Evaluation item type server Events OnAfterUpdate event
Thank You
Gopikrishnan R
- Mavis4 years agoIdeator III
hi,Gopikrishnan
Thanks again for taking the time to help me!
You wrote the method in C# ,it works!
I have also rewritten the original VB code I wrote
plus determine if the current score_1 is the same as the previous score_1
It will not loop infinitely and it will run!Also, about the code you wrote in the previous paragraph (Javascript)
I will
"aras.uiReShowItem(parent.thisItem.getID(), parent.thisItem.getID());"
change to
"document.thisItem.setProperty("score_1", sum_self_score);
handleItemChange("score_1",sum_self_score);"
It works too!Thank you!!
- Gopikrishnan4 years agoAccelerator II
Glad to hear. Finally all 3 solutions are working as expected :)