Jump to content

BaseElements Plugin - How to Copy Table Fields and Etc


GisMo

This topic is 3389 days old. Please don't post here. Open a new topic instead.

Recommended Posts

It seems like BaseElements is the tool I need to use, but I'm having some trouble getting it to work correctly. There isn't much for documentation other than a function list and if there's more examples, please share them.

 

I'm using Windows here.

 

From what I understand, with BaseElements I can have a starting solution and can automatically put fields from that starting solution into the clipboard and then manually paste them into a new solution.

 

I'm just trying to make a simple example and I'm using these functions:

 

  • BE_ClipboardFormats()
  • BE_ClipboardText ( format )
  • BE_SetClipboardText (text;format)

 

It seems like the process is to work backwards...

 

  1. I copy a single field from the Manage Database window
  2. I monitor BE_ClipboardFormats in the Watch tab and I get "Mac-XMFD" 
  3. Add another watch BE_ClipboardText("Mac-XMFD") and I get the result:
    • <fmxmlsnippet type="FMObjectList"><Field id="10" dataType="Text" fieldType="Calculated" name="T1"><Calculation table="FMTest"><![CDATA["PASTED"]]></Calculation><Comment></Comment><AutoEnter alwaysEvaluate="False"></AutoEnter><Storage storeCalculationResults="True" autoIndex="True" index="None" indexLanguage="English" global="False" maxRepetition="1"></Storage></Field></fmxmlsnippet>
  4. Convert the quotes- (") to ("):
    •  <fmxmlsnippet type="FMObjectList"><Field id="10" dataType="Text" fieldType="Calculated" name="T1"><Calculation table="FMTest"><![CDATA["PASTED"]]></Calculation><Comment></Comment><AutoEnter alwaysEvaluate="False"></AutoEnter><Storage storeCalculationResults="True" autoIndex="True" index="None" indexLanguage="English" global="False" maxRepetition="1"></Storage></Field></fmxmlsnippet>
  5. Now I create a new script to set the above text to a variable $xmlField
  6. Last, Add another step and use: BE_SetClipboardText ($xmlField;"Mac-XMFD")
  7. Move to other Solution and paste field.
  8. done?!

I suppose you could have a "XML field composing script" to create any XML for any type of field and you supply some variables? 

 

Is this the correct approach? Any other ideas? 

Link to comment
Share on other sites

 

From what I understand, with BaseElements I can have a starting solution and can automatically put fields from that starting solution into the clipboard and then manually paste them into a new solution.

 

 

You don't need a plugin for that.  Just copy the fields from the one file and paste them into the other file.

Link to comment
Share on other sites

You don't need a plugin for that.  Just copy the fields from the one file and paste them into the other file.

 

My needs are a little more complex than that...Also, I want to ensure I'm copying all the fields that I need in one shot. Also, this would save the hassle of opening up manage database and sifting through the fields each time.

Link to comment
Share on other sites

Not sure I follow where you think your complexity is.  Especially not about:

- being able to select multiple fields  --> you can select multiple fields at once to paste

- sifting through --> not clear what this means, especially since

None of this is normally part of an automated routine.  If it is, I would venture to say that there is some underlying architecture deficiency.

 

If you need to create fields you can use the BE plugin and use the SQL functionality to use the standard SQL capabilities to add fields.  But there again I would question the need for that in any kind of automated fashion.

 

So can you expand a bit more about the why?

Link to comment
Share on other sites

This topic is 3389 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.