public async Task <ActionResult> ViewContacts(AdvancedSearchViewModel viewModel) { if (viewModel.AccountID == 0) { viewModel.AccountID = this.Identity.ToAccountID(); } AdvancedSearchResponse <ContactAdvancedSearchEntry> response = await advancedSearchService.ViewContactsAsync(new AdvancedSearchRequest <ContactAdvancedSearchEntry>() { SearchViewModel = viewModel, AccountId = viewModel.AccountID, RoleId = this.Identity.ToRoleID(), RequestedBy = this.Identity.ToUserID(), IsAdvancedSearch = true, ViewContacts = true }); Guid guid = Guid.NewGuid(); if (response.ContactIds != null) { AddCookie("ContactsGuid", guid.ToString(), 1); var contactIds = response.ContactIds; cachingService.StoreSavedSearchContactIds(guid.ToString(), contactIds); } return(Json(new { success = true, response = guid.ToString() }, JsonRequestBehavior.AllowGet)); }