Hi, could anyone please explain how this function works. To be honest, I can't understand the document:
rbf_createRecord(objName, fieldMap, useIds, callback)
This function creates a new Rollbase record. Parameters:
• objName: integration name of the selected Object definition
• fieldMap: array of named parameters (name = field name, value = field value)
• useIds: if true, the API will accept numeric IDs; if false (default) the API will return integration codes for status fields and picklists
• callback: callback function. It will receive array of fetched records as first parameter.
Questions are:
1. By "selected Object definition", does it indicate the object for which I want to create a record?
2. For the 'fieldMap', is it an Array or a Map? what's the syntax of passing it into the function?
3. What is 'useIds'? A boolean?
4. It would be lovely if someone could give me an example.. ^^
In my case, I just want to create a record in a JavaScript Component.
Thanks a lot!!!
1. Correct. Now remember you should use the integration name and not the name. The two may be different.
2. It is a map
3. If you don't need it, just pass null
4. Here it is:
rbf_createRecord('client11',
{ 'lastName': 'The Client', 'Comments': 'This is a comment' },
null,
function() { location.reload(true); });
Hope it helps.
Thanks a lot ~~ It works.
Besides, I got a lookup field which needs to be assigned a value as well, we'll see if it works.