In CalcFormula of FlowField, how to filter the values on basis of some field from a setup table?

azharsaeedkhanazharsaeedkhan Member Posts: 34
edited 2020-09-22 in NAV Three Tier
I have a solution where FlowFields are calculated on the basis of a hard coded filter, now i have moved all the hard coded values to a setup table to make the solution generic. But i am unable to filter on the basis of field from setup table.

In the image below, i want to filter it like

"Job Task No." = FIELD(SetupTable.Field)

qbve2h8kjj81.png

Best Answer

Answers

  • azharsaeedkhanazharsaeedkhan Member Posts: 34
    @AlexeyShamin Thank you it did work for now :)

    I have same scenario in TableRelation property of a normal field of type code, what do you recommend for that, how should i get rid of hard coded values?
  • AlexeyShaminAlexeyShamin Member Posts: 80

    I have same scenario in TableRelation property of a normal field of type code, what do you recommend for that, how should i get rid of hard coded values?

    In TableRelation in Condition field you can use only COnstants or Filters (hard coded)
    In "Table Filter" field you can use fields for filtering.

    In wich field you have hard coded values?
  • azharsaeedkhanazharsaeedkhan Member Posts: 34

    I have same scenario in TableRelation property of a normal field of type code, what do you recommend for that, how should i get rid of hard coded values?

    In TableRelation in Condition field you can use only COnstants or Filters (hard coded)
    In "Table Filter" field you can use fields for filtering.

    In wich field you have hard coded values?

    I want to replace the hard coded highlighted value with
    "Job Task No." = FIELD(SetupTable.Field)

    ajaoobj7b3an.png

    is this possible?
  • XwiochXwioch Member Posts: 24
    In this case I don't usually put filter directly on table releation just because you can't and you have to hardcoded it at suggested.
    I prefer to check the value in validate trigger (with a testfield for example) so you can verify manual inputs and, for show only filtered records on drilldown I customize the lookup trigger for open the page with a filtered records variable.
  • azharsaeedkhanazharsaeedkhan Member Posts: 34
    Xwioch wrote: »
    In this case I don't usually put filter directly on table releation just because you can't and you have to hardcoded it at suggested.
    I prefer to check the value in validate trigger (with a testfield for example) so you can verify manual inputs and, for show only filtered records on drilldown I customize the lookup trigger for open the page with a filtered records variable.

    Yes, that is what i have done. But i thought maybe there is some way to do it from TableRelation property without using hard coded value.
  • AlexeyShaminAlexeyShamin Member Posts: 80
    In WHERE statment try use FIELD instead FILTER


  • azharsaeedkhanazharsaeedkhan Member Posts: 34
    In WHERE statment try use FIELD instead FILTER


    It won't allow you unless the field exists in the same table. In my case the field which i want to filter the Job Task No. is from setup table that is different from this table.
  • AlexeyShaminAlexeyShamin Member Posts: 80
    try like in CalcField
    Create filter field in table and use it in tableRelation Filter
    "Job Task No." = FIELD("Job Task No. Filter")
Sign In or Register to comment.