How to set an input box in an HTML Web Resource embedded in a CRM 2013 form

I have embedded an HTML web resource that contains some input boxes in a custom CRM form. In the CRM form I have created some fields that corresponds to the input boxes in the web resource and they are hidden.
The reason to do so was the limitation of the CRM not giving me the flexibility of the layout I was looking for. So basically, the user enters the data in the web resource and once saved they write to the hidden fields. On the other hand, when the form loads
the values from the hidden fields are copied into the web resource input boxes.
I am having a hard time setting those input boxes from the corresponding hidden fields on the form. I can read the crm fields easily using JavaScript. I can also get to the HTML web resource using the following:
var target = Xrm.Page.getControl("WebResource_CriticalPath").getObject(); I also appended the contentWindow.document to the end of this and it comes back not null but when I try to get to the HTML element which is the inputbox I am trying to set
the value to, I get a null reference. I am using:
target.getElementById('input20'); to get to the element. I know this is not supported and I have to use Xrm.Page but I cannot figure out how to do so.
Also, any advice on how to do the writing back (i.e. from the element to the form field) when the record is save would be helpful.
I really appreciate any comments/help in this regard.

Hello,
What I would suggest is try to do everything from your html webresource. Add following code to set you field's value during onload:
document.getElementById('input20').value = window.parent.Xrm.Page.getAttribute('hidden field id').getValue();
Add following code to onchange hanlder to put changes back:
window.parent.Xrm.Page.getAttribute('hidden field id').setValue(document.getElementById('input20').value);
Dynamics CRM MVP/ Technical Evangelist at
SlickData LLC
My blog

Similar Messages

  • How do I pass input values from a html page to a jsf page

    hi,
    In my project,for front view we have used html pages.how can I get input values from that html page into my jsf page.for back end purpose we have used EJB3.0
    how can I write jsf managed bean for accessing these entities.we have used session facade design pattern and the IDE is netbeans5.5.
    pls,help me,very urgent
    thanx in advance

    Simplest way is to rewrite html page into jsf page.
    You can use session bean in your managed bean like this:
    import javax.naming.Context;
    import javax.naming.InitialContext;
    public class ManagedBean {
    private Context  ctx;
    private Object res;
    // session bean interface
    private Service service;
              public ManagedBean() {
                try{
                     ctx = new InitialContext();
                     res = ctx.lookup("Service");
                     service = (Service) res;
               catch(Exeption e){
    }Message was edited by:
    m00dy

  • How to set a variable in portal session using web dynpro java.

    Hi,
    I have created a web dynpro application, which is running inside portal. I have created a role called "R1". Inside role R1, i have created 3 workset W1, W2 and W3. and inside each workset i have some pages and iviews.
    My requirement is when user logins to the portal , and when he clicks on role R1 for the first time, a login page should come (so that we can do revalidation), and when he enters his password again in that login page , then only workset W1, W2 and W3 should be visible/accessible to him and after successful revalidation, if he clicks again on role R1, in that particular portal session, than that login page should not come.
    for this, i thought i will set a variable in portal session, whenever user successfully revalidated himself, and if after successful revalidation he clicks again on role R1, i will check in doinit method of webdynpro whether variable is set or not (which i already set on successful revalidation), and if it is set then i will do Donavigation else i will present login page to the user.
    Can anyone tells me how to set a variable in portal session using web dynpro java.
    thanks
    Arush

    Hi,
    Try this:
    WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE, key, value)
    WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE, key)
    Ex:
    WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE,"Key1","Value1");
    String value1=WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE,"Key1").toString();
    /people/william.cui/blog/2007/02/12/sharing-session-context-between-parent-and-external-windows-running-on-same-host
    Regards,
    Charan

  • How to enlarge chat input box height?

    how do I expand (height wise) the column of the text box where i'm typing in messages?
    it is quite annoying having to work with 2 lines of text unless pressing <enter> 

    Absolutely agree. Abandoning favoured functionality for stuff that looks pretty but has poor functionality
    1 Allow user to set height of messge input box. We dont want it to expand, (I expect) We donmt care if it expands, but we badly want to decide for ourselves at the minimum height. Or are you driven by the requirements of the illiterate catering the the illiterate who cant type more than two lines at a time?
    2. What are these stupid shaded boxes that waste space.? By all means provide a background to each message but please use the entire width of the panel. The entire layout of the message panel is wasteful of screen real estate.
    3 Why can we not reduce the width of the panel to a size of OUR chosing not yours?
    But MOST IMPORTANT OF ALL
    Why do we not get to chose whether to install an update or not.

  • HOW TO set the input range for analog in (DAQ)?

    How can I set the input range of a - NI DAQ USB 6259 - analog voltage input?
    I wish to control it directly in my VI. Is it possible to set different ranges for different input channels?
    Thank you,
    Roberto

    duplicate post

  • How to set value of checkbox 'Checked/On' in AD Resource form.

    Hello ,
    We have a checkbox on one field (Change password at next logon) in AD Resource form. We’ve set its value as ‘True’ in Create User process task .
    But the checkbox is not getting set as Checked. We need to set this check box ON when a new a user account is created in AD.
    How can we set its value ? Do we need to make a prepopulate adapter for this or any process task?
    Kindly throw some light on this.
    Thanks

    Thats what we did earlier.
    'Password never expires' value was '0' and 'Password Must Change' value was '1'. Even then also I was not able to get the checkbox On.
    It should have worked that way but I am not able to get the clue.

  • How to link individual question boxes in a Muse website to respective sections of a PDF form

    Hello! I have got two questions in terms of using Acobat Form Central and Muse.
    Q1:I built a website using Adobe Muse. I want  to link individual question boxes in this website website to respective sections of a PDF form built in Adobe Form Central. Can you please let me know how to do this?
    Q2: I imported a PDF form into the Muse website  using HTML.  I want to know how to expand the size of the whole form in the website, or at least to increase the font size.
    Many thanks!

    Hi,
    The Adobe Muse forum would be a better target for your question:
    http://forums.adobe.com/community/muse
    Regards,
    Brian

  • Newbie How to Set a text box equal to a phrase

    I have on a page process
    begin
    if something<0 then
    :P28_DIFFMSG := 'Pkgs needed.';
    else
    :P28_DIFFMSG := 'Left over pkgs.';
    end if;
    end;
    P28_DIFFMSG is a textbox of 30 characters.
    When I run it I always get:
    ORA-01008: not all variables bound.
    I've tried using v('P28_DIFFMSG') := 'Pkgs needed';
    :P28_DIFFMSG := to_char('Pkgs needed');
    no luck.
    Suggestions?
    TIA
    Steve

    I have just tried something simpler, which is to set the value of a text box named P34_X and the source in the process is just the following one line
    :P34_X := 'trouble';
    This proves your assignment syntax is correct and it worked for me as various forms of Page Rendering Processes (Before Regions, Before Header etc).
    Perhaps you need to look at the if statement - exactly what type of thing is the 'something' you are testing in if something<0 ??

  • How to set the input and output of a subVI

    I am trying to configure a subVI by following Chap. 7 of "LabVIEW fundamentals". But I stuck at "Building the connector pane".
    My subvi is quite simple, just for testing purpose. I plan to do a summation and display the result. So I placed one numeric Add icon on the block diagram and a numeric Indicator on the front panel. I built a connector pane with three terminals, two for input and one for output. 
    But, how could I associate the terminals on connector pane with inputs and outputs of terminals on the block diagram? I wanna build a subVI, whose input are two numbers and display the summation on the subVI.
    Forrest Sheng Bao, Ph.D.
    Assistant Professor, Dept. of Electrical & Computer Engineering
    University of Akron, Akron, OH, USA
    https://sites.google.com/site/forrestbao/

    Hi Forrest Bao,
    use the right mouse key as often as you can in LabVIEW. It´s very helpful. If you right click on a link in the connector pane, then you can select to disconnect selected or all.
    Mike
    Message Edited by MikeS81 on 08-28-2008 01:33 PM

  • How to set print dialog box to sync with applications

    Dear all
    I am using different applications, such as photoshop, lightroom, etc. All these applications have their propper print dialog box with enhanced settings.
    BUT
    after hitting the print button, my computer takes me always to the mac print dialog box, where again I can set different things: I can set paper quality, paper format, the colors...
    to me it seems that the settings I have chosen in the application print dialog box are getting erased by this second set of (OS X) print-settings.
    WHY DO I NEED TO GO THROUGH TWO PRINT DIALOG BOXES?
    Can I omit the OS X print dialog?
    Or am I missing something?
    many thanks for your help,
    Hynek

    Thank you for this reply.
    I will work around it with presets.
    but just to understand this: *which dialog box is the one setting the printer* (when for example using photoshop)? is it the first dialog box, i.e. photoshop print dialog box - or is it the osX print dialog box?
    if it is the second, I can skip the photoshop-one... ?
    or do I need to experiment with a combination of both?
    greetings,
    Hynek
    p.s. I know, it is a rather late reply. But we became parents 7 months ago, and time at the moment just flies by...

  • How to SET positions for Boxes

    Hi
    I have to put some Box on my Applet, at different positions (coordinates).
    Is it possible to set the positions, without having as many Transform3d as Box?
    Thanks ...
    Bertrand

    maybe i'm wrong
    but you need a transform3d for every boxes
    if you want them to be in different location
    sorry
    cyril

  • How to set first_visible_row for a table on a web dynpro

    How can I set the attribute first_visible_row in a table which I placed on a Web Dynpro?
    I need the table to scroll automatically to a specific row depending on a date. So I'm calling a method using this date, but how can I change the attribute of the table?
    Thank you!

    Follow these steps,
    1- Create an attribute with char1 in the view context e.g first_vis_row
    2- go to the table properties in view and bind the property first_visible_row to this attribute.
    3- NOw go to the wddoinit method of the view...
    4- read the internal table and find out the index of the row which you want to set as first row. As in ur case you want a specific date in first row. So read the internal table and findout the index.
    5- now write this code, say your attribute name is first row inside node flag1...(you can change it for yoru requirement)
    DATA lo_nd_flag1 TYPE REF TO if_wd_context_node.
      DATA lo_el_flag1 TYPE REF TO if_wd_context_element.
      DATA ls_flag1 TYPE wd_this->element_flag1.
      DATA lv_first_row LIKE ls_flag1-first_row.
    * navigate from <CONTEXT> to <FLAG1> via lead selection
      lo_nd_flag1 = wd_context->get_child_node( name = wd_this->wdctx_flag1 ).
    * get element via lead selection
      lo_el_flag1 = lo_nd_flag1->get_element(  ).
    * get single attribute
      lo_el_flag1->get_attribute(
        EXPORTING
          name =  `FIRST_ROW`
        IMPORTING
          value = lv_first_row ).
    here change the lv_first_row to the index which you got after raeading the internal table.
    suppose it's
    lv_first_row = 4.
      lo_el_flag1->set_attribute(
        EXPORTING
          name =  `FIRST_ROW`
          value = lv_first_row ).
    Hope it works.

  • How to set up User id and Password for Web services or authentication

    Hi ,
    I am new to web services . I have created a new Web service in SAP , and while creating Service defination , set the Authentication as LOW for server proxy .Then created End-point in SOAMANAGER with USREID/PWS requried .This WSDL i am planning to share with Third party to call from Java application.
    But my web service checks for authorization which needs to be set up to allow the user id and pws .
    So question is how do i pass my user id and pws as i do not see this WSDL with User id and pws option displayed for me when i test this using SOAP UI .I saw some of WSDL with tag "AuthHeader" with user id and pws tags in them .So how could i get them ?
    Or requirement is that my Third party should be able to access my Web service in PRD and also be able to have authorization to auth object embedded in FM inside service defination .So how is this acheived ?
    Thanks,
    Sitaraman

    Hi,
    After creation of WSDL , you will get URL lkie http://idessapdev.ad.infosys.com:8000/index.html.
    For this URL your third party system need sto add id and pwd for accessing like http://idessapdev.ad.infosys.com:8000/index.html&userid = 111&pwd= wwgw.
    this is not the exact syntax. you can check with your third party system for this URL.
    Regards,
    Lokeswari.

  • How to set Links to Folders and Users in Web Page Composer???

    Hello,
    With the Link List editor in the WPC you can create Links to documents. This is great because the link lists work with GUI-IDs. This means if the object moves within the KM to another location the link still points to the correct object.
    However, so far I didn´t manage to make links to folders or to users profiles. I tried, but in the Web Content Browser there is no option to select a folder or a user. You can only point to documents so far.
    Is this a configuration issue or still not a feature of WPC in SPS14?
    If it´s a configuration issue, any proposals how to manage it.
    Thanks in advance.
    Thomas
    Edited by: Thomas Krynicki on Feb 19, 2008 7:46 PM
    Edited by: Thomas Krynicki on Feb 20, 2008 12:59 PM

    I was also really irritated by this problem. I ended up inputting the link to foldes as external urls. Fine on the major folders that never change. A pain in the *** for any others.

  • How to set text size when printi from a web page

    can't increase text size when printing a web page

    If you're using IE, click on View, Text Size and then whatever size you'd like.  You'll see the changes on the screen and it should print out the same way.
    Hope that helps.
    Say Thanks by clicking the Kudos thumbs up. Please mark the post that solves your problem as an Accepted Solution so other forum users can utilize the solution.
    I am an HP employee.

Maybe you are looking for

  • G5 Dual Wont Boot, light fades, fans idle, does not beep with no ram?

    I have a G5 dual (non-intel) When I push the power button, the front led comes on (until I let go), there is no chime, and all fans are running idling When powered on, and remove plastic tray insert, red light comes on and the fans accelerate I have

  • SAPSCRIPT issue - F140_CUS_STAT_O2

    I am able to make changes in this module using SE71. Save to a transport and have it transported to our quality region. Transport shows no errors, but when I look in the quality region my changes are not there. The only thing that has changed on the

  • Encore CS5.1 and Video Menus

    Hello all! Hoping somebody knowledgeable can give me a hand here! So, the story is I am creating a video menu for a Blu-Ray project using Photoshop CS5.1 and Premiere Pro CS5.5. I have created the buttons in Photoshop, and I have then 'disabled' the

  • How to resolve older IE rendering issues?

    My site is www.4keys.ca   I checked it out at http://ipinfo.info/netrenderer/index.php Everything on my site works fine in all browsers except for older IE.  Can someone please explain to me how exactly I get this issue resolved, what exact code I ha

  • ERROR FOR GUI APPLICATION !

    This is the code: import ComplexNumbers; import Poly; import Quad; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.ArrayList; public class QuadGUI   private int WIDTH = 600;   private int HEIGHT = 150;   private JFr