I want a field to display as a variable.

Demonic240Demonic240 Member Posts: 65
I am currently working on an expense form for our clients. The employee numbers are stored on the form, but I'm having trouble trying to get the employee's name to show up on a PO when I create one. Here is the code that I am trying to use to export the names:
      IF EmployeeExpense3.Meals =EmployeeExpense3.Meals::" " THEN
        PL.Description:='Mileage for '+EmployeeName+' on '+FORMAT(EmployeeExpense3."Work Date")+'.'
      ELSE
        PL.Description:='Meals for '+EmployeeName+' on '+FORMAT(EmployeeExpense3."Work Date")+'.';

PL:= Purchase Line
EmployeeExpense3:= The table of my expense form
EmployeeName:= The variable/field I'm trying to work with

Any help would be appreciated.

Comments

  • Demonic240Demonic240 Member Posts: 65
    If I could use this without having to use a flowfield I'd be in business.
    EmployeeName:=Vend.Name WHERE (No.=FIELD(Employee No.));
    
  • SavatageSavatage Member Posts: 7,142
    ever thought asbout adding a lookup flowfield to your table
    EmployeeExpense3
    EmployeeName would be text 50 or whatever the length of the Employee Name field might be.
    view it's properties
    change to the calcformula to something like
    FieldClass = Flowfield
    Lookup(Employee."First Name" WHERE (No.=FIELD(No.)))

    assuming your table is using "No." for the employee # too

    or would you rather use a GET or FIND see c/side help for info. or search the forum on how to use GET & FIND
  • Demonic240Demonic240 Member Posts: 65
    Thanks, I tried a flowfield but you can't show its contents elsewhere. I ended up using a vend.GET("Employee No."); That worked for me.
  • DenSterDenSter Member Posts: 8,305
    Sure you can show the content of a flowfield elsewhere, you only have to do CALCFIELD(MyFlowField) to populate it first.
  • Demonic240Demonic240 Member Posts: 65
    Ah, thanks.
Sign In or Register to comment.