문제

I want to get the field types. My code is as follows:

tID = dict.tableName2Id(tableName);
counter = 0;
dt = new DictTable(tID);
if (dt)
{
    counter = dt.fieldNext(counter);
    while (counter)
    {
        df = dt.fieldObject(counter);
        if (df)
        {
            fields = conIns(fields,1,df.baseType());

        }
        counter = dt.fieldNext(counter);
    }
}

On return to .NET Business connector, the types are shown as numbers instead of strings. Kindly help.

EDIT : DataField.baseType() returns "Types" can this be converted to string and then added to the container?

EDIT 2: Ok now, im getting a Types Enumeration. Is there any way to map this enumeration in AX and add to container as string?

도움이 되었습니까?

해결책

Got it!! Here's the code :

tID = dict.tableName2Id(tableName);
counter = 0;
dt = new DictTable(tID);
if (dt)
{
    counter = dt.fieldNext(counter);
    while (counter)
    {
        df = dt.fieldObject(counter);
        if (df)
        {
            t = df.baseType();
            fields = conIns(fields,1,enum2str(t));

        }
        counter = dt.fieldNext(counter);
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top