can't mark tasks as complete using the check mark

  • 1
  • Question
  • Updated 4 years ago
  • Answered
I am using task tables using pretty much the code found here:
http://help.skuidify.com/s/tutorials/...
the green check box to mark tasks complete is not working.
is there an issue with the code on this sample page?
Photo of Brandon Gage

Brandon Gage

  • 376 Points 250 badge 2x thumb
  • sad

Posted 5 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Well the link in the tutorial to our page repository was old and moldy.  Here is a better link to a sample page that has the task table working correctly. 

https://github.com/skuidify/SamplePages/blob/master/pages/Opportunity%20Detail%20Starter%20Page

Let me know if this still gives you trouble. 


Photo of Joel Knutson

Joel Knutson, Employee

  • 474 Points 250 badge 2x thumb
Hi Brandon, I just tested our sample page, and it is working. Try this one and see if it works:

skuid.snippet.registerSnippet('tasks.markCompleted',function(params){ // Mark all selected items as closed, // then save our 2 Tasks models var model = params.model, list = params.list, selectedItems = params.item ? [params.item] : list.getSelectedItems(); if (selectedItems.length === 1 && skuid.model.isNewId(selectedItems[0].row.Id)) { alert('Please finish creating this Task before marking it as completed.'); return; } $j.each(selectedItems,function(i,item){ model.updateRow(item.row,'Status','Completed'); }); // Block the list from having updates list.element.block({ css: list.blockUICSS, overlayCSS: list.blockOverlayCSS, message:'Marking Tasks as Completed...' }); var saveFinishes = model.save({callback: function(){ var updateFinishes = skuid.model.updateData([model,skuid.model.getModel('TaskHistory')]); $j.when(updateFinishes).then( function(){ list.element.unblock(); }, function(){ list.element.unblock(); } ); } }); });
Photo of Shanna Leslie

Shanna Leslie

  • 70 Points
Hi Joel,

I am working with Brandon on this and the code that we are using is exactly the same as you posted. It only works the first time. Could there be a caching issue here? We are using Chrome.

Thanks!
Photo of John Nelson

John Nelson, Product Manager

  • 3,234 Points 3k badge 2x thumb
Shanna or Brandon, are you guys seeing any javascript errors in the console when you run it the second time?
(Edited)
Photo of Shanna Leslie

Shanna Leslie

  • 70 Points
No. It just doesn't seem to execute the second time.
Photo of John Nelson

John Nelson, Product Manager

  • 3,234 Points 3k badge 2x thumb
Shanna, would you grant Skuid access so I can take a look at this? 
Photo of Vijay Goel, M.D.

Vijay Goel, M.D.

  • 60 Points
For me, the code posted on http://help.skuidify.com/m/supercharge-your-ui/l/107247-build-an-activities-related-list-tab works, but in Chrome I it hangs (item is marked complete, but page hands with gray overlay and words: "Marking tasks as completed"
In the console I get the error:

Uncaught TypeError: Converting circular structure to JSON skuid__SkuidJS:4
lskuid__SkuidJS:4
iskuid__SkuidJS:4
model.save.callbackUI?page=OpportunitiesTab:120
a.RemotingStubs.save.escapeskuid__SkuidJS:4
e.cbVFRemote.js:132
VFExt3.direct.RemotingProvider.VFExt3.extend.doCallbackVFRemote.js:99
VFExt3.direct.RemotingProvider.VFExt3.extend.onDataVFRemote.js:94
VFExt3.extend.handleResponseVFRemote.js:75
aVFRemote.js:39
(anonymous function)VFRemote.js:40

Is there anything you would suggest to make the page work?

Photo of Louis Skelton

Louis Skelton

  • 4,878 Points 4k badge 2x thumb
I had this issue and it was because I hadn't linked the snippet to the correct model as referenced in the lower part of the snippet code (I was using a model named 'Tasks' rather than 'TaskHistory'). Yours might be hanging for a different reason though...

var saveFinishes = model.save({callback:
                    function(){
                        var updateFinishes = skuid.model.updateData([model,skuid.model.getModel('Tasks')]);
                        $j.when(updateFinishes).then(
                            function(){ list.element.unblock(); },
                            function(){ list.element.unblock(); }
                        );
                    }
                });