Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

  • Newbies
Posted

Hi Folks

I'm creating an export function for users, where they can choose (over an website) a layout and then appears a list with all fields inside this layout. The user now chooses which fields he would have in the export. The problem is the listing of the fields seems to be random. Is it possible to influence this order?

An example:

I have a layout with data of clients like name, phone, adress, email etc. So I get these fields with the getFields() function. But I like to have them in a certain order, so when i get the single fields out of the array in the order of:

Name, Adress, Phone, Mail etc.

Thank you very much for your help!

Posted

I think you will find that they are in creation order. Not sure if you can influence this during the getFields() at all...

  • Newbies
Posted

Thanks for your help.

As soon as possible I will check this out. The problem is I work with an existing Database with hundreds of fields and I don't know when which fields were created.

  • Newbies
Posted

I have tried it and it's like webko assumed: The order of the fiels depends on the creation order.

Has anybody an idea how I can influence this order?

Thanks

Posted

Well, if they come back in some sort of array structure, then you should be able to sort the array for presentation: http://php.net/manual/en/array.sorting.php

Posted

In Manage Database...under the Fields tab, you have the choice of how to view the fields. The default is Creation Order, but you can choose "Custom Order". You can reorder the fields anyway you'd like and that re-ordering will also show on most of the field list dialogs (including Export...)

  • Newbies
Posted

I do the export over php. First of all, the possible fields have to be listed, so the user can choose the needed ones. But the order of these fields is in creation order, even if I change the custom order. (I get the field names with the function getFields() )

I think there is no other way to sort the fields with arrays as webko wrote.

Thanks for the replies!

Posted

I suspect the line

"I think there is no other way to sort the fields with arrays..."

should read

"I think there is no way other than to sort the fields with arrays..."

This topic is 4538 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.