Skip to main content

Hi Skuid Community! I am trying to back into some user metrics without any coding. What I’ve decided I want to try to do is auto-create a note or activity on my Account whenever my Account detail page is loaded. I’m using similar auto-creation for when certain buttons are clicked, but I’m not sure how I could do this every time the page is loaded (we are overriding our standard account detail in SFDC to the Skuid page). Has anyone tried this? Any other suggestions on how to achieve something similar? Any reports built?

Basically I just want to know how many times a user lands on the Skuid Acct Detail page, and how many times they are clicking on buttons that take them back to Classic functionality.

Ryan,

I don’t know of any way to create a row on page load except with a snippet.  Here is a sample to get you started.  You need to recreate the snippet as ‘Inline’.  You also need a model on the Task object with the Subject field selected.  Uncheck the boxes to ‘Query on Page Load’ and ‘Create default row if Model has none’.


(function(skuid){<br>var $ = skuid.$;<br>$(document.body).one('pageload',function(){<br>var pageViewedTask = skuid.model.getModel('CreateTaskUponPageLoad');<br>var pageName = skuid.page.params.page;<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; pageViewedTask.createRow({<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; additionalConditions: t<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { field: 'Subject', value: pageName}<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ], doAppend: true<br>&nbsp; &nbsp; &nbsp; &nbsp; });<br>&nbsp; &nbsp; &nbsp; &nbsp; pageViewedTask.save({callback: function(result){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (result.totalsuccess) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Get the 15-digit Id of our newly-saved George Bailey Contact,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // which will have had its Id and other fields updated after save<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(pageViewedTask.dataa0].Id15);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Show the record<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(pageViewedTask);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(result.insertResults);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(result.updateResults);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(result.deleteResults);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }});<br>});<br>})(skuid);


Thanks,

Bill


Thanks for the snippet Bill! I’ll take a look this week into this and see if I can get it to work as expected 🙂


I was able to create a note when the page loads. Basically, I created a 1-record model to look for a specific note subject line. If that was not present, then I created a model action to create the note with default text in it. If the model already had that record, then it would not kick off the model action.

Actually, I ended up not going with this option as once in a while we didn’t want that specific note created. So, I used the same model methodology, but if the model didn’t have any data rows in it then I presented a button that said “Create Note” and it created the note with default text to fill in. If the model had the row already in it, then I hid the button and showed the note.

No snippets needed! Thanks everyone for your help on this one.