Content Manager User Discussions
cancel

Adding Additional Fields to WebDrawer Cataloguing Page

SOLVED
Go to solution
Highlighted
TheRealJerjef Respected Contributor.
Respected Contributor.

Adding Additional Fields to WebDrawer Cataloguing Page

I've created a new record cataloguing page in WebDrawer 9.1 without issue, but I am having difficulty adding additonal fields to the form.  I've tried adding them to a number of property sets in hptrim.config, but still no luck.  This is the error that's thrown to me.

Compiler Error Message: CS0117: 'HP.HPTRIM.ServiceModel.PropertyIds' does not contain a definition for 'Status'

Here's what I have so far in my page.cshtml file.

@{
ViewBag.Title = "Create and Upload a Document";

var recordTypes = this.TrimHelper.Search<RecordType>(
BaseObjectTypes.RecordType, "usable",
pageSize: 100, properties:new string[]{"Name"}, sortBy:new string[]{"Name"});

ViewBag.RecordContainer="12310/0/-10";
ViewBag.RecordRecordType="Service Call Ticket - USE THIS ONE";
}

<form class="trim-form" method="post" action="~/Record" enctype="multipart/form-data" style="margin-left:20px">
<input type="hidden" name="Continue" value="Record?q=uri:{0}" />
<fieldset>
<legend>Service Ticket</legend>
<label>Status</label>
<input name="@PropertyIds.Status" />
<input type="hidden" name="@PropertyIds.RecordRecordType" value="@ViewBag.RecordRecordType" />
<label>Details of Issue</label>
<input name="@PropertyIds.RecordTitle" />
<input type="hidden" name="@PropertyIds.RecordContainer" value="@ViewBag.RecordContainer" />
<label>Files:</label>
<input type="file" name="Files" multiple="multiple" />
<button type="submit" class="btn">Submit</button>
</fieldset>
</form>

 

1 ACCEPTED SOLUTION

Accepted Solutions
Micro Focus Expert
Micro Focus Expert
Solution

Re: Adding Additional Fields to WebDrawer Cataloguing Page

PropertyIds is an enum for the stock properties (things like Title, Number etc).  To put an additional field on a form just use its Search Clause Name which is usually the name minus spaces, see the native client to verify the field's search clause name.

 

<input type="text" name="RoadSurface" />

Blog | Samples | HPE CM 9.3 SDK Docs
**Any opinions expressed in this forum are my own personal opinion and should not be interpreted as an official statement on behalf of MicroFocus**
2 REPLIES
Micro Focus Expert
Micro Focus Expert
Solution

Re: Adding Additional Fields to WebDrawer Cataloguing Page

PropertyIds is an enum for the stock properties (things like Title, Number etc).  To put an additional field on a form just use its Search Clause Name which is usually the name minus spaces, see the native client to verify the field's search clause name.

 

<input type="text" name="RoadSurface" />

Blog | Samples | HPE CM 9.3 SDK Docs
**Any opinions expressed in this forum are my own personal opinion and should not be interpreted as an official statement on behalf of MicroFocus**
TheRealJerjef Respected Contributor.
Respected Contributor.

Re: Adding Additional Fields to WebDrawer Cataloguing Page

Thanks so much! That worked.  I can't believe how simple that is.  I spent so much time overthinking this issue and never bothered to use the search clause name by itself.  As always you're a god in the Webdrawer world.