Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

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

Posted on by 101
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 1,382 Super User 2024 Season 2 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 101 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 796 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 12,181 Most Valuable Professional 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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans