This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Guid goalId = // your goal Id | |
| KeyBehaviorCache cache = Sitecore.Analytics.Tracker.Current.Contact.GetKeyBehaviorCache(); | |
| bool goalTriggered = cache.Goals.Any(a => a.Id == goalId); | |
| if(!goalTriggered) | |
| { | |
| // continue with goal execution | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Guid outcomeId= // your outcome ID | |
| KeyBehaviorCache cache = Sitecore.Analytics.Tracker.Current.Contact.GetKeyBehaviorCache(); | |
| bool isAssociatedOutcome = cache.Outcomes.Any(a => a.Id == outcomeId); | |
| if(!isAssociatedOutcome) | |
| { | |
| // continue with assignment of Outcome here | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Register-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Define Parameters | |
| $prefix = "local" | |
| $PSScriptRoot = "C:\resourcefile" | |
| $XConnectCollectionService = "$prefix.xconnect" | |
| $sitecoreSiteName = "$prefix.sitecore" | |
| $SolrUrl = "https://localhost:8989/solr" | |
| $SolrRoot = "C:\solr-6.6.1" | |
| $SolrService = "solr-6.6.1" | |
| $SqlServer = "(local)" | |
| $SqlAdminUser = "sa" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class OfferImport | |
| { | |
| public string CouponPath { get; set; } | |
| public string[] Databases { get; set; } | |
| public string SiteName { get; set; } | |
| public void Process(Item[] items, CommandItem command, ScheduleItem schedule) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Sitecore.Data; | |
| using Sitecore.Data.Items; | |
| using Sitecore.Data.Managers; | |
| using Sitecore.Diagnostics; | |
| public class OffersImportCommandItem : CustomItem | |
| { | |
| public static readonly ID TemplateID = ID.Parse("{CC29CCE7-D1CC-4EA2-90CF-573CBA493616}"); | |
| public static readonly ID SiteNameFieldId = ID.Parse("{D7D0D0EA-1904-473B-B003-3B4E88F9740C}"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="JobsExtension.aspx.cs" Inherits="Sitecore.Tools.Extensions.JobsExtension" %> | |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head runat="server"> | |
| <title>Jobs Viewer</title> | |
| <link rel="Stylesheet" type="text/css" href="/sitecore/shell/themes/standard/default/WebFramework.css" /> | |
| <link rel="Stylesheet" type="text/css" href="./default.css" /> | |
| <style type="text/css"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private readonly DateTime now = DateTime.Now; | |
| protected override void ShowJobs(StringBuilder stringBuilder, string name, ICollection<Job> jobs) | |
| { | |
| stringBuilder.AppendLine("<h1>" + name + ":</h1><br />"); | |
| if (jobs.Count > 0) | |
| { | |
| stringBuilder.AppendLine("<table class='jobs-table'>"); | |
| stringBuilder.AppendLine("<thead><tr><td class='counter'>No</td><td class='add-time'>Added</td><td class='title'>Title</td><td class='progress'>Progress</td><td class='priority'>Priority</td><td class='owner'>Owner</td></tr></thead>"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected override void ShowRefreshStatus(StringBuilder stringBuilder) | |
| { | |
| int result; | |
| int.TryParse(this.Request.QueryString["refresh"], out result); | |
| stringBuilder.Append("Last updated: {0}. ".FormatWith(DateTime.Now.ToString(CultureInfo.InvariantCulture))); | |
| int[] numArray = { 1, 2, 5, 10, 20, 30, 60 }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected override void OnLoad(EventArgs e) | |
| { | |
| JobManager.GetJobs(); | |
| var stringBuilder = new StringBuilder(); | |
| var requiredService = ServiceLocator.ServiceProvider.GetRequiredService<BaseJobManager>(); | |
| DefaultJobManager defaultJobManager; |