Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / ​​​​​​​BPErrorTableFie...
Finance forum
Unanswered

​​​​​​​BPErrorTableFieldNotDefinedUsingType: Field must be defined using a type.

(1) ShareShare
ReportReport
Posted on by
Hi,

i created a str computed column method, that returns literal
SysComputedColumn::returnLiteral(1), SysComputedColumn::returnLiteral(0)

And i got this BP warning: BPErrorTableFieldNotDefinedUsingType: Field must be defined using a type.

1. What EDT can i use for this one to remove the BP warning, as there is no str with 1 single character -- or shall i create a new EDT?

2. if i switch the method to NoYes instead of str (as i can create enum unmapped field)-- what shall i use instead of returnLiteral(1)?
 
3. if i switch the method to boolean instead of str -- what shall i use instead of returnLiteral(1)? also there is no /boolean un mapped field to choose in the first place
  • Martin Dráb Profile Picture
    232,034 Most Valuable Professional on at
    ​​​​​​​BPErrorTableFieldNotDefinedUsingType: Field must be defined using a type.
    The type of the field does matter. One would create a string field and the other would create an enum field. The method will always return a string because it returns SQL code (which is a text), not the field value. The value is obtained by executing this SQL code when exporting the data.
     
    You can fill in Extends property if you're creating a specialization of an exiting EDT. If it's not the case, leave it empty.
  • Martin Dráb Profile Picture
    232,034 Most Valuable Professional on at
    ​​​​​​​BPErrorTableFieldNotDefinedUsingType: Field must be defined using a type.
    1) 10 isn't the minimum string length. You can use 1 if you want.
    2) Yes, the return value of the method must be string, because it's actually a piece of SQL code.
    3) You can use enums; you're just doing it wrong. If you look at your own screenshot, you'll see Enum Unmapped Field, which is what you need to use. The method will still return a string, as discussed in the previous point. You can find many examples in the standard application, e.g. SalesOrderLineCDSV2Entity::areTotalsComputedColumnDefinition().
  • Martin Dráb Profile Picture
    232,034 Most Valuable Professional on at
    ​​​​​​​BPErrorTableFieldNotDefinedUsingType: Field must be defined using a type.
    1. Use a data type that correctly describes the purpose of field (Name, Label, HelpText). Create a new one when no suitable one exists.
    2. You could technically use what you already have, because NoYes is stored as 0 or 1. But returnLiteral(NoYes::Yes) and returnLiteral(NoYes::No) will be better. But make sure you use an EDT with a specific label etc., as discussed above.
    3. boolean is an enum type, therefore it's the same situation as in the previous point.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,280 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,034 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans