Copy field contents into another linked tables field
Hi, I have multiple tables with a many to many link between two tables.
I have a text field called Description in the Work table and also a field in the Drawings table called Description.
How can I copy the contents of the Work table Description into the Description in the Drawings table to save me having to type the same thing again?
I have attached my Data model if that helps.
Many Thanks in advance.

8 replies
- 
  Hi David Assuming your relationship links are named after the tables EITHER - In the in the Trigger on new record of the Drawings table add this line Description := 'Drawing Link'.Work.Description OR - if the two descriptions never differ, replace the text field for a formula field and use this formula 'Drawing Link'.Work.Description Regards John 
- 
  Hi David, As it's a many-to-many relationship presumably one drawing can be used in different work items, so you I'm guessing want to add each work description to that of the drawing. (Otherwise I don't think you need the 'Drawing link' table) So my suggestion is to use a Trigger After Update in the Drawing Link table with code such as: let w := Work.Description;
 let d := Drawings.Description;
 let cr := "
 ";
 Drawings.(Description := d + cr + w)
- 
  You can even power this from a button. Using above suggested coding. I sometimes have a need not to type exactly the same info from the main table table into other table form. Thus I can free type info. I also have a button to copy the data and other button to clear the box of copied data if I need ot refer bax to blank field - to enter yet more/different data. This makes sense doing delivery notes from orders when at the last minutes the client wants a bespoke delivery address etc 
- 
  Hi Guys, Thanks for the suggestions, I couldn't get John's first option to work (probably because of my own inexperience) & didn't try the second option as I already have a few hundred entries in this table and didn't want to make more work for myself, but thanks for trying to help me. Bill's option seems to work and I can even alter it if I need to tweak this second description, so thank you Bill. Mel, thanks for the suggestion, but Buttons are way above my pay grade, so I have more chance of licking my own elbow, than creating this level of complexity :-) 
- 
  Hi David - I would say you can do buttons if you can do Trigger after update. In fact I recommend always testing out functions in a button before putting them in triggers so you can control when they kick off. Glad things are working. 
- 
  Davidw Button scripts can be very simple right up to megga complex - we are always hear to help. Just drop a button onto your form and put bills script into the onclick section.... 
- 
  Hi David Just to say sorry for my erronious code earlier. I normally mock something up and check it works as intended before posting. I concurr with all the other comments and Bill's solution is a good one. Good luck with those Buttons! Regards John 
- 
  I told you I wasn't up to Buttons yet :-) I made a button and added Bill's code in as suggested but I get an error.   It works OK when I have it here as part of the Description Field.   Does anybody have any thoughts on what needs to change for it to work using the Button? Many thanks 
Content aside
- 3 yrs agoLast active
- 8Replies
- 557Views
- 
    1
    Following
    
