Jump to content
  • 0

Accessing Plant Databse data in Scripts


lgoodkind

Question

I'm having a lot of trouble getting access to the data of the Plant Database in worksheet scripts.

For instance the following should return the 'Blooms Begin' field data

 

currentObject = vs.WSScript_GetObject()

#Record 1 is the handle to the Plant Record, Record 2 is the handle to the plant object associated with the record
vRecordHandle = vs.GetRecord(currentObject, 1)

vRecordName = vs.GetName(vRecordHandle)

bloomRecord = vs.GetRFieldOpt(vRecordHandle, vRecordName, "Blooms Begin")
vs.AlrtDialog("Blooms Begin: " + str(bloomRecord))

 

This returns nothing

All of the other database functions work however there does not seem to be any way to obtain the content via va.GetRField().  In the below loop all vFieldValue are blank

 

for vFieldID in range(1, vFieldsNum + 1):
    vFieldName = vs.GetFldName(vRecordHandle, vFieldID)
    vFieldType = vs.GetFldType(vRecordHandle, vFieldID)
    vFieldFlag = vs.GetFldFlag(vRecordHandle, vFieldID)
    vFieldValue = vs.GetRField(vRecordHandle, vRecordName, str(vFieldName))

    vMessage = "Record: " + vRecordName + "\nField : " + str(vFieldID) + "\nFieldName: " + vFieldName + "\nFieldType: " + str(vFieldType) + "\nFieldFlag: " + str(vFieldFlag) + "\nFieldValue: " +  vFieldValue + "\n"

    #vs.AlrtDialog(vMessage)

Edited by lgoodkind
Link to comment

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...