Overide enum for BO


Author
Message
Shivji Patel
Shivji Patel
StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)
Group: Forum Members
Posts: 2, Visits: 19
Hi

I have any old Database that has used current reserved codes ie 'private' and 'ref' in c csharp.

Is there any way to overide the enum generated for the fields in the BO

eg see items in red, i can use the custom code to overide the field and replaced private with privatex and ref with refx

and that works fine but can not find a way to overide the enum for the fieldnames.

/// <summary>
/// Contains all of the field names that belong to the business object.
/// </summary>
/// <remarks></remarks>
public enum actionsBOFieldNames
{
code,
creaop,
creadate,
creatime,
modiop,
modidate,
moditime,
delop,
deldate,
deltime,
deleted,
company,
contact,
acttype,
summary,
filename,
sent,
startdate,
starttime,
enddate,
endtime,
length,
extra1,
extra2,
extra3,
extra4,
extra5,
extra6,
extra7,
extra8,
extra9,
extra10,
template,
status,
private,
topic,
plandur,
actudur,
show,
revdate,
ref,
acamount6,
acanal1,
acanal2,
sitecode,
cop_site,
mop_site,
dop_site,
co_site,
cn_site,
att_site,
tmpl_site,
stat_site,
ref_site,
an1_site,
an2_site,
company2,
contact2,
co_site2,
cont_site2,
pathid,
importcode,
importno,
actuser,
staticaction,
viewcode,
invoicenum,
invoicedate,
CUSTOM_FIELD
}

Thanks for any help

Shivji

StrataFrame Team
S
StrataFrame Developer (4.4K reputation)StrataFrame Developer (4.4K reputation)StrataFrame Developer (4.4K reputation)StrataFrame Developer (4.4K reputation)StrataFrame Developer (4.4K reputation)StrataFrame Developer (4.4K reputation)StrataFrame Developer (4.4K reputation)StrataFrame Developer (4.4K reputation)StrataFrame Developer (4.4K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
It wouldn't do it properly without a change to the BOMapper.  But, what you could do is change your custom code so that the name of the properties are @private and @ref rather than privatex and refx... that will allow you to keep the explicit names.  The @ in C# tells the compiler to keep that name no matter what.  After that, you won't have to worry about using the @ again... because you can type "this.private" or "bo.private"  If you ever have to reference the field without a reference qualifier, then you'll just use the @ again.

So, you can do the same within the enum... just add a @ in front of the two values that are causing problems; however, since there is no custom code for the enum, you'll have to remember to re-add the @ each time you re-generate that partial class (which would be hard to forget since it won't compile Wink).

Shivji Patel
Shivji Patel
StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)
Group: Forum Members
Posts: 2, Visits: 19
Thanks for the advice Ben, i will try that and let you know how i get on

Shivji

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search