Creating Result Type Programmatically using C#

Hi,
I had created a custom display template and have uploaded on feature activation. now i need to automate the creating of result type.
Due to less documentation with respective to result type creation using C# i am posting in forum. i had referred the below url.
http://dev.net.ua/blogs/ivanbilokon/archive/2012/11/22/11389.aspx
But when i execute the code no error. the new result type is not getting added.
I expected a result as shown below screen
Please help me. Thanks in Advance.

Hello Ram, please check the below link http://nelsonlamprecht.wordpress.com/2013/12/27/sharepoint-2013-search-result-types/
Please remember to click 'Mark as Answer' on the answer if it helps you

Similar Messages

  • Create ADF elements programmatically using Java

    Hello,
    I use JDeveloper 11.1.1.2.0 and Java 6 (of course)
    <f:view>
    <af:document title="Some Text" id="d1">
    <af:messages id="m1"/>
    <af:form id="f1">
    <af:panelGroupLayout layout="vertical" id="pgl1" halign="center">
    <af:outputText value="Song" id="ot1"/>
    <af:media source="/midi/song.midi"
    standbyText="Song sample" player="quicktime" id="m2"
    contentType="audio/x-midi"/>
    </af:panelGroupLayout>
    </af:form>
    </af:document>
    </f:view>
    I would like to create this construct programmatically. The reason is that I would like to create not only one <af:media> tag but more. But for some reasons it's not a fixed portion of songs I could anticipate. Therefore I want to take the construct above as a template and add more <af:media> tags I need at the moment I realize how many songs I want to play.
    I would like to call this construct from a command button or link on another side to open a new window in which the user could choose among different songs to play.
    Do I have to use DOM or XPath to setup this or is ADF able to offer some support ?
    Best regards
    Martin
    Edited by: user463656 on 05.05.2010 01:41

    Should be something like:
    <f:view>
    <af:document title="Some Text" id="d1">
    <af:messages id="m1"/>
    <af:form id="f1">
    <af:panelGroupLayout layout="vertical" id="pgl1" halign="center"  binding="#{ManagedBean.panelGroup}">
    <af:outputText value="Song" id="ot1"/>
    </af:panelGroupLayout>
    </af:form>
    </af:document>
    </f:view>And somewhere in the MagaedBean methods:
    public class ManagedBean{
    RichMedia rm;
    while .. {
    rm = new RichMedia();
    rm.setstandbyText(....);
    rm.setSource(....);
    panelGroup.getChildren().add(rm);
    }And then refresh the panelgroup with partialTrigger ot partialTarget.
    Edited by: Valhery on 2010-5-5 2:04

  • Create List Definition Programmatically using Feature Receiver

    I am using a Feature Receiver to create a custom content type in the FeatureActivated event.  I know know to create a list instance through code to use my content type.
    What I would like to do is create a custom list definition (list template) to use my custom content type in the FeatureActiviated event.  I would like to do this entirely through C# code only (no xml files). I have been unable to find
    any examples of creating a list definition through code on MSDN.

    I hope below sample will be helpful for you to create a custom list and fields using code.
    In below code block, I have used different field types which include Text , Date, Boolean, choice & lookup filed.
    public override void FeatureActivated(SPFeatureReceiverProperties properties)
    SPSecurity.RunWithElevatedPrivileges(delegate()
    SPSite site = new SPSite(SPContext.Current.Site.ID);
    SPWeb web = site.OpenWeb(SPContext.Current.Web.ID);
    SPList listExistCheck = web.Lists.TryGetList("My List");
    SPList customList;
    if (listExistCheck == null)
    // Create list and record returned guid
    Guid customPagesListGuid = web.Lists.Add("My List",
    "My List", SPListTemplateType.GenericList);
    //Get list from stored guid
    customList = web.Lists[customPagesListGuid];
    // Set list properties and add required content types
    customList.Title = "My List";
    customList.OnQuickLaunch = true; // Set to true to display on the quick launch
    customList.ContentTypesEnabled = true;
    customList.EnableFolderCreation = true;
    customList.EnableSyndication = false; // Turn off rss
    customList.Update();
    customList.Fields.Add("First Name", SPFieldType.Text, true);
    customList.Fields.Add("Last Name", SPFieldType.Text, true);
    customList.Fields.Add("Company Name", SPFieldType.Text, false);
    customList.Fields.Add("Contact Number", SPFieldType.Text, true);
    customList.Fields.Add("Email", SPFieldType.Text, false);
    customList.Fields.Add("Post Code", SPFieldType.Text, true);
    customList.Fields.Add("Interest", SPFieldType.Choice, false);
    //For adding lookup coumn
    SPList targetList = web.Lists.TryGetList("Pages");
    if (targetList != null)
    customList.Fields.AddLookup("News", targetList.ID, false);
    SPFieldLookup lookup = (SPFieldLookup)customList.Fields["News"];
    lookup.LookupField = targetList.Fields["Title"].InternalName;
    lookup.AllowMultipleValues = false; lookup.Update();
    //for using choice field
    SPFieldChoice fieldStatus = (SPFieldChoice)customList.Fields.GetFieldByInternalName("Interest");
    string[] activityTypes = { "Interest 1", "Interest 2" };
    fieldStatus.Choices.AddRange(activityTypes);
    fieldStatus.DefaultValue = "Interest 1";
    fieldStatus.Update();
    //using multiline field
    customList.Fields.Add("Response", SPFieldType.Note, true);
    web.AllowUnsafeUpdates = true;
    customList.Update();
    //adding fields to default view
    SPView dView = customList.DefaultView;
    dView.ViewFields.Add("News");
    dView.ViewFields.Add("First Name");
    dView.ViewFields.Add("Last Name");
    dView.ViewFields.Add("Company Name");
    dView.ViewFields.Add("Contact Number");
    dView.ViewFields.Add("Email");
    dView.ViewFields.Add("Interest");
    dView.ViewFields.Add("Response");
    dView.Update();
    customList.Update();
    web.Update();
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer :)

  • Customize search result types in SharePoint 2013

    Hi
    I want to create the new Search Result types based on existing "List SharePoint Item" result type. I know how to do it manually . But i want it to automate it. can i do it using powershell script? is there anything available or somebody tried anything
    in this direction?
    So my requirement is bascially create the Result type with custom display template. Please suggest how to do using powershell script or sharepoint object model.
    Thanks

    Hi,
    According to your description, my understanding is that you want to create search result source programmatically in SharePoint 2013.
    Here are some links about creating search result source programmatically for you to take a look:
    http://sadomovalex.blogspot.com/2014/04/create-custom-search-result-source.html
    http://blog.tippoint.net/create-result-source-with-powershell-sharepoint-2013/
    http://mksharepointblogs.wordpress.com/2014/01/16/create-result-source-programmatically-in-sharepoint-2013/
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • Creating JAR files programmatically

    I am trying to create JAR files programmatically using the java.util.zip and java.util.jar APIs. I am starting with just a set of directories containing .class files. I can seem to make the JAR but if I try to use any of the classes in it they don't work. But, if I unzip the JAR using WinZip, the classes are usable. So I am somehow building the JAR file incorrectly. Does anyone have any ideas or suggestions? The code is pretty long so I won't post it yet but I can send it to you if you'd like to see it. Contact by email if you'd like to see the code. Thanks.

    What paths are you encoding? Here are a couple of rules:
    1 - All paths are '/' separated, and do not begin with a '/'.
    2 - All paths are relative (see 1) and contain the exact package name of the class, plus the class.
    E.G., the class java.lang.Object would look like this in your jar:
    java/lang/Object.classNothing more or less.

  • How to create a type table in designer 9i

    Hi
    In our company we use designer 9i. I want to create a type table using designer. Is it possible? I have a requirement where i need to create a type table and use in creating a view through designer.
    Create or replace type varchar2_ntt as table of varchar2(4000);
    [\pre]
    Please suggest.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi
    Here I am giving the step by step process.
    1. select the container in which container you are going to create the type.
    2.Go to tools then design editor and expand the container. There you will find oracle collection types. there we have to create a new one by clicking the + button on the left side.
    3. Give the name of the new collection type.
    4. And in the collection of tab, let it be scalar, give the scalar data type,and the size and click finish.
    5. then right click on that object and give generate. there you select theDDL files only and the give the path where the scripts have to go.
    This the process.
    Thanks,
    raju

  • Create data type string

    HI
    There is a way to create date type string using the command
    Create data type "string"...
    I know that I can create data type C but string dont have any restrication so how I can hanlde it ?
    Regards
    Joy

    Hi,
    You can use the create data statement:
    DATA: lo_data TYPE REF TO data.
    FIELD-SYMBOLS: <str> TYPE ANY.
    CREATE DATA lo_data TYPE string.
    ASSIGN lo_data->* TO <str>.
    Here <str> will be of type string.
    Kr,
    m.

  • How to add Services programmatically using BAPI_BUS2002_ACTELEM_CREATE_M

    Hi :
    I need to create a project programmatically using the standard PS BAPI. My problem is that I don't know how to add external activities ( Services ) into my project.  I have all steps, except this one. I think that the BAPI BAPI_BUS2002_ACTELEM_CREATE_M should do it but I cannot find where to put the Service Number, Text and Quantity.
    Thanks a lot in advance.
    Jose J. Quezada.

    The problem remains the same. The BAPI_NETWORK_MAINTAIN does not have the fields to add the Services. It can adds an External Activity. The services are External Activities but where are the fields. I need an example or a more specific response. I know how to add a Material for example, but the Services are quite different.
    Kind Regards,
    Jose.

  • Create Check Box Programmatically

    Hi ALL
    Let me know how to Create Check Box Programmatically using table column.
    Thanking You
    Rehards
    Lakmal

    You can't create Forms widgets dynamically. What you have to do is create them at design time and then hide/unhide them at runtime using things like stacked canvases.
    Regards
    Grant Ronald

  • How to create visitor roles programmatically

    Could you please help me how to create visitor roles programmatically using weblogic portal.
    Thanks in advance

    Hi,
    Point this method to the selectItems under selectonechoice.
            if (yourList == null) {
                (yourList = new ArrayList();
                DCBindingContainer bindings = ADFUtil.getDCBindingContainer();
                DCIteratorBinding iteratorbinding =
                    bindings.findIteratorBinding("yourVO1Iterator");
                if (iteratorbinding != null) {
                    Row[] rows = iteratorbinding.getAllRowsInRange();
                    String value = null;
                    Long key = 0L;
                    for (Row row : rows) {
                        value = (String)row.getAttribute("Attrib0");
                        key = (Long)row.getAttribute("Attrib1");
                        yourList .add(new SelectItem(key.toString(), value));
            return yourList;
    Thanks
    Nitish

  • How to create a subreport link programmaticly using java RAS sdk

    Hi,
    I want to create subreport link for couple of main report parameters programmaticly using RAS sdk.
    Main report has Param1 and Param2. I need to link these parameters to sub-report which doesn't have any parameters, so I can pass the parameters value just once when running the report and consume it's value in the sub-report.
    Below is the code I tried but I get "Invalid field name"error when I try to save the main report.
    ISubreportClientDocument subReportDoc = subReportCntrl
                      .getSubreport(subReports.getString(i));
    SubreportLinks srLinks = subReportCntrl.getSubreportLinks(subReports.getString(i));
    SubreportLink subRptLink1 = new SubreportLink();
    Fields paramFields = reportClientDoc.getDataDefinition().getParameterFields();
    subRptLink1.setMainReportFieldName(paramFields.get(0).toString());
    subRptLink1.setSubreportFieldName(paramFields.get(0).toString());
    SubreportLink subRptLink2 = new SubreportLink();
    subRptLink2.setMainReportFieldName(paramFields.get(1).toString());
    subRptLink2.setSubreportFieldName(paramFields.get(1).toString());
    srLinks.add(subRptLink1);
    srLinks.add(subRptLink2);
    subReportCntrl.setSubreportLinks(subReports.getString(i), srLinks);
    Thanks,

    Hi,
    I want to create subreport link for couple of main report parameters programmaticly using RAS sdk.
    Main report has Param1 and Param2. I need to link these parameters to sub-report which doesn't have any parameters, so I can pass the parameters value just once when running the report and consume it's value in the sub-report.
    Below is the code I tried but I get "Invalid field name"error when I try to save the main report.
    ISubreportClientDocument subReportDoc = subReportCntrl
                      .getSubreport(subReports.getString(i));
    SubreportLinks srLinks = subReportCntrl.getSubreportLinks(subReports.getString(i));
    SubreportLink subRptLink1 = new SubreportLink();
    Fields paramFields = reportClientDoc.getDataDefinition().getParameterFields();
    subRptLink1.setMainReportFieldName(paramFields.get(0).toString());
    subRptLink1.setSubreportFieldName(paramFields.get(0).toString());
    SubreportLink subRptLink2 = new SubreportLink();
    subRptLink2.setMainReportFieldName(paramFields.get(1).toString());
    subRptLink2.setSubreportFieldName(paramFields.get(1).toString());
    srLinks.add(subRptLink1);
    srLinks.add(subRptLink2);
    subReportCntrl.setSubreportLinks(subReports.getString(i), srLinks);
    Thanks,

  • Adobe Muse: Is it possible to create a Social Network type website using Muse?

    Hey everyone,
    So ive recently came up with what i believe to be a pretty nifty idea for a social network type website, but i was just wondering is it possible to create such a website using muse? Ive created a few websites with it but never integrated features such as profile pages for users, searching options and other common things found on a few of the more well known sites such as Facebook, Twitter and so on. I dont really want to say what my idea is for obvious reasons, but if anyone knows if you can create a social network style website using Adobe Muse that can incorporate these such features, Id love to know. and if so can you point me in the direction of how to go about it, or to some instructional videos or sites that will help me out. thank you so much everyone,
    Callum

    Hi Prabha Sharma,
    I am afraid that at this stage this is not possible via Muse as that requires server side coding. You can start off creating a skeleton/template for your social networking site via Muse and then use that further with your own custom code. however, I will not recommend that you continue making your site with Muse as you will face issues in altering the muse generated code.
    - Abhishek Maurya

  • Creating Custom fields (data type QUAN) using EEWB

    Hi all
    I tried to create two customised fields using EEWB for CRM Opportunity:
    1. Projected Volume (data type 'QUAN', length 13, 3 decimal places)
    2. Projected Unit (data type 'UNIT')
    In the SAP-generated tables, I have set the reference table field for 'Projected Volume' to point to 'Projected Unit'. However, I encountered errors that is related to Table Buffering and Restricted Transport for the Projected Volume field.
    If I were to change the data type to 'NUMC', field generation is ok. Does anyone know to resolve this issue? I need the Projected Volume field to be of data type 'QUAN' since decimal place is required.
    Thanks for your advice!

    SAP Note 746227 has addressed this issue. I will close this question.

  • Dynamically create document type Item Attribute using WF_ENGINE.AddItem API

    Hi
    Is WF_ENGINE.AddItem API , supported to create document type Item attributes dynamically ? If yes how do we set the display name of the attribute. If no then is there is any other method to dynamically create document tyoe item attribute?
    Thanks

    Hi,
    If the document is stored on a file system, then I would replace the message body with a PL/SQL document which includes links to the files as straightforward URLs. There would be no need to include them in the Workflow in any way. For example, I recently worked with a client where all the (file) attachments made within eBusiness Suite were then migrated into Oracle Universal Content Management and the attachment was replaced with a URL to the new document. Any notifications now just reference the URL link to the document within the document management system in an HTML notification. While the processing is going on, the user is given the list of files that exist as attachments, but no links because the document is being processed by the management system.
    If the attachments are going to be stored in Workflow as documents, you won't be able to change the display name though - display name is set for the attribute on the message, not for each specific notification. Changing the value of the display name for the message would impact all notifications that use that message, which isn't what you want.
    What you need is to dynamically build the notification (either using PL/SQL or OA Framework) and include a list of attachments in the notification. This may be a direct link to the document (either in a document management system or on a file system somewhere) that you can render as a URL, or a link to code that can retrieve the document from the database and serve that to the user. This is not a straightforward piece of work.
    If this is purely internal, you might be better off having a custom form / screen which displays the different documents, and link to that from the notification. Or you could link to a standard form for the transaction and have the users pick up the attachments directly from the transaction.
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://www.workflowfaq.com/blog ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • Use TYPE RECORD or Create Object TYPE to build Collection?

    Hi All,
    I need to pull in data from our ERP system via a DB Link to keep some of our Web Data up to date. I wasn't sure if I should pull the data into my collection by creating a TYPE RECORD or Creating an Object Type and fillng it that way. Is there a preferrable method?
    Record:
    TYPE ItemInventory IS RECORD (
    ProductID Products.ProductID%TYPE,
    Qty Products.QTY%TYPE);
    Object:
    Create Type ProdObj as Object(
    ProductID Products.ProductID%TYPE,
    QTY Products.QTY%TYPE);
    Maybe both are suitable....wasn't sure.
    Any suggestions/info is greatly apprecaited.
    S
    Edited by: ScarpacciOne on Feb 21, 2010 7:54 PM

    ScarpacciOne wrote:
    We have a complex view we use from our ERP system that allows us to pull all of our available inventory and update our website with that information. What I was thinking I would do is refactor the current procedures that are in place to update this information and pull that views information into a collection so that I could speed up the update process.The basic difference between the two is that one is a dumb record structure (similar to a C struct), whereas the other is an intelligent class (similar to a class definition in Java/C++). It can have methods and constructors.
    The next major difference is that one can only be use in the PL language and not in SQL. The record struct is a PL data type definition. PL cannot provide SQL engine support for it.
    On the other hand, the SQL type definition is supported by both the PL and SQL languages. This allows the type to be transparently used in both languages.
    I usually prefer the SQL type definition approach in general, as it allows for more flexibility.
    However, for pure collection processing in PL/SQL, there's very little to choose between the two approaches as they serve the exact same purpose - increasing performance by decreasing context switching between the PL and SQL engines.
    So you need to look beyond mere bulk collection and bulk processing to decide on which approach to use. For example, a SQL type definition allows for a standard SQL projection from cursors, enabling PL/SQL code to be cursor agnostic (as each cursor, irrespective of the table(s) queried, returns the same object type). However, if the aim is simply to bulk collect from that specific cursor, then it is a lot simpler to use a PL record struct.

Maybe you are looking for

  • How to create XML from relational tables based on an XML Schema ?

    There is no automated way in Oracle XML DB to define an automatic mapping between a set of columns in some existing relational tables and the elements and attributres defined by an XML Schema. However it is easy solve this problem by using the SQL/XM

  • Save as PDF from IE loses images

    Hello, I am dealing with a problem. I have Acrobat XI installed. I can open a letter in Internet explorer. This letter contains about 12 images. When I try to print the letter I chose Adobe PDF so it saves as PDF. Now the problem, when the letter is

  • In RFx comparison, the unit price of un-qouted items shown as ???

    Dear All; We are using SRM7.0. In RFx response, if we leave the price as zero, the system will display the below message: Line 0001: '0' in the price field means that you are offering the item for free Line 0002: '0' in the price field means that you

  • In Physical Inventory Check_Which movement type used for stock difference.

    In Case of Physical Inventory we are getting the stock differences after count results, Help me in doing the transaction thru which the stock is adjusted and which Movement types are used for the difference posting, What all documents are created in

  • In my iPhoto library some photoes are black

    Some photoes at random are black, though I can find them being okey in finder ( strangely, there is changed file which is black as well so there are 2 types of one photo). Please help, don't know what to do!