plomino form onsave get current field value

  • J.D.

    J.D. - 2011-06-23

    First off im a programmer with LAMP  background and ive been working with plomino for about 7 months, so im sure im not using plomino correctly.

    Ive been working on trying to get a simple field lookup, but ive been having alot of issues.
    I have been able to get everything to work except getting a fields value (from another db) on the current form.

    So in my form that contains a bunch of fields i have one field that contains a selection list from another DB that has 2 records (lets say ItemName, and ItemDescription).
    When the user saves the form, i need to get the value from the dropdown list (lets say ItemName) and replace it in the script below.

    #Here is what i have so far..
    #In the forms onSave event i....
    #First get the db.
    #then i get the view
    #once i have the view i can get the views values
    #this is what i need to replace, it should get the value from the selection list in the current form ..
    lookup = 'one of the values"
    ItemDescriptionsValue = 0
    #loop for all rows in ListOfParts
    for row in allViewValues:
      #finding the lookup record (ItemName) from listOfParts
      if lookup == row.ItemName:
        #get ItemDescription from listOfParts
        ItemDescriptionsValue = row.ItemDescription
    #set the current form field to the value form ItemDescription (of the other db)

    I have made formField2 hidden in edit mode… im just trying to make the user not have to enter the description when we have it in another form.
    Thank you for your time.

  • Eric Brehault

    Eric Brehault - 2011-07-01


    First thing:
    it returns not actual PlominoDocuments but search resulst (ZCatalog brains), so they do not behave as PlominoDocument
    if ItemName and ItemDescription are indexed, row.ItemDescription and row.ItemName will work (becaus ethose values will be part of the index)
    but if they are not, you will get an AttributeError
    if so, do the following:
    doc = row.getObject()

    Second thing:
    there is easier wat to do it:
    sort your 'all' view by 'ItemName' (make it a column first)
    matching_docs =

    it avoids to make a loop to test every documents



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks