Creating Table-Data Details for an Existing Revisable Regulatory Submission
To create a table-data type and its attributes for an existing revisable regulatory submission, the regulatory submission must be the latest revision (version) and must be checked out. To create table data details, you must have Modify permissions to the regulatory submission.
In a single call, you can also create:
Different types of table data.
Multiple instances of the same type of table data.
* 
The specified table-data type must be instantiable.
The attributes that are defined with a "Required" constraint in Windchill must be specified.
Each table data attribute must adhere to its defined:
Attribute constraints
Cascading attribute rules
The following example shows you how to create a table data subtype along with two attributes for a revisable regulatory submission. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/RegMstr/RegSubmission2('OR:com.ptc.qualitymanagement.regmstr.AdverseEventRegulatorySubmission:272722')/TableData
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"@odata.type": "#PTC.RegMstr.SampleTableData",
"TDString": "test",
"TDInteger": 12
}
The request creates the SampleTableData subtype object along with its two attributes, TDString and TDInteger, for the specified regulatory submission.
Example: Creating Different Types of Table Data Using a Batch Request
The following example shows you how to create different types of table data and their attributes for a revisable regulatory submission. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/RegMstr/$batch
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body: Raw, Text
--batch_12345
Content-Type: application/http
Content-Transfer-Encoding: binary

POST /Windchill/servlet/odata/RegMstr/RegSubmission2('OR:com.ptc.qualitymanagement.regmstr.AdverseEventRegulatorySubmission:272722')/TableData
Content-Type: application/json

{
"@odata.type":"#PTC.RegMstr.SampleTableData",
"TDString":"testSampleTableData",
"TDInteger":124
}


--batch_12345
Content-Type: application/http
Content-Transfer-Encoding: binary

POST /Windchill/servlet/odata/RegMstr/RegSubmission2('OR:com.ptc.qualitymanagement.regmstr.AdverseEventRegulatorySubmission:272722')/TableData
Content-Type: application/json

{
"@odata.type":"#PTC.RegMstr.TableDataSub",
"TDString":"testTableDataSub",
"TDInteger":125
}


--batch_12345--
The request creates two different table-data types, SampleTableData and TableDataSub, along with two attributes for each.
Example: Creating Multiple Instances of the Same Type of Table Data Using a Batch Request
The following example shows you how to create multiple instances of the same type of table data and their attributes for a revisable regulatory submission. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/RegMstr/$batch
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body: Raw, Text
--batch_12345
Content-Type: application/http
Content-Transfer-Encoding: binary

POST /Windchill/servlet/odata/RegMstr/RegSubmission2('OR:com.ptc.qualitymanagement.regmstr.AdverseEventRegulatorySubmission:272722')/TableData
Content-Type: application/json

{
"@odata.type":"#PTC.RegMstr.TableDataSub",
"TDString":"testTableDataSub",
"TDInteger":124
}


--batch_12345
Content-Type: application/http
Content-Transfer-Encoding: binary

POST /Windchill/servlet/odata/RegMstr/RegSubmission2('OR:com.ptc.qualitymanagement.regmstr.AdverseEventRegulatorySubmission:272722')/TableData
Content-Type: application/json

{
"@odata.type":"#PTC.RegMstr.TableDataSub",
"TDString":"testTableDataSub",
"TDInteger":124
}


--batch_12345--
The request creates two instances of the same table-data type, TableDataSub, along with the two attributes for each.
這是否有幫助?