Start a new topic

Going crazy! Simple question on virtual fields

Hi,

I'm new to the forum, hello all - looks like a nice little community here :)

I'm just getting into the API and all I want to do is create the Primary Addressee value based on two input fields in my input file (title and surname). So far I'm just testing a hard-coded value but I can't even get that to work. I've followed the first example in the intro video (https://www.youtube.com/watch?v=PeLeRAhUJr8) but despite copying what is done it just doesn't work, here's my problem: I create a virtual field in the virtual field section and set it to the Record Type 'Constituent Field' with a Value Type 'Primary Addressee'. I've typed in 'Primary Addressee' (without the single quotes) as the Field Name. I'm setting the function to Static Field (field name) as the video says to. In the code I'm just adding the following line in the AfterDictionaries section:

 Import.Fields.GetByName("Primary Addressee").Value = "Testing Testing"

However, when I test the code it sets the new field to 'Primary Addressee'. 

How do I get it to pick up whatever is in the code?! I'm sure it's a simple explanation but I feel a little bit crazy as what I have done is exactly what the video does and I just don't get the same behaviour.

 

Cheers!

1 Comment

Ignore me - I worked it out, you need to save the profile and then go back into it for things to stick and for the test code stuff to work, you can't just write some code in the editor then go straight into the test code window. Doh!
Login or Signup to post a comment