LightSwitch Fill Form with a Query

Hi,
I added a button in an add and edit screen to edit information related to the paticular id I am editing but need to launch another edit screen so I can edit the information stored in another non relational table with the id in the previous screen. Since
I do not have an entity information of that table I needed to pass the id and the edit form be fill in with a query so I can edit that table after.
Anyone has an idea would appreciate it.
Thanks,

Yeah, the way I usually go about doing that sort of thing is by overloading the main constructor of the Form which does the editing..
So for example:
public Form1(){
Initialise();
You'd also make another like this:
public Form1(int id){
Initialise();
LoadRecord(id);
To open up the form you'd write this in the event handler of the original form:
Form frm = new Form(123);
frm.Show();/frm.Visible=true; (whatever it is)
Hope this helps,
Antony
:D

Similar Messages

  • DI UI : fill matrix with a query from user table data

    hello,
    I create a user table.
    I want to fill a matrix on a form with some aggregated data of this user table.
    I do :
    Public Sub SetMatrixRep()
      Dim oRecordSet As SAPbobsCOM.Recordset
      Dim oCentre As SAPbouiCOM.EditText
      Dim oCompte As SAPbouiCOM.EditText
      Dim oBudget As SAPbouiCOM.EditText
      Dim oDepense As SAPbouiCOM.EditText
      Dim oSolde As SAPbouiCOM.EditText
      Dim i As Long
      i = 0
      Set oRecordSet = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
      oRecordSet.DoQuery ("select * from [@CAP_OPRC_BUDGET]")
      While oRecordSet.EOF = False
        ' filling the matrix
        Set oCentre = oMatrixRep.Columns("clCentre").Cells.Item(i).Specific
        oCentre.String = oRecordSet.Fields.Item(0).Value
        'oMatrixRep.Columns("clCentre").Cells(1).Specific.String = oRecordSet.Fields.Item(0).Value
        'SBO_Application.MessageBox (oRecordSet.Fields.Item(0).Value)
        oMatrixRep.AddRow
        oRecordSet.MoveNext
        i = i + 1
      Wend
    End Sub
    I've got an error : Row - Index invalid.
    Could you help me please ?
    Thanks.
    Romeo.

    Hi
    This is a routine that I call from my Item Event handler
    Hope it can help you
    Public Sub PopolaMatrice(oApplicazione As SAPbouiCOM.Application, pVal As SAPbouiCOM.IItemEvent)
        Dim oForm               As SAPbouiCOM.Form
        Dim oMatrix             As SAPbouiCOM.Matrix
        Dim oDBDataSource       As SAPbouiCOM.DBDataSource
        Dim oConditions         As New SAPbouiCOM.Conditions
        Dim oCondition          As SAPbouiCOM.Condition
        Dim oDocNum             As SAPbouiCOM.EditText
        Dim lIndice             As Long
        Set oForm = oApplicazione.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
        Set oDBDataSource = oForm.DataSources.DBDataSources.Item("MyUserTableName")
        Set oMatrix = oForm.Items("MyMatrixName").Specific
        oMatrix.Clear
        'setting the condition object
        'this is equal to the following SQL statement
        'WHERE UserFieldName1 = "MyCriteria1" and UserFieldName2 = "MyCriteria2"
        Set oCondition = oConditions.Add()
        oCondition.BracketOpenNum = 2
        oCondition.Alias = "UserFieldName1"
        oCondition.Operation = co_EQUAL
        oCondition.CondVal = "MyCriteria1"
        oCondition.BracketCloseNum = 1
        oCondition.Relationship = cr_AND
        Set oCondition = oConditions.Add()
        oCondition.BracketOpenNum = 1
        oCondition.Alias = "UserFieldName2"
        oCondition.Operation = co_EQUAL
        oCondition.CondVal ="MyCriteria2"
        oCondition.BracketCloseNum = 2
        oDBDataSource.Query oConditions
        'filling the matrix
        For lIndice = 0 To oDBDataSource.Size - 1
            oDBDataSource.Offset = lIndice
            oMatrix.AddRow
        Next lIndice
    End Sub

  • Can you append a link to a form with a query string to popular a form field?

    I'm trying to do this with Form Central but having no luck getting an answer. Is Acrobat Pro the answer?
    Thanks for your help
    Wayne

    Hi Irosenth
    That looks a great solution. However, I'm a newbie here and can't see that Adobe Pro gives an option to save a form as a .fdf or .xfdf.
    BTW the headline should say POPULATE not popular (whatever that is).
    What I would like to do is send an email to every recipient with a link to a form appended with a query string that automatically completes the ID field. At this point I only have Adobe Pro and FormCentral. Should I be looking elsewhere. (I did try to phone Adobe UK yesterday but was on hold for 1hr 4mins before I had to continue with the rest of my life).
    Thanks for your help & time.
    Wayne

  • URGENT - Form with LOV - Query Fails

    Hi All,
    I've a portal form, with about 10 fields and about 06 of them are combo boxes (attached to dynamic LOVs).
    I'm trying to perform a query using the ID and leaving all other fields blank, but no result is displayed. I am sure that the record for that ID exist in the database table.
    Can someone please suggest what should I do to be able to perform query in form with LOVs.
    Thanks in advance.

    Hi Jatinder
    I'm happy because you are apparently on the right way with 'your duplicate form'!
    "adjust the empty values" means to make sure, that the value of the simple empty field (in the duplicate form) is the same as the value of the corresponding LOV based combo box field (in the original form).
    Maybe this sounds easy, but in the matter of fact it isn't. Why?
    Look carefully at the following sample:
    You have a dynamic LOV based on the number column 'category' in your 'table_1'.
    So the basic part of the LOVs query looks like this:
    select distinct category from table_1;
    Now you still have to add the 'empty value' to your LOV to complete your request to find any value of 'category'. But if you add '0' or ' ' (blank) it wouldn't work. So you have to add NULL but this still doesn't work because you have to adjust NULL to the corresponding data type.
    Furthermore you have to be sure that the default LOV's value is the 'any value' one.
    Your complete LOVs query then looks like this:
    select distinct category from table_1
    union
    select to_number(null) from dual
    order by category desc;
    /* 'desc' for 'descending' ensures the NULL value to be on the top of the combo box */
    Now as you know how it works for number columns simply use the analog logic for character columns with to_char(null) and for date columns with to_date(null).
    That's it.
    Thanks
    Peter

  • Fill form with Java... problem with HTTP Unit and notunique formnames

    Hello
    If I try to check/uncheck a checkbox in a form with httpunit, i get the illegalargument exception:
    Exception: com.meterware.httpunit.FormParameter$IllegalCheckboxParameterException: Attempted to invoke method 'setCheckbox' for parameter 'RESPONSE/ChoiceA', which is not a unique checkbox control.
    But HEY! if we have a look at the source code of the form we see very clearly that the name is not unique, but the value is very well unique.
    <input type="radio" checked="true" name="RESPONSE" value="ChoiceA"/>You must stay with your luggage
    <input type="radio" name="RESPONSE" value="ChoiceB"/>Do not let someone else look after your luggage
    <input type="radio" name="RESPONSE" value="ChoiceC"/>Remember your luggage when you leave
    Has somebody an idea what I could do? How I could fill out this form anyways because I really have to find a way...
    Is there a different solution than httpunit?
    thanks
    code
    import com.meterware.httpunit.*;
    public class Example {
         public void doIt()
    try {
    // create the conversation object which will maintain state for us
    WebConversation wc = new WebConversation();
    // Obtain the main page on the meterware web site
    WebRequest request = new GetMethodWebRequest( "http://www.pharmasquare.org/tetrodo3/secured/action/qtitest.do?method=getAssessmentTest&assessmentTestId=qtiexamples&collectionPath=qti2.1&testCollectionPath=&assessmentItemId=luggageChoice" );
    WebResponse response = wc.getResponse( request );
    WebForm form = response.getForms()[0];
         form.toggleCheckbox("RESPONSE","ChoiceA");
    String[] stringis = form.getParameterValues("RESPONSE");
    request = form.getRequest();
    response = wc.getResponse(request);
    } catch (Exception e) {
    System.err.println( "Exception: " + e );
    public static void main( String[] params ) {
         Example ex = new Example();
         ex.doIt();
    public void print (String s)
         System.out.println(s);
    }

    You're trying to go out of the Java sandbox and access the client. For this, it's neccessary to sign your jar-file.
    Also, this is a Forms related question. If I were you, I would definitely have asked this in the Forms forum - not in this Application Server forum.
    The Forms Forum - Forms
    Regards,
    Martin

  • Printer wont print: "HP Smart Web Printing is not compatible with FF 37.0.1" Also, I can't fill forms with Robo Form

    No details needed

    I understand that the message gives that Firefox does not support the printer giving issues as well as Robo Form is not filling in forms for Firefox.
    Please consider the troubleshooting steps suggested:
    *[[Fix printing problems in Firefox]]
    As for the addon/extension I can recommend trying Safe Mode to see if there is an issue with one of the add ons, or disable each of the extensions to troubleshoot what might be interacting with this feature.

  • Do javascript: Fill form with no name?

    Have a form that needs to be filled out I have no control over how the form is designed.
    <form method="post" action="">
    <input type="text" name="TITLE" value="" size="40" maxlength="100" class="text"/><input type="text" name="URL" value="" size="40" maxlength="255" class="text"/>
    </form>
    I usually use this.
    do JavaScript "document.forms['formname']['fieldname'].value = '" & VarName & "'" in document 1
    But with out the form having a name it won't work, and I am lost, I don't normally work with javascript.

    Depends on what else is one the page, but this works for static page items:
    <pre style="width:630px;height:auto;overflow-x:auto;overflow-y:hidden;"
    title="Copy this code and paste it into your Script Editor application.">tell application "Safari"
    activate
    do JavaScript "document.getElementsByTagName('input')[0].value='Title Of Page';
    document.getElementsByTagName('input')[1].value='http://www.url.com'" in document 1
    end tell</pre>
    Hope this helps...

  • Cannot save filled forms with Acrobat Reader

    I have installed on my Windows XP, Acrobat Reader 9.5. I get a pdf file from Internet that has in it some forms that I must fill in and send back to pdf creator. The problem is that when I open this file, I have posted a message on the upper left side: "Please fill out the following form. You cannot save data typed into this form. Please print your completed form if you would like a copy for your records." But of course, I must be able to save this file with filled data in form. Is that possible? Can you explain me what happens? I'm a newbie to this topic (in fact I'm a linux user. I'm trying to solve some of my sister issues).
    Thanks in advance!

    Prior to Reader 11, Reader was unable to save a filled-in form unless the document was Reader-enabled. This is something that the creator of the form does with either Acrobat or LiveCycle Reader Extensions. If your document is not Reader-enabled, you will see the message that you're getting. Unfortunately, Reader 11 is not available for Linux.

  • I am trying to create a fill form with acrobat and I keep getting error

    I need to chat with customer service

    Hi osheady,
    If there's something that I can help you with here, I'd be happy to. What are you using the create the form, and what error are you receiving?
    I look forward to hearing back from you.
    Best,
    Sara

  • Fill form with JS data; dropdown

    Looking for a way to have a drop down of people or companies. When you select a company the city, state, etc the indo will auto fill text boxes. what is my best options to go about this?
    I have been trying to use this http://acrobatusers.com/tutorials/js_list_combo_livecycle1 and change the code to get it to work for what Im tryign to do but no success.
    Any help would be awesome. Thanks.

    Here's a link to a sample form that behaves that way: https://workspaces.acrobat.com/?d=gZNDS8dQQNqvwocUufXHNQ
    The script that controls it is in the Keystroke event of the combo box. Pay attention to how the combo box is set up, particularly the export values of each item. If you have any questions, post again.

  • Filling PDF forms with in-house software - pdf no longer works in Reader

    I have created a PDF form in Acrobat 8.1.0 Pro and enabled the "Filling of form fields" feature.
    1)
    I can open this form in Adobe Reader, fill fields, save, load / repeat process as many times as I want with no problems.
    What we would like to be able to do is "pre-fill" some of the form fields using an in-house application with some data and save. At a later time, users would need to add additional information.
    If I open one of these pre-filled forms with Adobe Reader, it immediately gives an error message and closes the file:
    "This document contained certain rights to enable special features in Adobe Reader. The document has been changed since it was created and these rights are no longer valid. Please contact the author for the original version of this document."
    Other programs such as "Foxit" and "AmiUni PDFSuite" don't seem to care that the file was pre-filled.
    Is this because Adobe Reader actually checks some sort of CRC or signature which was created at the time the initial PDF form was created by Adobe Pro - and if the signature is no longer valid Adobe Reader won't go any further?
    2)
    What would be the options to get around this problem? Is there a way to accomplish this with Adobe Pro? We need to be able to pre-fill some fields in the form from our application, then have the user complete filling the form manually.
    Thanks!

    Enabling usage rights in reader grants specific rights for a given document - form fill in, saving, signing, etc. Reader checks if something else has been done to the document beyond the scope of the rights granted and apparently the program you are using to add the form data is triggering this test for some reason. There is a digital signature which isused to check this, plus an analysis of what has changed in incremental save sections.
    What you are trying to do should work in principal. If the developer of the application is available, have them look at what else is being changed besides the addition of form data. They should be able to fix the problem.
    If the pre-fill data is the same for each user, you can definitely run the pre-fill and then enable usage in reader.

  • Tabular form with non base table field

    I want to develop a tabular form with
    1. A non-base table edit field to accept a value
    2. Insert/update another table based on the input value
    3. Also, computed field on each row based on other fields on the records (like post-query trigger in oracle forms at block level - for each row)
    Thanks,
    Rachna

    Thanks for your reply.
    Varad, I like the link you sent me. It has a lot of good information.
    I created a process (under page processing) called "Update/Insert Process" that dosn't seem to be working.
    Question, I created a manual tabular form with SQL Query and created a process (under page processing) called "Update/Insert Process", then I check for each record in the tabular form. If the old value <> new value then I update/insert in the new table.
    Any step by step will be highly apprciated - to create process/validation etc.
    Thanks,
    Rachna

  • Submitting form with attachments.

    Hi,
    I have a simple need. I am stucked in it. What i need to do is:
    Step 1: User1 starts opens a pdf form inside LC Workspace, fill it, attach files (Reader Extended) and then submit it.
    Step 2: User2 receives the filled form with attcachments. Can view attachments and save them in repository.
    I am stucked at step 1. User is able to fill the form, add attachments but can't submit it. If I am not enabling the Reader Extensions for attachments (Disabling functionality to attach files) then it works fine. But when using with attachments option, it fails. It gives no error, no message and does not passed to the 2nd user.
    Is there any special requirement in developing such process/form ??
    Please help me out on it.
    Abhinav

    I've studied the HTML generated by UIX and it has following bugs and misfeatures:
    1. Misfeature: Submitting with Enter works ONLY if there is exactly one text field in the form (no submit button is actually needed), as Brian Stoler wrote. I don't understand reason for this.
    2. Bug: UIX generates javascript function "_submitOnEnter" which is called as event handler for "onKeyPress" event. But this function is erroneously generated multiple times, once for each form in the page. Browsers (Mozilla and IE) use the latest implementation. This function is different for forms with one text field and for forms with more text field, but only the first one can do the job. As a consequence of this, Enter can submit the form only if the last form on a page has single text field (which is for example not the case of search form with single field above another form...)
    Tested with UIX 2.1.7 in JDeveloper 9.0.3.3, using UIX as JSP tag library.
    Workaround:
    1. Use Opera browser: it submits form with enter key even if there is no submit button (this does not work for the first text field in the form, because it has "onkeypress" event handler).
    2. Implement this feature by hand yourself, if you really need it (see below).
    3. Use accessKey: allows to submit form with Alt+<key> combination (followed by Enter with IE).
    Implementing Enter key submits with Javascript:
    1. Put the following function to the header (or to javascript library):
    function enter(e, frm) {
    var kc;
    if(window.event) kc=window.event.keyCode;
    else if(e) kc=e.which;
    else return true;
    if(kc==13) {
    submitForm(frm,1);
    return false;
    Function copied from UIX (C).
    2. Add this event handler to each input element:
    onKeyPress="return enter(event, 'formName');"
    It is obvious that this is error prone, but it works with all browsers...
    Will this be fixed in future versions?
    Why only form with one text field can be submitted?

  • Connect Pdf Form with Air Sqllite data

    Hi, i would like to save my Pdf Form localy but i know about restrictions of 500 users (legal notes after giving advanced user permission).
    I thought about do it in air which could have my pdf form inside. I thought that people after filling form with data could save it localy by connecting PDF Form (embed in air) with Air database. So people could save it offline and fill rest form date f.e. after few days to complete it later.
    I don`t know any more option to save my form data localy (offline) without installing localhost database. Air installing is simple but i don`t know how should i start.
    Please tell me how can i connect my PDF Form with Air database?
    EDIT:Do you have any tutorials of that?

    I read also about JavaScript method of sending data from PDF form to AIR with using PostMessage (communicate throw JavaScript & HTML Object embed). Now i don`t know is there more easy way to communicate with SQL lite Air local database than using PostMessage command (more direct as setting up File>New Connection>OLEDB Database in Livecycle Designer)?

  • Filling a multi-column list box with a query

    Hi folks!
    I'm really very unexperienced with Oracle Forms so I wasn't able to implement the following problem. I have got a database table called 'employees' with the columns 'id', 'firstname', 'lastname'. In my form I would like to have a listbox containing all the entries of this table (based on a select ... from employee) but with only 2 visible columns (firstname and lastname).
    My first question is, how to fill the list with the values from the query. The second question is, when the user selects an entry of the list (an employee), how can I get the ID of this employee?
    I hope you can help me!
    Thanx in advice
    Ingo

    A list item can have only two columns - one shown to the user and one invisible one which actually populates the item. In order to display your names you need to concatenate them into one.
    Create a record group with the query:
    select firstname||' '||lastname, id from employees
    then in a suitable trigger (eg when-new-form-instance)
    call POPULATE_LIST(list, recordgroup)

Maybe you are looking for

  • Alternate ingredients being added at a ratio that does not sum to 100%

    Hi Sometimes we have alternate ingredients that are added at 10% of the original ingredient's mass. There is no back-fill, we simply add less. If we add these to the alternate ingredients list with a factor of 0.1, and we do not make up for the other

  • Too big and "shaking" view in iMac -- help!

    Hi, I'm inexperienced with macs and the owner of this computer is out of reach --- I accidentally changed some setting in an iMac and now the view is too "big" for the screen and the image shakes everytime I touch the mouse. The resolution should be

  • Ship-To not assigned to Sold-To, even though able to create an order

    Hi, We have a peculiar scenario. We have a Sold-To Ex: 1100, ship to 1200 and 1300 for a sales area, ex 1000-10-10. Here only 1200 Ship-to is assigned to Sold to 1100. ( SH 1300 is not assigned to SP 1100). I am able to create an order for 1100 and 1

  • Cannot play video from exterior drive

    I can't open and play video files from my exterior drive(Toshiba Canvio 500GB 2.0 USB). Files are in the wmv format. Tried two different media players without success. Same files downloaded to my drive C: play perfectly. Is my exterior drive too slow

  • Having Problems Importing Video From Camcorder ( Log and Transfer?)

    Hi everyone Today i received my Canon HF11 It records AVCHD format. I'm pressing log and transfer, and it comes up, however when i press 'add to queue' it will be added, then an icon comes and spins for a few seconds, then it'll stop and turn into a