Use document page type field value in form default value

Brad Chapman asked on October 21, 2016 07:42

Hi there

Here's the scenario: I wish to seed the value from a document page type (CMS.StaffPortalOSDPage) field (CentreEnterprise) as the default value for a biz form. The document is a custom staff record page and the field I'm filtering by is a staff ID.

The macro I'm trying to work with is something like:

{% SiteObjects.CMS_StaffPortalOSDPage.GetProperty("CentreEnterprise").where("StaffPortalOSDRecordID in (select StaffPortalOSDRecordID from CMS_StaffPortalOSDRecord where StaffID ='" + CurrentUser.UserSignature + "')") #%}

The bit I'm struggling with is how to identify the object/document (in bold)

The example above does not work so I need some assistance in the correct convention.

Cheers, Brad

Correct Answer

Roman Hutnyk answered on October 21, 2016 09:20


You can select some documents with macro like this:

SiteObjects.Documents.Where("ClassName = 'Directory.Plant'")

but this will not return you coupled columns. I think you need to implement custom macro to achieve this.

0 votesVote for this answer Unmark Correct answer

Recent Answers

Jan Hermann answered on October 21, 2016 15:09

Could you describe your issue in different way (maybe some example)? I am not 100% sure I follow you.

0 votesVote for this answer Mark as a Correct answer

Brad Chapman answered on November 11, 2016 06:15

Thanks Jan, Roman.

I'm trying to set the default value of a bizform drop down list to be the field value from another page based on a filter.

I think I can write the filter, but I cannot get the format right for the site object. I think Roman has put me on a track I can follow though.

Thank you both.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.