Entity Field Name Strip Pattern

Posts   
 
    
TopDog74
User
Posts: 40
Joined: 27-Apr-2012
# Posted on: 04-Dec-2015 18:02:48   

Hi,

I have many Entities with audit fields all named like:

***_UpdatedOn ***_UpdatedBy

For example a client entity has

Cli_UpdatedOn Cli_UpdatedBy

and a PersonEntity has

Per_UpdatedOn Per_UpdatedBy

I would like to give all these fields consistent names i.e.

UpdatedOn UpdatedBy

Could you suggest if this is possible using the Entity Field Name Strip Pattern or some other project setting, and if yes, how i would go about doing it.

Thanks, Iain

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 04-Dec-2015 23:27:05   

Hi Ian,

You can use entity field strip pattern (Project -> Settings -> Element Name Construction). In this case, the entity field name strip patter could be:

{cli_, per_}{}
David Elizondo | LLBLGen Support Team
TopDog74
User
Posts: 40
Joined: 27-Apr-2012
# Posted on: 08-Dec-2015 10:10:19   

Hi,

Thanks for getting back so quickly.

I wasn't clear enough in my question. i have hundreds of entities with random 3 character prefixes on all the column names.

Really what i'd like to achieve is for a way for the project to recognize the suffix and keep it, and strip the prefix.

For example

Per_Updatedby -> UpdatedBy Cli_UpdatedBy -> UpdatedBy Xxx_UpdatedBy -> UpdatedBy

etc. etc.

No worries if it's not possible i have a workaround in the code at them moment.

The reason i ask is that i have code in my entity generation template which auto sets these values. It would be nice if could just look for Fields.GetFieldNames().Contains("UpdatedBy") and then if found set the current value.

Cheers, Iain

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 08-Dec-2015 21:39:19   

So you need wild card stripping. Something like: {*_}{}

That's not supported at the moment.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39612
Joined: 17-Aug-2003
# Posted on: 09-Dec-2015 10:35:58   

Good suggestion, we'll look into adding this in a future version.

To get these names renamed quicky, you could use a piece of code in Element Search. it's a bit cumbersome perhaps, but it's less work than renaming them by hand wink . If you need help with that, let me know.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39612
Joined: 17-Aug-2003
# Posted on: 16-Jan-2020 14:43:21   

Implemented in v5.7

Frans Bouma | Lead developer LLBLGen Pro