What is the use of ToCoveoFieldName method in covoe search in hive framework? [closed] - sitecore8

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
As of now i am facing some problem with field bind issue while get the response from coveo, inside the this method ToCoveoFieldName is implemented. Any one can help me on this.
Code snippet
raw.<%= ToCoveoFieldName("field Name", false)

Since you are having issues with this call, I am assuming that you might be migrating to the Coveo for Sitecore Hive Framework implementation, which mostly shifted from a back-end implementation to a front-end one for all of its major field logic.
This means that ToCoveoFieldName is not available any more on the server side. Instead, there is a JavaScript implementation of the same logic.
For instance, if you want to translate a field to the Coveo format, you can use CoveoForSitecore.Context.fields.toCoveo("field name").
I can see in your question that you are within a result template, there are already two helpers to get you either the field name or the value.
<div data-field={{= coveoFieldName("field name") }}>
and
<div>{{= coveoFieldValue("field name") }}</div>. (This one is the equivalent of calling raw[coveoFieldName("field name")])
Those helpers are explained in more details in the documentation, on the Editing the Content of a Result Template page (for version 5.0+) and Coveo Fields Resources Component page (for versions <5.0 and 4.1+).

Related

Autopopulate Form-Fields from DB with Coldfusion [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
i've a question and need your help
i have a empty form with about 10 input fields. all i want to do is :
if a user fill in the user's login name and hit the tab key - the other fields should be filled out with the related data stored in the database. like users location, email etc.
could some give me a cfml related example please?
Here is how to approach this:
Use javascript to check for on tab event ( key press for the tab key )
Call a cfc, passing the value of the input field to the cfc
query the database for a field that matched exactly that data
return the data as json and populate the rest of the fields.
Assuming you have basic javascript and cfml skills this would be the way I would approach this.

One form across two pages django [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to create a form that does the following: the user specifies the number of questions that they want to ask and then on the next page, the user is able to fill out the relevant details pertaining to the number of questions that they to ask. I was wondering if there is a simple way to do this using django forms?
My approach is as follows:
I use one form to record the number of questions that the user wants to ask with a general description, then when the user clicks submit/next, the next view would create a form with those number of questions; however, I'm running into a complication when trying to use this method. I want to link the first form to the second form, but not sure how to because I can't preserve any information in the view from each call.
Is there a better way of going about this problem?
You certainly can preserve information between views. Perhaps the easiest way to do this is in URL parameters; your first view can redirect to "/second_view/?number_of_questions=5" and the second view can access request.GET['number_of_questions'].
An alternative, which is particularly useful if you have a lot of data, would be to use the session; add the data to the session on submit in the first view, and pop it out in the second.
In Django 1.8, the django.contrib.formtools module was moved into a separate package, django-formtools. It includes the FormWizard, which is the standard tool you'd use to create a form that spans multiple pages and/or steps.

Passing information from one template to another [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I show list of available things in database against a search. Now i want to make each item fetched by database a link which can lead to another page and on that page i could show this chosen item in detail. So my problem is how can i pass this information from this page to the new page?
You can pass the id of your item, so in the new page you can query again the database for more details.
if you use include tag you can pass object also:
{% include "url/to/your/template" with object=your_object %}
and then inside your detail's template you can call as usual
{{ your_object.detail }}

How to Retrieve Related Records using plugin in Dynamics crm [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
In dynamics crm records has subgrids. subgrids associated with other records. Now how Retrieve related Records using plugin. Any references would appreciated.
Normally a subgrid displays related records connected by a relationship, 1:N or N:N.
You need to get the relationship name and after using the right methods.
Relevant MSDN articles:
http://msdn.microsoft.com/en-us/library/gg509021.aspx
http://msdn.microsoft.com/en-us/library/gg309538.aspx
In plugin you can't directly access what you have displayed in Form Grid. If records inside grid are associated with main entity the you can retrieve those records by querying (QueryExpression, Fetch XML or Linq) on related entity where they are associated to main entity.
For example code have look at the following links:
Retrieve related entity data
Retrieve associated records (N:N related)

Django dynamically changing the required property on forms [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to dynamically change the required attribute on form fields. The reason for doing this is because a user can select "Same address as previous user" yes/no.
If yes then it hides the fields on the frontend and I would want to make the fields which are required by default not required when validating / processing the modelform.
Here is a very nice discussion of this topic in general: Dynamic form requirements in Django .
If you just want to do something really simple, there are two very basic ways that I can think of:
Set the field to not be required and use a custom clean function to check that it exists when it should exist. (If you want an asterisk to appear after the field title, just use some simple javascript.)
Have two different forms--one with the field required and one without--and use javascript to display the correct form.
The first solution is obviously much simpler for exactly what you asked, but if you want to do something even slightly more complicated, you might prefer the second option.