public SurveyMaint() { SurveySetup Data = SurveySetup.Current; UsersForAddition.Cache.AllowInsert = false; UsersForAddition.Cache.AllowDelete = false; }
public static (SurveyUser user, SurveyCollector coll) InsertAnonymous(SurveyMaint graph, Survey survey, Guid?refNoteID, bool saveNow, bool isTest) { SurveySetup setup = PXSelect <SurveySetup> .SelectWindowed(graph, 0, 1); var contactID = setup.AnonContactID; if (contactID == null) { throw new PXException("An Anonymous user needs to be setup in the Survey Preferences"); } if (survey.AllowAnonymous != true && survey.KeepAnswersAnonymous != true) { throw new PXException("Survey {0} ({1}) does not allow anonymous answers", survey.SurveyID, survey.Title); } var user = graph.InsertOrFindUser(survey, contactID, true); var collector = graph.DoUpsertCollector(survey, user, refNoteID, saveNow, isTest); return(user, collector); }