How I read and wirte a recorddata

Hi everyone, I have question about API.RPAID.RecordData,

step 1: const types=await API.RAPID.getValRecordTypes(); //I get T_ROB1 all recordTypes

step 2: const struc=await API.RAPID.getRecordDataStructure(‘PosProp’); // a Record Type, get type and blockUr

step 3: const newData=new API.RAPID.RecordData(‘PosProp’, ‘RAPID/T_ROB1/stPosProp’); // type, blockUrl is string

step 3 I Write in a Button’s onClick event , only a row , when I Click the Button, get error message ‘API.RAPID.RecordData is not constructor’, What can I do ?

about RecordData in API document is Wrong :

new RecordData(type, name, blockUrl, isAtom, children, isUnknownAtom, value)

but the ecosystem-rapid.js

class RecordData {
constructor(type, blockUrl, children = , name = ‘’, value = null) {
this.type = type;
this.blockUrl = blockUrl;
this.children = children;
this.isAtom = AtomicRapidSymbolTypeList.includes(this.type);
this.name = name;
this.setValue(value);
}

now,I Try const c=API.RAPID.getRecordData(‘PosProp’,‘RAPID/T_ROB1/PosProp’); It’s OK,but how can I get complete structure record object, and set the recorddata child value

finally,I got this

let a=await API.RAPID.getRecordDataStructure(‘PosProp’);

console.log(a.a.children[0]);

const b=API.RAPID.getRecordData(a.children[0].type,a.children[0].blockUrl);

b.value=true;

In fact , only one: let a=await API.RAPID.getRecordDataStructure(‘PosProp’); is OK

1 Like