Jump to content
Sign in to follow this  

calculating name of a container field

Recommended Posts

Hello FM Mavens, 

I am likely missing something. 

I have a script step that calculates the dimensions of an image in a container field. There are many such fields so the script should work with any arbitrary one. 

I get the name of the field by using script parameter Get(ActiveFieldName). 

Let's say I have a container field "cont1". The script is triggered by entering the field.

I am trying to calculate the height of the image by using 

GetContainerAttribute (Get ( LayoutTableName ) & "::" & Get ( ScriptParameter ); "height" )

The results are question marks - I am not sure why. If I explicitly identify the fields then the expression works. 

Tried the same expression (Get ( LayoutTableName ) & "::" & Get ( ScriptParameter )) in the script step "Set Field by Name" and it worked, which means that the expression correctly identifies the field the script is attached to. Then why is it not getting it the first step? What's wrong with the calculation? (FM17)




(I hope I posted it in the correct section)

Share this post

Link to post
Share on other sites

Hi Asu

GetContainerAttribute is expecting a field as the first argument, but you are giving it a string. It would be great if FileMaker worked out what you mean, but it won't! Try this :-

GetContainerAttribute (GetField ( Get ( LayoutTableName ) & "::" & Get ( ScriptParameter )); "height" )

The GetField command takes a string, and returns the contents of the field, which I believe will solve the problem.

  • Thanks 1

Share this post

Link to post
Share on other sites

Yes, it did, thanks! 

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Similar Content

    • By Answers
      Our people out in the field take photos which go directly into the container fields, we would like those photos to automatically transfer to the camera roll/gallery. I know there is an export command and that would allow the techs to export and choose the location, save image etc... But that is a tad too complicated for them.
      Any suggestions on how to automate this process, the script for export field contents doesn't have a choice to save to camera roll.
      Thank you!
    • By innodat
      Does anyone know how to fix an image from appearing too small within a container in WebDirect? In FMP it fills the container. Tried to "play" with most settings relating to containers, including margins, frame, etc. - no success. The problem presents itself in Safari in macOS Catalina, as well as Edge on Windows 10

      See image attached.
      I sure hope this isn't a bug! Because if it's a bug then it will get fixed... well, never. 

    • By stuee
      I have a container which i click on and take a photo on my ipad and it shows in the container. I want to be able to click that image on the ipad or pc to view the image full size after. How can i do this?
    • By Rich
      Greets, all:
      I'm using this calculation--in a parent table in a field temporarily named 'Temp'--to grab course numbers from the course_number field in a related/child table:
      UniqueValues ( List ( ASSIGNMENT_COURSE::Course_Number__lxt ) )
      (I'm using this calc because the child table contains multiple records with the same course number; it's not a key field.)
      My intent is to use six buttons--in the parent table--where each button would grab an assigned row's value using the calculation above. For example, say that the above calc has this result:
      I want Button 1 to grab AST-100; Button 2 to grab EDU-100; Button 3 to grab EDU-300, etc.
      Mind you, I can't make a value list out of Temp because it can't be indexed.
      TIA for your help! 
    • By Asu
      I know. Don't use them. But There is a simple task and a repeating field would be a quick solution.
      Field 1: a number
      Field 2: a calculated repeating field, each repetition adds the repetition number to the value of Field 1.
      Can it be done?
  • Who Viewed the Topic

    2 members have viewed this topic:
    org  Jonathan Ackerman 
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.