Options

USERID and FlowField

Pawel_MrPawel_Mr Member Posts: 7
Hi, my problem is:
I need to create a FlowField in the table and a CalcFormula should be like this (for example):
Count("Member Of" WHERE (User ID=FILTER(USERID)))
but "USERID" should return actual ID of logged user. Now it is only a text, not a function. How to write it correctly(and... i don't have permissions to use C/AL code in tables, forms and codeunits, only for reports)?

Comments

  • Options
    Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    You can make a new flowfilter "userid filter" and use this in your flowfield.

    But this means you have to set this in e.g. the OnOpenForm trigger by code. :(
  • Options
    Pawel_MrPawel_Mr Member Posts: 7
    I can't do this like that. No C/AL code. :cry:
  • Options
    Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    I don't know if this will work, it is just something that pops up in my mind.

    Have you tried to make a flowfield to the session table.User id where My Sesion=TRUE ??
  • Options
    Pawel_MrPawel_Mr Member Posts: 7
    It is a good idea. I will try it.
  • Options
    JedrzejTJedrzejT Member Posts: 267
    Hi
    This is bad calc formula?

    Count("Member Of" WHERE (User ID=FILTER(USERID)))

    This is good formula for me
    but "USERID" should return actual ID of logged user. Now it is only a text, not a function.

    USERID is not a text. It is global variable and holds actual logged user ID

    Drilldown Didn't works because member of table have no property DrilldownFormID. You have to create new form (wizard on table member of , type = tabular form). Second step is set DrillDownFormId = New form ID in talbe "Member OF"

    FlowField must works
  • Options
    Pawel_MrPawel_Mr Member Posts: 7
    Formula
    Count("Member Of" WHERE (User ID=FILTER(USERID)))
    doesn't work. USERID in this case is only a text, just like MYID or PM. I know that e.g. in C/AL code USERID will return logged user ID but in CalcFormula of FlowField it appear to be just a text.
  • Options
    JedrzejTJedrzejT Member Posts: 267
    I have no user in table member of because i logged on windows login
    I change it now. I create one user in databese user.

    Create FlowFileld in your table
    UserIdFilter CalcFormula = Lookup(Session."User ID" WHERE (My Session=CONST(Yes)))

    Create Second Flow
    Count("Member Of" WHERE (User ID=FIELD(UserIdFlow)))

    This Works fine.
    I don't know how, because flowfield can't based on another flowfield but in this case this WORKS

    FieldNo of first flowfield must be lower than your Count flowfield
  • Options
    JedrzejTJedrzejT Member Posts: 267
    On your form which shows that field, both flowfield must be visible

    Regards
  • Options
    Pawel_MrPawel_Mr Member Posts: 7
    Yes, it really works! Thanks!
Sign In or Register to comment.