Wednesday, May 29, 2019

Create Custom Record Types through SuiteTalk (Web Services) - Java Example

Custom record types, which are created in the user interface by navigating to Customization > Lists, Records, & FieldsRecord Types > New, can also be created via Web Services.

This can be done by performing the add operation with a record of type CustomRecordType. More information about the CustomRecordType record can be found in the SuiteTalk Schema Browser > customization.xsd.

The only mandatory field when setting up a custom record type is the Name field. This value needs to be provided in the Web Services request.

An example of a request creating a custom record type and specifying only its name is the following:

<soapenv:Envelope 	xmlns:xsd="" 	xmlns:xsi="" 	xmlns:soapenv="">    <soapenv:Body>        <add xmlns="">            <record 		xsi:type="ns1:CustomRecordType" 		xmlns:ns1="">                <ns1:recordName xsi:type="xsd:string">WS Test Record</ns1:recordName>            </record>        </add>    </soapenv:Body></soapenv:Envelope>

The relevant Java code used for this example can be seen in the following snippet:

CustomRecordType custRec = new CustomRecordType();//set the custom record type's namecustRec.setRecordName("WS Test Record");//perform the add operationWriteResponse custRecResp = port.add(custRec);

Note: Custom fields can be created for the custom record type only after the record type has been already created. More information about this can be found in SuiteAnswers : Custom Record Custom Field (Article Id: 10901).

No comments:

Post a Comment