Skip to main content

Notifications

Business Central forum
Suggested answer

How do I turn a flowfield column into a plain Text[35] column on any List?

Posted on by 90
Hello,
 
I have a column where a value is referencing another field in the Sales Invoice Header to the Posted Sales Invoice Line List.
 
When I observe the Posted Sales Invoice Line List, it apparently has a link to something like the row's corresponding customer card on it (unsure if it is from someone's extension or from the Business Central 23.1 update), hindering it from making it searchable if I type the value of the cell as it appears to the eye. So, when I search for 600001 for example, the document is not found even though visually it says 600001.
 
Posted Sales Invoice List (Illustrative purposes only)
Document No.
Unsearchable column
(because it has a link)
Desired searchable column
(plain text)
Searchable External Document Number (Current Output So Far)
I-001-00001600001600001 
I-001-00002600002600002 
I-001-00003600003600003 
 
Using AL, my approach was to introduce another field where it can capture that surface value (the part that is not the link, 600001 for example) and use that for the cell values of the new column.
 
Unfortunately, the starting field on the Posted Sales Invoice List is using FlowField to perform  has caused this link (to the customer card) effect to occur when its intent is to retrieve the Sales Invoice Header's original values (which I checked is also in Text[35] format).

Is there another line that I can add that could unset the link-to-customer-card effect?
 
 

Your help is much appreciated.
Categories:
  • Suggested answer
    Yi Yong Profile Picture
    Yi Yong 200 on at
    How do I turn a flowfield column into a plain Text[35] column on any List?
    Hello Candava,
     
    To resolve the permissions error, you will need to provide the permission on the pageExt where you run the .Modify() function.
     
     
    Most, if not all, of the posted tables are not modifiable unless permissions are provided on the code/function.
  • Joseph.Candava Profile Picture
    Joseph.Candava 90 on at
    How do I turn a flowfield column into a plain Text[35] column on any List?
    Thanks for your responses.
     
    I have applied this code onto my page extension.
    trigger OnOpenPage()
    
        begin
    
            Rec.CalcFields(ExternalDocumentNo);
    
            Rec.ExternalDocumentNoTxt := Rec.ExternalDocumemtNo;
    
            Rec.Modify();
    
        end;
     

    Upon opening Posted Sales Invoice Lines page, I get an error message saying I lack permissions to use the Rec.Modify(); portion of the code.
    This was an unusual behaviour because I have been granted a "Yes" on the Modify permission for Table Data 113 when I go to the Users page.


    Upon checking "Effective Permissions" under my account, I discovered that my license does not allow me to modify Table Data 113.
    Which license will allow me to perform this?
  • Suggested answer
    Tech-Lucky Profile Picture
    Tech-Lucky 794 on at
    How do I turn a flowfield column into a plain Text[35] column on any List?

    As per your requirements and the code provided above, you need to save the calculated flow field value into a standard field. To achieve this, you will have to modify the "each" record every time your page runs the "OnOpenPage" trigger. However, this may cause performance issues
     
    the corrected code would be as follows. 
     




        trigger OnOpenPage()

        begin

            Rec.CalcFields(ExternalDocumentNo);

            Rec.ExternalDocumentNoTxt := Rec.ExternalDocumemtNo;

            Rec.Modify();

        end;

    I would recommend against using this approach. Instead, you should modify the new field in bulk by creating a batch only once. Then, you can devise logic to directly insert the value of the external document number into the New field each time a new sales invoice line is inserted.

  • gdrenteria Profile Picture
    gdrenteria 3,155 Super User on at
    How do I turn a flowfield column into a plain Text[35] column on any List?
    Hi
    I hope this can help you.  You can get the value from the flowfield field and copy it to the other text field.
    BR
    Gr

Helpful resources

Quick Links

Contextual content recommendations & SharePoint Q&A

Instantly access relevant sales materials…

Beyond the DRA Cloud Label Printing

Explore cloud-based label printing within Dynamics 365…

HR Infrastructure Customer merge

Important considerations for HR Customer migrations…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,414 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 223,502 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,142

Featured topics

Product updates

Dynamics 365 release plans