Questions tagged [sitecore-api]

For questions related to Sitecore's API, covering questions about how to access, create, update or or delete data, as well as questions about how the Sitecore code-base is or can be used for custom or native logic, etc.

Filter by
Sorted by
Tagged with
0
votes
2answers
36 views

Domain level cookie in Sitecore

I need to set main domain(abc.dis.com) cookie in my sub domain(xyz.dis.com) in sitecore,please suggest. Please find the below code snippet,but it's not working. Thanks in Advance
1
vote
0answers
27 views

How can the Sitecore search API be extended to support Azure search traffic analytics?

I'm experimenting with adding support for conditionally returning SearchId for Azure search traffic analytics purposes (https://docs.microsoft.com/en-us/azure/search/search-traffic-analytics) as part ...
0
votes
1answer
49 views

What is the use of * in Hostname

Why we create Site like below in Site definition: <site name="Test Site"> <patch:attribute name="hostName">*</patch:attribute> <patch:attribute name="...
0
votes
1answer
25 views

Difference between site[@name='scheduler']" and site[@name='website'] in Site definition

What is the use of <site patch:before="site[@name='scheduler']" instead of <site patch:before="site[@name='website']"
1
vote
2answers
238 views

'There are no forms to display' message in Sitecore 9 Forms Dashboard

I am getting 'There are no forms to display' message in Sitecore 9 Forms Dashboard in Production environment In chrome developer tools, getting below error message in Console tab with below error ...
2
votes
2answers
194 views

Sitecore Jobs and IIS Pool Recycles

From what I understand a Sitecore job simply runs as a background thread within the web application, i.e. a IIS worker process. How does this work with the periodic IIS pool recycling? I mean if you ...
0
votes
0answers
96 views

Message: Value cannot be null. Parameter name: context.Contact

I am working on Sitecore 8.2 version. I am getting an exception in production environment log file. I am not able to replicate same issue in my local neither able to figure out why this issue is ...
1
vote
1answer
29 views

Programatically set publishing options to Sitecore for specific language version

I wanted my sitecore item to publish only a particular language version. For example, I have english and French, but I only want to publish the French language. My plan is to set the "Publishable To" ...
1
vote
1answer
107 views

Glassmapper 5 SitecoreChildren listing items even if the version count is 0

We upgraded Glass Mapper version from 4.2.1.190 to 5.4.21.0. In our model, we are using [SitecoreChildren(InferType = true)] to get the child items. For few of the child items, language fallback is ...
3
votes
1answer
48 views

How do I show custom error message on OnItemSaved event?

The ask is to show the following kind of message on the OnItemSaved event. I am unable to show a similar custom message on the OnItemSaved event. I am always getting some default exception ...
1
vote
0answers
46 views

JSS Headless mode issue

I am trying to run my local jss app in headless mode. while trying to hit the jss service, I am not getting the expected o\p. I can the security info object has 401 as statuscode. If I try hitting ...
2
votes
1answer
82 views

@Html.Sitecore().Rendering does not rendering view even after executing without any errors

I am trying to use @Html.Sitecore().Rendering("--id--", Model.Property) to call render a staic view. It is not rendering on page. Layout: @Html.Sitecore().Rendering("--Myviewid--", Model) Myview: @...
9
votes
3answers
4k views

What is the best way to bulk-create items programmatically? [closed]

What is the best way to create many items in bulk under a certain item, using code? What are the things to consider in such scenarios? What are the pros and cons?
1
vote
1answer
132 views

Sitecore.context.item is null in sitecore 9 custom form submit action?

I created a item in sitecore and added sitecore 9 forms rendering to that item. I have created custom form submit action and saved data to custom database. In my custom save i have used customData....
0
votes
1answer
63 views

Method not found: 'Boolean Sitecore.ContentSearch.SolrProvider.SolrContentSearchManager.get_EnableHttpCache()'

After upgrading from Sitecore 8.2 to Sitecore 9.1, which updated the Sitecore.ContentSearch.SolrProvider to v4.0.0.0, the code compiles fine but we get the following when trying to access the site: ...
1
vote
0answers
36 views

What's the best way to upstream and downstream media in Sitecore?

Recently I came across a requirement to define the best strategy to upload and download media for Mobile App. Website data is managed under Sitecore CMS currently. At first glance, below thoughts ...
2
votes
1answer
162 views

Sitecore SXA Azure Search Facets Returning 400 Bad Request when there are more than 50 results

I have a search page that is working correctly on my local instance using SOLR, but when we move the page to our AZURE Instance it fails. The AZURE Instance is using AZURE Search instead SOLR. If I ...
-1
votes
1answer
109 views

Sitecore came up with GraphQL in 9.2, so internally does they use Sitecore API?

What does GraphQL use internally to query the Sitecore items?
1
vote
1answer
225 views

Sitecore custom api routing is not working

We have a multi-site environment. In one of the module, we are calling the same controller/action from all the sites. Perhaps, the same Javascript file which calls this controller/action is ...
0
votes
0answers
58 views

How to retrieve an item in Draft workflow state

I have a script that goes through the tree starting at a certain node to find all items of a specified language version not in a publish workflow state and switch them over to the publish state. ...
0
votes
0answers
53 views

Calling component from another component via anchor link

I have a modal component which is basically a popup with some content in it. I have to ask if it is possible to link that component from another component. For example I have anchor link in another ...
0
votes
1answer
71 views

Add recipient list in EXM programmatically - Sitecore 9.1.1

I was looking for how to add a list to the Included Recipient List section to an EXM MessageItem programmatically. In Sitecore 8.2 you could do MessageItem.RecipientManager....
0
votes
1answer
341 views

Read URL from Rendering Parameter General Link in Sitecore 9

I have used general Link as rendering parameter . How I can extract URL in c#. For Single line text I am using below piece of code. var renderingModel = Sitecore.Mvc.Presentation.RenderingContext....
4
votes
1answer
88 views

“Error occurred” (500) when collecting basic information about your Sitecore installation

I have raised a ticket on the Sitecore support portal. They asked me to provide basic information about my Sitecore site from each instance in your environment. Check the article https://kb.sitecore....
2
votes
1answer
311 views

Sitecore Glass Mapper 5.3.15 not loading children by default

I have upgraded the website to Sitecore 9.0.2 and since my project has a dependency on Glass mapper, I have upgraded Glass mapper to 5.3.15. My Glass mapper maps to the menu model and it does load ...
0
votes
2answers
74 views

Can I have multiple the same facet types with different facet keys?

in every article and documentation I can see they are using for one facet type one (default) facet key. MyCustomFacet facet = new MyCustomFacet(); var facetReference = new FacetReference(contact, ...
2
votes
0answers
137 views

Index update process are running repeatedly in same index

We have this api that is creating and publishing item programmatically. (This item is created under a bucket folder). I've checked the logs and noticed that in between the process, our index are being ...
-1
votes
1answer
80 views

Get all the media items on the current page [closed]

I want to get all the Sitecore media items on the current page. This could be an image, video, pdf ,mp3 or docx Has anyone done something similar to this? What i am currently doing is Getting all ...
8
votes
2answers
450 views

Login to Sitecore 9.1 across multiple subdomains

I am trying to login to Sitecore across multiple domains. I mean, I have two different sites abc.x.com and xyz.x.com. is there a way to set the auth cookies at parent domain level, in my case at x....
1
vote
1answer
197 views

Experience Explorer 403 forbidden on sitecore api ajax call [closed]

I'm encountering an issue which I can't resolve : using explore mode in the experience editor, I get 403 errors when trying to see any of the data from the current visit (the tabs and accordions are ...
5
votes
1answer
934 views

Getting a list of items from the ItemService API matching a specific field value

I'm trying to get a list of items from Sitecore that match a custom tag field. This is from an external application so I need to use one of the APIs to do this. I've tried using the Sitecore ...
0
votes
2answers
76 views

Is there any way to render the Page instead of item name with the specific field of text?

I got the requirement from our client that he wants to render the Page instead of page item name with the specific field text. Ex: I have a page item name as "findyourmarket". So this page will ...
1
vote
1answer
352 views

JWT tokens for authentication for 9.0 UPDATE 1

I have an instance running SxC 9.0 update 1. I was working on an API which had to be consumed by a 3rd party application. Can you provide some input for using token bear mechanism to protect my API. ...
1
vote
1answer
99 views

How to check access right in SitecoreController for Sitecore 9.1

In my JSON controller I want to check the access right from the User. My code looks like this public class MyController : SitecoreController { public static bool CheckAccessRight() { ...
4
votes
2answers
84 views

Is Virtual user concept available in XM version?

One of the client is having an XM license and they need to implement the virtual user concept of the Sitecore do they need to update the existing licence or this feature is already supported with the ...
3
votes
1answer
211 views

Accessing SXA Site Grouping Site Settings Properties from Code

I have a SXA site created and under "/settings/Site Grouping" I have defined a Site item. I want to access "Other Properties" fields (ex: "dictionaryPath" which I have added into Other properties) ...
0
votes
0answers
64 views

Sitecore Commerce 9 - B2B Organizations Support

Does Sitecore Commerce 9 or Sitecore XP supports B2B OOTB? So, here what I mean: Organization: organization should contains multiple users with multiple roles, it should contain different fields, ...
1
vote
3answers
294 views

EXM report is empty (data is not being captured) in scaled environment

I am working with Sitecore 9.0 update 2 on Azure. Server is scale out : 1CM and 3CD. After email campaign is run, we can receive email but reporting is not working. It doesn't have any data is as ...
4
votes
1answer
83 views

Logic for Enroll contacts from list in Sitecore 9.1

There is a new cool feature called Enroll contacts from list in Sitecore 9.1: I'm wondering where the actual logic resists (which assembly and class). I'm going to utilize this functionality by ...
3
votes
1answer
132 views

Create media item and specify item id

I have a scenario where I need site visitors to be able to upload media items via CD server. My plan is to upload to web database first and use EventQueues to then have the CM server fetch the ...
0
votes
1answer
348 views

How to copy item A to item B without loosing the ID of B?

I want to make the item B (destination) identical to item A (source), without changing the ID of B. I tried with the following: var sourceXmlString = source.GetOuterXml(false); var sourceXml = ...
2
votes
2answers
111 views

Sxa tokens not taken into account in code query

I am working on a custom field which is based on :https://marketplace.sitecore.net/en/Modules/A/Advance_Image_Field.aspx I am trying to make it suitable for SXA by changing the way to find thumbnails....
0
votes
0answers
34 views

Many Virtual Users entries are there in Sitecore core database Properties table [duplicate]

Below are the two queries and their outputs we ran in core database of our production enviroment and 98% of entries are from sitecore\virtualssuser. I think because of this, Sitecore client login ...
0
votes
0answers
136 views

The partial view '/Areas/company/Views/PartialLayouts/SpotContainer.cshtml' was not found or no view engine supports the searched locations

Recently we have upgraded Sitecore from 8.1 version to 9.0.1 version. After upgrade few of the pages were not able to load and it is showing following error. The partial view '/Areas/company/Views/...
1
vote
1answer
310 views

Save popup message is frequently shown in Sitecore [closed]

I have added values in few fields across 400+ items in the Sitecore programmatically. After creating all the items in the Sitecore master database, I am getting this message when I click on each one ...
1
vote
1answer
810 views

Creating Media Items using the RESTful ItemService API

Quick background, re-building a "product importer" exe that was written for v7 using the old web API and ideally want to replicate all the old logic to work in the new v8 site using the RESTful ...
0
votes
1answer
106 views

sitecore language selector in site header

i have multi-language sitecore website and i m trying to create a language selector in my site header to change site language . im trying this code but not working : @{ string siteurl = string....
1
vote
1answer
37 views

GetItemUrl page name casing

I am creating a page url from a Sitecore item using the following code: var pageUrl = LinkManager.GetItemUrl(item); The Sitecore item starts with a capital letter, e.g. Page. At one machine ...
0
votes
0answers
30 views

Workflow process - Log the actions in JIRA [duplicate]

I have created a workflow for content editors. Once they edit the contents, I would like that to be logged in JIRA. Is there a way to link the sitecore item with the JIRA ticket?
1
vote
1answer
109 views

Droplink value is always returning null in post action

I am trying to build a form which contains state as droplink and given datasource as states . here's the snippets of my employee model and state. i am getting all the states in the get action of ...