0

simple dynamic field - small issue

I have a small issue with looking up other related data when using a dynamic field

so Table1 (Joblines) has the dynamic field in it called Pcode.

this is set up point to the lookup table (Products) matching to a text field also called Pcode

THIS ALL WORKS ( am i am succesfully returning the Pcode data)

but my issue is that when I select the pcode item - i want to also fill in the field (Description) data from Product into description field in JobLines at the same time.

however the scrip input into trigger on update in the dynamic field will not let me save the script

any ideas - looking chatbot/ninox other refs seems to suggest that my code should work. No formal reference exists between the tables as the dynamic field should provide the soft relationship

code in dynamic trigger after update is

if Pcode then
    Description := Pcode.Description (won't save this line?)
else
    Description := null
end 

3 replies

null
    • Ninox partner
    • RoSoft_Steven.1
    • 3 days ago
    • Reported - view

    try: 

    if Pcode then
       Description := record(Products,number(Pcode)).Description
    else
       Description := null
    end

    • Fred
    • 3 days ago
    • Reported - view

    Damn,  beat me to it.

    Anyways. You are on the right path. A dynamic choice field is a soft link. It will show you the recID (with number()) or the text (with text()) that you set to display. So you have to use the record() command to get the actual record.

    • Mel_Charles
    • 3 days ago
    • Reported - view

    ah Super guys

    I did try fiddling with "record" but did not have the syntax right (doh!)

    so assumed I was way off the mark.

    Works perfectly

    so THANK YOU 🙂

Content aside

  • Status Answered
  • 3 days agoLast active
  • 3Replies
  • 18Views
  • 3 Following