on 10-27-2015 10:18 AM
Hi all,
I have a question on "How to" and best practice...
There are several enum like SAPbobsCOM.BoResolutionUnits.rsu_Days and the Table Result is "D", or "H" - hours..
that means the Object it self SAPbobsCOM.ServiceContracts oCT
need to have a Value like oCT.ResolutionUnit = SAPbobsCOM.BoResolutionUnits.rsu_Days;
But where is the conversion to Days? is there a dictionary available or a table ?
And if I like to use this in a user form... I have to convert this from Combobox valid values to excepted enum...
So the question is, where are the valid values stored? And are there any standard functions available for conversion? Or just C# normal ways...
putting the Valid Values into a list or dictionary and retrieve this with a getenummerator?
Thanks for any input.
Best regards
Oliver
Hi Oliver,
you will find the enum values in SDK Help or in Visual Studio "Go To Definition ( F12 )", BUT this is not giving you the real mapping ( 0 = 'D' , 1 = 'H' ).
You can have a look in "Database Documentation" ( through SDK Help or REFDB.chm ) and get the valid values ( constraints ) for the specific field - imho they are in the order of the enumeration.
This is not ideal....
regards,
Maik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark,
thanks, yes I know where to find the information of enums... and as well where to find the valid values. and the mapping is clear to me...
it's done by
[Guid("49669F5E-5C23-423D-B99A-9F5374355D54")]
public enum BoResolutionUnits
{
rsu_Days = 0,
rsu_Hours = 1,
}
what I like to know is, where to find the mapping in a Table or resource file... Where is the D = Days located and how I'm able to use standard b1 conversion? Is there a place where these Values are located... somewhere in a Table? or Resource File... how is the way B1 ist working with it... like Reflection? Atributes? are they using Dictionaries? List??? In result of it I want to decrease the program lines ... instead of using Switch or if statements... may be there is a way of working with a getenumaration method or function like an attribute ... as well to provide system language without having my own language dictionary ...
if you see in the Help Files..
Member Value Description
rsu_Days 0 Days
rsu_Hours 1 Hours
and have a look at lines at the top... there is no description attribute set... and where is the D or H?
Do you know how to handle this? or where to find? I can't believe that there is no such method or functions or dictionaries or table... what implies that all this is hardcoded by B1... on all languages???
Thanks
Oliver
Hi Mark,
yes I know this ... i can't believe it.... see some tables... like SXRET (SBO_Common) and there is a part describing a table... but I do not find the Table in DB.... this is something that I'm looking for...
but anyway I couldn't believe that it is hardcoded... there are language files... etc... but i don't know where the Metatables are located... and how to get them...
Best Regards.
Oliver
User | Count |
---|---|
100 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.