Field being blanked out after form load action

Field being blanked out after form load action

I've got a deluge script to set the dropdown contents of the section and adtype fields in the screenshots.  Can anyone have a look at it and tell me why it's clearing out the Adtype field after the script has run.  The debug window is showing the contents of the list that's being put into the adtype drop down, the saved value, and the value in the adtype field at the end of the function.

To note, I have user update actions on the publication and section fields that will do the same things as the below function. Just individually when the user changes those fields.

Edited form plus debug
Report view of record
  1. // Save the current id's that populate these fields.
  2. pubid = input.Publication;
  3. secid = input.Section;
  4. adtypeid = input.Adtype;

  5. //Get the resticted section list for this publication
  6. pubsecList = Pubsection[Publication == pubid];
  7. secList = List();
  8. for each  sec in pubsecList
  9. {
  10. secList.add(Section[ID == sec.Section]);
  11. }

  12. //Get the restricted adtype list for this publication/section combination
  13. adtypeList = Pubadtype[Publication == pubid && Pub_Section == secid];
  14. adtList = List();
  15. for each  adtype in adtypeList
  16. {
  17. adtList.add(Adtype[ID == adtype.Adtype]);
  18. }

  19. info adtList ;
  20. info adtypeid ;
  21. //Set the new lists
  22. input.Section:ui.add(secList);
  23. input.Adtype:ui.add(adtList);

  24. //replace the values that have been automatically cleared out.
  25. input.Section = secid;
  26. input.Adtype = adtypeid;
  27. info input.Adtype;