November Happy Hour will be moved to Thursday December 5th.

Validating external url / Simple Address

Vote:
 

Hello,

I am creating pages programmatically using a sync job, and these pages are using the externalurl / simple address feature.

Because of the site structure, some of these pages exists multiple places at once, and i therefore have multiple pages with the same externalurl / simple address.

What i would like to accomplish:

Before setting the external url, i would like to figure out if it is already in use, and in that case ignore it.

What i have read i must do, and tried:

var errors = ValidationService.Service.Validate(myPageDataObject);

I get no errors using the validationservice. However, i DO get errors, when i try to publish changes to the page i created, using the editor UI, after the page has been created programmatically.

I save my page like this:

ContentRepository.Service.Save(myPageDataObject, SaveAction.Publish, AccessLevel.NoAccess);

Thanks in advance!

#162818
Edited, Oct 17, 2016 14:59
Vote:
 

I would try using SQL Profiler when saving in the UI to see how Epi does the check.

#163190
Oct 19, 2016 22:14
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.