Create a Calculated field in Powershell that has embedded double quotes

Hi
I have a requirement that I am not quite sure is even possible in the context of Site Column
I am getting an error - maybe though lack of embedded quotes but also I am wondering if this should be possible since Created is an OOTB column even if it is not currently used yet.
$formula = 'TEXT(Created,mmYYYY)'
$calcualtedField = $web.Fields.Add($siteColumn.DisplayName , "Calculated" , $false)
$spField.Formula = $formula
$spFeld.Update()
Does this look correct or not
Freelance consultant

hi Devendra
Thanks for the reply. In my case I want to set of Site Columns to be provisioned so that I can later pick these to be added to my Content Types.  I drive this entirely though .csv files and PowerShell.   Hence, I am working at the Site Collection
level :
$calcualtedField = $web.Fields.Add($siteColumn.DisplayName , "Calculated" , $false)
Your code is does a similar thing to what I want but you are building a list with user defined fields. 
I will log on the SharePoint server a bit later but do you see this code being valid ... "Created" is the display name for the OOTB Site Column and I have tired to embed quotes for the date mask. This Calc column should  be populated when
the site column is added to Content Type which subsequently added to a list or library
$formula = 'TEXT(Created,"mmYYYY")'
Keep going with the YouTube videos as these are really useful
Daniel
Freelance consultant

Similar Messages

  • How to create a calculated field

    Hi. I'd like to know how to create a calculated field for a master- detail form. For example: having two db fields price and quantity, i created a the total item (price * quantity) as pl/sql function like this:
    begin
    :p13_item_total := :p13_price * :p13_quantity;
    end;
    However, the item is not calculated. It is not and instant calculation. I mean if i modify either price or quantity, how to recalculate item total immediately

    You must submit the page to do it with PL/SQL. If you do not want to submit the page, you must do it with JavaScript.
    Thanks,
    Tyler

  • URGENT  update a table with a text that has a single quote in it

    Hello, I am trying to update a table with a text that has a single quote in it. I believe I need to use two singles quotes but I am not sure how.
    For example:
    UPDATE TEST
    SET DESCRLONG='Aux fins d'exportations'
    WHERE etc...
    Should I put 2 singles quotes before the quote in the text?
    UPDATE TEST
    SET DESCRLONG='Aux fins d'''exportations'
    WHERE etc...
    Thank you very much :)

    The best way depends on the version of Oracle.
    But, the quick and universal answer is to use two single quotes
    SQL> connect test/test
    Connected.
    SQL> create table test (descrlong varchar2(128));
    Table created.
    SQL> insert into test values ('This is a string with a '' single quote');
    1 row created.
    SQL> select * from test;
    DESCRLONG
    This is a string with a ' single quote
    SQL> update test set descrlong='Aux fins d''exportations'
      2  where descrlong like 'T%';
    1 row updated.
    SQL> select * from test;
    DESCRLONG
    Aux fins d'exportations
    SQL>                                             

  • How to create a gradient field in CS5 that doesn't striate when printed?

    Can someone explain how to create a large gradient field in CS5 that won't striate when printed? I created a poster, 18" x 24" in which the bottom third gradates from olive to black. When it prints there are thick paralell bands which are  undesirable. The tips I found online go back to 2009 which don't apply to CS5. The directions in the CS5 manual are confusing to me. Is there a simple way to do this?

    Is your monitor well calibrated?
    Did you print it locally on your own printer before sending it out?
    After you've exhausted everything else, you might consider creating a small test file with the offending gradient, and physically carry it to one of the printing locations, and speak to a technician there. Honestly, it sounds like a profile mismatch, but if this has happened at multiple Kinkos locations, then I agree, it would seem the problem is most likely in the file.
    Have you looked at individual channels? (R,G,B)
    One other idea: you say it's olive to black ... you could try an olive gradient from 100% opacity to 0% opacity, placed over a solid black layer, (or alteratively, a similar black gradient over solid olive) and see if that improves the output. Beware, some printers are really bad at 0%-5% values. If the gradient is going from 100% of one color to 0%, this might be contributing to the problem. Try going from 100% to 5% if this is the case.
    One last thing: can you post a portion of the offending area of the image here?

  • Create a TOC for a course that has multiple projects

    I have Captivate 4. Previously I could create a menu for a project that would link to other  project files in the course using the Skin Editor. When I clicked the TOC tab in the skin it listed slides for the one project I was in. How do I add links to the other modules (project files) in the course? Thank you.

    Hi there
    One way to accomplish this is by using the Aggregator to link projects together using a unified TOC.
    Another way to accomplish it is to configure a slide with an On Enter action of opening the desired project. Then point the TOC entry to that specific slide.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • How do I import a PowerPoint presentation that has embedded audio and animation?

    I have a presentation that was created in PowerPoint and each POwerPoint slide has a embedded m4a audio file.  Is there a way to import the audio with the slides or playback the PPT with the audio and do it as a screen capture where the audio is recorded straight across with out having to go out through the speakers and in through the microphone?

    Hi there
    You should be able to play the PPT and record it from Captivate as a Video Demo. When you record, you should also see an option for recording System Audio.
    Cheers... Rick

  • 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

  • Creating Formula calculated field in BI publisher Template

    Hi,
    I am creating a report template (rtf) using oracle BI publisher Desktop for siebel 8.1.1 and i need to add a new field that divide two created count fields , but i don't know how to make it and i didn't have any help from the designer guide.
    Thanks for Your Help.

    Hi,
    Have you tried:
    <?format-number:count(FIELD1)/count(FIELD2);'999G990D000'?>Or are the two count fields stored in XSL variables?
    Regards
    Andy

  • How to create a text field (multi-line) that starts on one pages but finishes on another?

    Hi,
    I would like to create a multiline text field that the field starts on one pages but finishes on another?
    Here is an example of what I want. The text starts in the top of the box (1st box) and would continue in the bottom box (2nd box).
    I have Adobe Acrobat X (version 10.1.1) on Windows 7. I know I could use Live Cycle to create an expandable but I need to import this form to Adobe Form Central after therefore Live Cycle isn't an option.
    Thanks in advance for everyone's help!

    Hi,
    I found a possible solution to my question which is working OK with form central (http://forums.adobe.com/thread/303650)
    Here are the limitation of that option (that I found out so far):
    it cuts in the middle of the word you are writting when switching to the next box
    you can't copy and paste a long text
    if you remove text from the first box i won't move text from the second box back up
    you can't go back with your cursor from the second box to the first (e.g. to edit you text)
    Any other ideas of how I can get that done?
    Thank you!

  • Can you post a PDF that has embedded media in it, onto a website?

    I have embedded audio and video onto a PDF now I want to post that on a web site so that people can view it but not to download. Is this possible?

    If it can be viewed, it can be downloaded.

  • Can't import csv fields starting with double quotes but lack ending ones

    Hi all,
    When I'm trying to used external table to import a csv file, specified as using comma as delimiter optionally enclosed by double quotes, some records are rejected because a field in the record has starting double quotes, but without ending ones.
    Assume the customer really want these starting double quotes, how do I change my external table specification such that these starting double quotes are treated as part of the field data and can be successfully inserted into db?
    Many thanks.

    I have no access to Oracle during weekends, so nothing can be tested. So here it goes:
    Suggestion: DELIMITED BY '","' and of course omitt ENCLOSED BY '"'
    You will have to update each row of the rows just loaded setting the first_field to substr(first_field,2) and the last_field to substr(last_field,-2)
    If all the fields are not enclosed in double quotes (TRUE for strings and FALSE for numbers and dates) the situation (syntax diagrams allow two delimiters only) is somehow more complicated, anyway you can specify DELIMITED BY ',' and update all varchar2 fields in each row of the rows just loaded setting the varchar2_field to substr(varchar2_field,2,length(varchar2_field) - 2).
    Regards
    Etbin
    After posting I noticed it's difficult to distinguish between single and double quotes:
    the first DELIMITED BY should read {single quote){double quote}{comma}{double quote}{single quote)
    the ENCLOSED BY should read {single quote){double quote}{single quote)
    Message was edited by: Etbin
    user596003

  • Best Solution for Creating an Onlne Purchase order form with multiple calculation fields

    I am a bit confused.  Our school has a Forms Central account which works great for our registration forms but I need to find a solution for creating an online purchase form with multiple calculation fields - I know that forms central does not support calculation fields (too bad) but I know that Acrobat Pro does... soooo...
    Can you create the forms in Acrobat and then somehow integrate the advanced features into forms central?  Do they talk to each other?  Is this easy to do? .... I guess another way to putting it is can you create the forms in Acrobat including all of the advanced features for payment calculation and then host it online using Forms Central to manage and collect the data? (I guess that really is my question)
    Thanks (how does this compare to a solution like Formstack?)

    Hi, thanks.
    The naming convention was the consistant up until a point when I read that you need a '.' syntax (?!) - does anyone know if this is true?
    Attached is a version with Bernd Alheit's suggestion and with all the naming of the fields being consistant. It's still not working for me though after doing this and I'm stuck as to why, because I think it should work. I've also tried writing the calcualting line of code in the same manner that Bernd Alheit suggests before I came on here, and it wouldn't work then.
    As with any coding, it must be something to which I have done, but I can't see it anywhere
    Any ideas? Thanks for helping me
    Cheers

  • Creating an EJB that has no primary key

    I want to create an EJB for a table that has no primary key using
    J-developer but I get an error like this :
    "cmp-field of type 'java.lang.Long' does not have a no-arg constructor which is needed for properties/fields based mapping"
    How can I go on?

    Sorry primitives are NOT allowed to be primary Key candidates - OOPS!
    it looks like you may have to use String
    or provide your own Primary Key class which (perhaps) extends Long

  • Create Calculated Field in PHP Form

    Hi,
    I'm trying to create a calculated field that will work out the average of ratings given during the input of a form. This field will then submit the average value with the form at the end (which is why I need the value to calculate before the form submits - i.e., as the form is filled in).
    I have found the following code (designed for HTML forms rather than PHP forms, but I'm hoping it might work). It doesn't seem to do anything - the field doesn't show any information. Help?
    <script language=javascript>
    <!--//
    function dm(amount)
      string = "" + amount;
      dec = string.length - string.indexOf('.');
      if (string.indexOf('.') == -1)
      return string + '.00';
      if (dec == 1)
      return string + '00';
      if (dec == 2)
      return string + '0';
      if (dec > 3)
      return string.substring(0,string.length-dec+3);
      return string;
    function calculate()
      Opp1 = 0;  Inv1 = 0;  Com1 = 0;  wlb1 = 0;  Com2 = 0;  Atm1 = 0;  Per1 = 0;  Inc1 = 0;  Rew1 = 0;  Env1 = 0;  Gro1 = 0;
      if (document.form1.Opportunity.value > "")
         { Opp1 = document.form1.Opportunity.value };
      document.form1.Opportunity.value = eval(Opp1); 
      if (document.form1.Investment.value > "")
         { Inv1 = document.form1.Investment.value };
      document.form1.Investment.value = eval(Inv1); 
      if (document.form1.Community.value > "")
         { Com1 = document.form1.Community.value };
      document.form1.Community.value = eval(Com1); 
      if (document.form1.WLB.value > "")
         { wlb1 = document.form1.WLB.value };
      document.form1.WLB.value = eval(wlb1); 
      if (document.form1.Communication.value > "")
         { Com2 = document.form1.Communication.value };
      document.form1.Communication.value = eval(Com2); 
      if (document.form1.Atmosphere.value > "")
         { Atm1 = document.form1.Atmosphere.value };
      document.form1.Atmosphere.value = eval(Atm1); 
      if (document.form1.Performance.value > "")
         { Per1 = document.form1.Performance.value };
      document.form1.Performance.value = eval(Per1); 
      if (document.form1.Inclusion.value > "")
         { Inc1 = document.form1.Inclusion.value };
      document.form1.Inclusion.value = eval(Inc1); 
      if (document.form1.Rewards.value > "")
         { Rew1 = document.form1.Rewards.value };
      document.form1.Rewards.value = eval(Rew1); 
      if (document.form1.Environment.value > "")
         { Env1 = document.form1.Environment.value };
      document.form1.Environment.value = eval(Env1); 
      if (document.form1.Groups.value > "")
         { Gro1 = document.form1.Groups.value };
      document.form1.Groups.value = eval(Gro1); 
      Totamt =
         eval(Opp1) +
         eval(Inv1) +
         eval(Com1) +
         eval(wlb1) +
         eval(Com2) +
         eval(Atm1) +
         eval(Per1) +
         eval(Inc1) +
         eval(Rew1) +
         eval(Env1) +
         eval(Gro1) ;
      document.form1.GrandTotal.value = dm(eval(Totamt));
    //-->
    </script>
    Any suggestions gratefully received.

    @uscart - Thanks for your thoughts. I think I may try and pursue the javascript option (considering how far I've gone with it) but don't quite understand your response. Does it matter if the input field isn't a text box? The fields are radio buttons (giving options 1-10), liek so:
      <input name="Investment" type="radio" class="star" value="1"/>
      <input name="Investment" type="radio" class="star" value="2"/>
      <input name="Investment" type="radio" class="star" value="3"/>
      <input name="Investment" type="radio" class="star" value="4"/>
    ...etc, etc, etc... for each of the input fields listed above.
    Where do I put the calculate() function? After each "option", or is there a different reference? And does it need to be added to the GrandTotal field as well (the field in which the calcualtion is to be displayed)?
    Thank you!

  • Creating and using a calculated field in business rule from the currency conversion of another field.

    Hello,
    I'm creating a calculated field with a set currency for a business rule. I'm planning to use it as a deficiency criteria. I want the values to come from the currency conversion of another field. Can someone provide me the step by step procedure on how to do it?
    Some documents would be great.
    I've been trying to do it on my own but I've gotten lost.
    Thank you.

    Thank you for all your help above.
    Just to confirm your advice, am I right with the following conclusions? :
    1. The script (function) to fill the text field with the modification date of a different PDF file needs to be stored in a folder level .js file.
    2. The document containing the text field needs to call the .js function either within the document script or within the custom script property of the text field itself.
    Further to that can you just advise on the syntax for accessing the modification date of the other document.
    Do I need to assign a variable to the address of the file to be used, and then use this variable in the text form filling script (as below) or can I use a direct file reference at the .modDate command.
    var LastSync = "C:\sync\bin\lastsync.pdf";
    var strMsg = util.printd("h:MM tt",LastSync.modDate) + " on ";
    strMsg += util.printd("dddd, d mmmm, yyyy",LastSync.modDate);
    this.getField("LastSyncDate").value = strMsg;
    If the syntax is totally different to the above I would be very grateful for some guidance in the right direction.
    I much appreciate your time to help me ... I'm almost there.
    Kind Regards,
    Nifty

Maybe you are looking for

  • Call transaction in Direct input method

    Hi All   how do i use call transaction in direct input  method. thanks all

  • Photobrowser word doesn't work with Photos

    Photobrowser in Word and Outkook keeps looking for Iphoto and Aperaturedirectories. After an update these two are combined in Photos. Does anybody know how i can change the photodirectory of Photobrowser ?

  • Restrict upload size of documents through KM

    Hello One of the customers is implementing SAP EP KM Solutions. would like to know 2 things 1.how can we restrict the size  of the document to be uploaded to portal KM folders. 2.what 's the normal configuration for storing documents through KM.(size

  • How can i use list view active x on forms

    hello to all i have some really urgent problem i want to use the active x of microsoft list view on form 6i but dont know how is any body help me i m really thank ful to him/her mail me at [email protected] thanks for all the co-operation in advance

  • How do I remove or delete a gaussien blur?

    I need to delete or remove a gaussien blur from a drawing. How?