Create a Loolup field with PowerShell but Change the Default Display field

Hi 
I am creating the a load of site columns with PowerShell. In the case of a Lookup Column I want to ensure that a the the industry column is checked programmatically.
$myField.LookupList = $spLookupList.ID
$myField.LookupField = $LookUpmyField.InternalName
As you can see there is no provision for a display name (Industry) which I want to display to the user once they select a lookup column
I just know somebody is going to suggest CAML !!!!  Btw the code works but none of the checkboxes are selected as expected. 
Daniel
Freelance consultant

I tried a same in past. Couldn't find a perfect code. You can try below:
http://blogs.msdn.com/b/varun_malhotra/archive/2008/06/19/how-to-set-the-default-value-for-a-look-up-field-for-an-item-as-it-is-being-created.aspx
<Code>
SPList docs = w.Lists["Documents"];
SPFieldLookup fl = (SPFieldLookup)docs.Fields["City"];
fl.DefaultValue = "1;#Mexico City";
fl.Update();
</Code>
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/afd71aa8-54d3-424f-9b72-67328e080048/update-lookup-field-powershell?forum=sharepointdevelopmentprevious
$w = Get-SPWeb http://web
$l = $w.Lists["MyDocumentLibrary"]
$lf = $l.Fields["lookupColumn"]
$i = $l.Items[0] #List item to update
$lf.ParseAndSetValue($i,"1;#lookupvalue") #1;#lookupvalue refers to the ID of the lookup item and the value of the lookup item.
$i.Update()
If this helped you resolve your issue, please mark it Answered

Similar Messages

  • Will migration assistant change the default display settings on my new Mac?

    I just set up a new iMac and used Migration Assistant to load from my Time Machine. But now the display looks muted and not as bright. Would Migration Assistant change the default display settings on my new Mac?

    Migration Assistant may not be the cause. But you should reset the NVRAM and see it that fixes the issue.
    Shut down your Mac.
    Locate the following keys on the keyboard: Command (⌘), Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on the computer.
    Press and hold the Command-Option-P-R keys before the gray screen appears.
    Hold the keys down until the computer restarts and you hear the startup sound for the third time.
    Release the keys.

  • Can I change the default contacts fields? iOs6, iPhone 5

    I would like to change the fields that appear as defaults for new contacts.
    for example, i would like the "notes" field to be made available upon creation of a new contact,
    and I would like to eliminate fields like "home page" "ringtones" etc.
    is there a way to configure this on a global level? not per contact?
    thank you,
    B

    Not that I am aware of.

  • How to change the default delivery day when i create a shopping cart?

    hi,dear
    i got some trouble when i was creating a shopping cart.
    i want to change the default delivery day when i reference an old template.
    pls see the pictures and take the details.
    it seems that this forum dont support the [img][/img],so pls clike the link to open the picture.
    if you cant see the picture ,pls tell me,thank you
    step1:http://p13.freep.cn/p.aspx?u=v20_p13_p_0909111119338649_0.jpg
    step2:http://p13.freep.cn/p.aspx?u=v20_p13_p_0909111119432170_0.jpg
    step3:http://p13.freep.cn/p.aspx?u=v20_p13_p_0909111119557507_0.jpg
    step4:http://p13.freep.cn/p.aspx?u=v20_p13_p_0909111120079773_0.jpg
    Edited by: ming yu on Sep 11, 2009 5:22 AM

    Hello Ming,
    Have a look at following thread concerning BAdI BBP_CHANGE_DEFAULT:
    [Change the delivery date (Required on) of SC|Change the delivery date (Required on) of SC;
    You will have to check in which SC transaction you are in order to distinguish creation from reference to old template.
    Regards.
    Laurent.

  • How to change the number displaying rows in a table

    Hi all,
    i have a table for resources in Debrief Work order (Standard Screen), we need to change the default displaying rows. inistially it displayed 3 empty rows.
    i tried to change the Records Displayed for the table but it did not affect.
    also it is possible to change the "Add 3 rows" button in the table to add for example 5 rows instead?
    any idea?
    Regards,
    Mahdi Charara

    Hi,
    Through personalization we can do.On standared page top right u will find personalization link.click on the clink next expand all there find apporiate table .Here u will fine reorder button set as u want display and save. then u can see the change.For add row functionality u need to extend the co.

  • When I create a rectangle, I can not to change the shape of a rectangle with the cursor in illustrator CC 2014 For what?

    When I create a rectangle, I can not to change the shape of a rectangle with the cursor in illustrator CC 2014 For what?

    Xavigarcia,
    I am afraid you have come across the Live Rectangle bug which is limited to the MAC versions starting with 10.7 and 10.8, but not 10.9 (Mavericks) or 10.10 (Yosemite). Hopefully, the bug will be fixed soon.
    So a switch to Mavericks or Yosemite with a reinstallation might be the way to solve it here and now.
    To get round it in each case, it is possible to Expand the Live Rectangles to get normal old fashioned rectangles, or to Pathfinder>Unite, or to use the Scale Tool or the Free Transform Tool.
    A more permanent way round that is to create normal old fashioned rectangles, after running the free script created by Pawel, see this thread with download link:
    https://forums.adobe.com/thread/1587587

  • How can I change the default Google search engine in Firefox 8 from google.fr to google.co.uk? Yes, I live in France with a French ISP, but English is my mother tongue and I want UK based responses.

    How can I change the default Google search engine in Firefox 8 from google.fr to google.co.uk? Yes, I live in France with a French ISP, but English is my mother tongue and I want UK based responses.
    I'm using XP Pro.

    You can find search engines on the Mycroft Project website.
    * http://mycroft.mozdev.org/
    * http://mycroft.mozdev.org/google-search-plugins.html

  • I have created a slide show with music but when i view it or attempt to burn to a CD or even copy to hard drive after about 15 sec the program stops working and it shuts down

    Elements 10 was deactivated on desktop and installed on new laptop.  Have on
    y used it for photo editing until yesterday. Created a slide show with music but every time I try to burn to cd or move it to hard drive after about 15 sec, it says windows has encountered a problem with this program and must shut down.
    I Also can't sign in to adobe with the program. It simply spins and I had to force close the program.
    help!?

    I am using photoshop Elements 10 under the create tab...slide show.
    Used it on my desktop several times. Deactivated it and installed on new lap top about 5 months ago.  Had not used it other than for photo editing until today.
    I can also not login in thru the program. It simply spins and I finally had to force close the program
    Toni V. Sloan
    Sent from my iPad
    On Jun 27, 2014, at 7:03 PM, Chris Cox <[email protected]>
    I have created a slide show with music but when i view it or attempt to burn to a CD or even copy to hard drive after about 15 sec the program stops working and it shuts down
    created by Chris Cox in Photoshop General Discussion - View the full discussion
    Photoshop doesn't do slideshows… What software are you using?
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6504356#6504356
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Photoshop General Discussion by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • I am trying to create a class diagram with jdeveloper but class is grey out

    i am trying to create a class diagram with jdeveloper but class is greyed out even though I downloaded the J2EE version
    I went through the following steps :
    Click the project in which you want to create a new diagram, choose File New from JDeveloper's menu, then select General Diagrams in the left pane of the New dialog.
    I have downloaded J2EE Edition Version 10.1.3.1.0.3984

    When the class diagram is disabled - does the wizard for creating a new class in the new->General also disabled?
    If it is then you are not placing your cursor on the project before you choose file->new
    (you are probably on the workspace that contains the project).

  • SBS 2011 GPO for changing the default save path applying to Win7 but not working

    So this is a strange one. I've got an SBS 2011 server that's the only domain controller in the org. I've created a GPO to change the default save location for Excel 2013 and Word 2013 using the Office 2013 ADMX files which were installed to the PolicyDefinitions
    folder.
    The GPO (U-Office2013 Default Save Location) only contains:
    1. User Configuration - Microsoft Excel 2013/Excel Options/Save - Default file location - Enabled - Z:\
    2. User Configuration - Microsoft Word 2013/Word Options/Advanced/File Locations - Default file location - Enabled - Z:\
    The GPO is linked at the OU that contains my users for my SBS organization.
    When I do a gpupdate /force on a windows 7 system with office2013 installed, and then run a gpresult/rsop, the policy appears to be applied successfully as it lists my GPO under the Applied GPOs list on the workstation:
    Applied GPOs
    Default Domain Policy dyndns.local AD (24), Sysvol (24)
    U-Office2013 Default Save Location domain.local/SBSusers AD (6), Sysvol (6)
    In the gpresult report, the applied settings appear under:
    Administrative Templates
    Extra Registry Settings
    software\policies\microsoft\office\15.0\excel\options\defaultpath Z:\ U-Office2013 Default Save Location
    software\policies\microsoft\office\15.0\word\options\doc-path Z:\ U-Office2013 Default Save Location
    BUT, when I go to the workstation, and check office->options-Save-default file path, the path has not been changed to what the GPO is pushing.
    The strange thing is that in my test environment running 2008R2 server and Win7 with Office 2013 and identical settings the default save location is applied and works as expected.
    Any ideas?
    I've already tried re-installing the ADMX templates and re-created the GPO's several times.
    Thanks in advance.

    When a group policy is not applying, it is often that it has been linked to the wrong OU. Please first check this.
    You might also check the apply status on the client site based on the GPSVC.log.
    How to enable GPO logging:
    http://blogs.technet.com/b/csstwplatform/archive/2010/11/09/how-to-enable-gpo-logging-on-windows-7-2008-r2.aspx
    It looks more like an issue on server side than an issue of Office Group Policy settings. Try to post in Server forum and see if there is any luck:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?category=windowsserver

  • Is it possible to change the default URL when creating new hyperlinks?

    I'm currently working to take a 128 page catalog that was created in InDesign for print and turn it into a interactive PDF to post on our companies website. The catalog contains thousands of part numbers and I'd like to link each one to its corresponding stock status page on our website that gives current availability and pricing for any particular customer.
    So say I'm dealing with part number "XXXX". When I go to add the hyperlink the default web address it spits out is " http://XXXX ". Instead of that, would it be possible to change the default to " http://forums.adobe.com/discussion/XXXX/1 ". Obviously I just used this website as an example, but it would save so much time if I could avoid having to type the exact same URL every time.
    Or maybe is there a quicker way to do this other than what I am currently trying?
    Thanks

    I've found some external software applications that will do it, so that leads me to believe its not possible within ID CC.

  • Outbound Plain HTML Adapter how to change the html-header field "host"?

    Hello,
    I'm using XI 3.0 SP11 and want to transmit a message to a business partner using the Plain HTML Adapter.
    My problem is now that I need to change the default Html-Header field "host" because it seems that the adapter engine is converting it to lower case and is attaching the port-number which is causing trouble with the loadbalancer/applicationserver of our business partner.
    I tried to set the appropriate http-header value in the communication channel configuration, but the adapter engine is ignoring this value.
    Thanks in advance for any ideas.
    Sascha Fuchs
    Message was edited by: Sascha Fuchs

    Hi Sascha,
    unfortunately the Plain HTTP adapter is not running in the J2EE, therefore you cannot extend the functionality with an adapter module.
    I am not sure to understand the problem right. Why do you need to change the HTTP header? What is in it in your case and what should be?
    Regards
    Stefan

  • How can i used pai in screen 1000 to change the select-options field?

    hi,all.
    I want used pai to change the select-options field,but it can't works.
    the mainly code is:
    REPORT  ZTEST99.
    TABLES :MARA,MAKT,MARC.
    SELECTION-SCREEN BEGIN OF BLOCK B0 WITH FRAME TITLE TITLE0 .
    select-options:s_matnr for mara-matnr,
                   s_werks for marc-werks MODIF ID ID1.
    SELECTION-SCREEN END OF BLOCK B0.
    parameters:p_flag as checkbox.
    at selection-screen OUTPUT.
       LOOP AT SCREEN.
       IF P_FLAG = 'X' .
       IF screen-group1 = 'ID1'.
             screen-input = '0'.
        ELSE.
          screen-input = '1'.
        ENDIF.
        MODIFY SCREEN.
    ENDIF.
        ENDLOOP.
    START-OF-SELECTION.
    CALL SCREEN 1000.
    when i click p_flag,then i want to change s_werks from OBLIGATORY to no OBLIGATORY.
    how can i realized?
    Thanks for all.
    Sun

    Hi ,
    change your code like this.
    Change in your code:
    SELECTION-SCREEN BEGIN OF SCREEN 100.
    SELECT-OPTIONS : s_matnr for mara-matnr,
    s_werks for marc-werks MODIF ID ID1.
    SELECTION-SCREEN END OF SCREEN 100 .
    At selection-screen.
    if sy-dynnr = '100'.
    IF P_FLAG = 'X' .
    LOOP AT SCREEN.
    IF screen-group1 = 'ID1'.
    screen-required = '0'.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    else.
    LOOP AT SCREEN.
    IF screen-group1 = 'ID1'.
    screen-required = 1.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    my code :
    REPORT  Z50871_SELECTOPS_DYNAMIC.
    PARAMETERS : CH_EBELN AS CHECKBOX,
                 CH_VBELN AS CHECKBOX.
    DATA: V_EBELN TYPE EKKO-EBELN,
          V_VBELN TYPE VBAK-VBELN.
    SELECTION-SCREEN BEGIN OF SCREEN 100.
    SELECT-OPTIONS : EBELN FOR V_EBELN MODIF ID G1,
                     VBELN FOR V_VBELN MODIF ID G2.
    SELECTION-SCREEN END OF SCREEN 100 .
    AT SELECTION-SCREEN OUTPUT.
      IF SY-DYNNR = 100.
        IF CH_EBELN = 'X' AND
           CH_VBELN = ''.
          LOOP AT SCREEN.
            IF SCREEN-GROUP1 EQ 'G1'.
              SCREEN-ACTIVE = '1'.
            ELSE.
              SCREEN-ACTIVE = '0'.
            ENDIF.
            MODIFY SCREEN.
          ENDLOOP.
        ELSEIF CH_VBELN = 'X' AND
           CH_EBELN = '' .
          LOOP AT SCREEN.
            IF SCREEN-GROUP1 EQ 'G2'.
              SCREEN-ACTIVE = '1'.
            ELSE.
              SCREEN-ACTIVE = '0'.
            ENDIF.
            MODIFY SCREEN.
          ENDLOOP.
        ELSEIF CH_EBELN = 'X' AND CH_VBELN = 'X'.
          LOOP AT SCREEN.
            IF SCREEN-GROUP1 EQ 'G1'
               OR SCREEN-GROUP1 EQ 'G2' .
              SCREEN-ACTIVE = '1'.
            ENDIF.
            MODIFY SCREEN.
          ENDLOOP.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN.
    IF SY-DYNNR = 1000.
      IF CH_EBELN = 'X' OR CH_VBELN = 'X'.
        CALL SELECTION-SCREEN 100.
      ELSE.
        MESSAGE I000(Z50871MSG) WITH 'Please select atleast one checkbox'.
      ENDIF.
    ENDIF.
    regards
    Sandeep Reddy

  • I am creating an aperture book from my photos. How do I change the default map provided in the theme to one of my choice e.g. satellite view?

    I am creating an aperture book from my photos. How do I change the default map provided in the theme to one of my choice e.g. satellite view?

    Kyle,
    Thanks for your response. To be clear, the way I am importing the PDF is by going to New in LiveCycle, and selecting Import a PDF document, and selecting Create and Interactive Form with Fixed Pages.
    I cannot change the forms or pages, as they are created by our local Board. In otherwords, I have tryed used the flowable content, and upon import, not only are the fonts slightly different, but all the important artwork (trade-related) is gone, and is not in the exact positions it was in. The forms must meet the standards to which they were approved by the regional board, and there are state-mandated forms as well.
    What surprises me is that you say this method of Fixed Content isn't used much any more. I would think that a lot of people would have PDF files they would wish to make into fillable, interactive forms without needing to reconstruct the entire document. Perhaps a company that has always done things on paper, and now wishes to use those exact same forms on the computer, with no deviations to looks so they can be printed and match up perfectly.
    I thought about using Acrobat's internal form creation system. However, some of these forms have sophisticated options and the calculation scripts and systems within LiveCycle are very useful. Not to mention that it has a much larger scalability, should we chose to utilize it.
    Any other suggestions? I am so confused why Adobe would force medium-quality import of a PDF, but be so incredibly flexible about every other option in their program.

  • Change the Accounting document fields cost center and profit center

    Dear Experts,
    User has posted document with wrong profit center
    For that we subjected that he can go to the profit center actual posting T.Code 9ke0 but with that he can only change the Profit center document with that there is no accounting side updating
    I have tried with Document Change Rules, Line Item for fields cost center and profit center  in that while configuring I did not get any error message,
    But in the document I am unable to changing the same fields cost center and profit center  
    Can any body please guide me to resolve the issue?
    Essentially I want to change the Accounting document fields cost center and profit center   
    Thanks in Advance,
    Wiswanath

    Hello,
    Once the documents are posted in FI module, the system doesn't allow anybody to change the cost objects (cost center, profit center, internal order). The only fields you can change through FB02 transaction are the Line item text (BSEG-SGTXT) and the assignment (BSEG-ZUONR).
    If you want to get a change to the cost object to be reflected from FI to CO, you should reverse the FI documents with wrong cost objects and post new documents with correct cost center, profit center.
    Hope it helps you.
    Cheers,
    Daniel.

Maybe you are looking for

  • Desktop icons disappear intermittently with Lion 10.7.3

    Some of my desktop icons "disappear" intermittently ( not always the same icon(s)).  The title still appears but the icon is blank. I can still click on the blank spot and the app will launch. Annoying but not "fatal" - Anyone have any ideas ??  Oh a

  • IPhone 3G and Exchange odd problem, and it's not the 3.1 encryption bug

    Ok, so first off I solved the issue I was seeing, but I have to post it anyway because I spent much too long figuring it out and would like to find a definitive answer if possible. This may be a problem with the iPhone, or it might be an Exchange iss

  • How to update oracle jdbc driver to 11.1.0.7.0 JDBC Drivers

    HI, I got a jdbc exception *" java.lang.ArrayIndexOutOfBoundsException "*. I have known that it is a Oracle JDBC bug and Oracle BUG number is BUG-6396242. The problem is too many rows per database transaction and it is fixed at version 11.1.0.7 Oracl

  • Question about PHP

    I am completely new to programming and have enjoyed Linux so much, that I would like to go into PHP next. Currently I am a University student with a dead end major (Russian Studies). I am looking to get a certificate in PHP over the course of this ne

  • I only see trial versions of the software that I want to donwload from my adobe cloud

    I hope that anybody can help me, I have log on on my adobe cloud account and when I go to download the applications that I need (Photoshop, illustrator) I only see trial versions not the full product, can anybody tell me how can I download the full p