SI.WRITEBACK function

Created by Harry Lewis, Modified on Wed, 12 Jun at 1:15 AM by Damien Zwillinger

Applies to:

  • Velixo NX
  • Sage Intacct
  • Plan: Premium



The SI.WRITEBACK function sends one or more lines of values to the ERP.  The function uses the fields specified in a pre-defined Object in the ERP.



TABLE OF CONTENTS


Syntax


=SI.WRITEBACK(ConnectionName, ObjectName, Settings, RecordNo, FieldName, ParentRecordReference, ParentRecordGroupName, OutputFieldNames, OutputRange, RangeOrDataItem1, ..., RangeOrDataItemN, ...)


Parameters


The SI.WRITEBACK function uses the following parameters:


Parameter

Required/Optional

Description

ConnectionName

Required

The name of the connection as configured in the Connection Manager.

ObjectNameRequired
A case-insensitive integration name of a Sage Intacct object.

SettingsOptionalA 2-column array with three rows:

Mode

Any of the below values

  • "create"
  • "update"
  • "create-or-update" (default)
  • "recreate"
  • "delete"
(This parameter is ignored if ParentRecordReference is specified)
BatchSizeA number (optional)

To avoid ERP timeouts on large writebacks and to improve responsiveness of the application, data is broken up in batches of 100 records (default). If you are processing large batches of writebacks and using screens with auto-numbered keys, you can adjust the batch size to ensure your data is not broken up in multiple records.
WritebackLocationExpects a LocationId (optional)

Set this setting to a Location Id only for entity-scoped objects (or objects' records marked as Private, in other words that are not available at the Top Level).

Considering the below example, you may reference cells: $P$6:$Q$8
or use a formula instead:
HSTACK( {"Mode";"BatchSize";"WritebackLocation"}, VSTACK("update",100,"") )

OR just: $P$6:$Q$7 for an object record available at the Top Level: 
or use this formula instead:
HSTACK( {"Mode";"BatchSize"}, VSTACK("update",100) )

RecordNoRequired when the Mode parameter is set to create, update, or recreateIndicates the record number to be used for creating, updating, or recreating a record within the ERP.
FieldNamesRequiredA comma-separated string OR an Excel range containing the names of the fields for writeback.
ParentRecordReferenceOptionalA reference to a cell containing another SI.WRITEBACK function to indicate that the current record has a child -> parent relationship with the other record.
ParentRecordGroupNameOptionalThe name of the XML grouping element for the child entries under the parent.
(this parameter is ignored if "ParentRecordReference" is not specified)
OutputFieldNamesRequired

an Excel range 

OR 

a comma-separated string containing field names to retrieve from the resulting object.

(Note: this parameter is ignored when in "delete" mode)

OutputRangeOptionalThe Excel range which will receive the fields of a created/updated record. (Note: this parameter is ignored when in "delete" mode)
RangeOrDataItem1RequiredThe first set of data to be sent to the ERP. The values to be written must be specified in the same order as the column/field names specified in the OutputFieldNames parameter.
...

RangeOrDataItemNRequiredAn additional set of data to be sent to the ERP.



Tips

  1. As an alternative to using the Platform Services > Object screen in Sage Intacct, you may also use the SI.QUERY and/or SI.OBJECTDEFINITION functions for determining the exact column names of a given Object to use in the Writeback function.
  2. The WRITEBACKCOMMIT function should be used for creating/updating/recreating parent child records (such as: Projects), so that the OutputRange value returned by the SI.WRITEBACK function can be used by subsequent SI.WRITEBACK in the same batch.



Examples 


Example 1 - Creating a new Vendor record


=SI.WRITEBACK($B$4,$B$6,$D$4:$E$5,,Table1[[#Headers],[Name]:[Status]],,,$H$4,$E13,Table1[@[Name]:[Status]])



Example 2 - Updating an attribute of an existing Project 


=SI.WRITEBACK($B$4,$B$6,$D$4:$E$5,[@RecordNo],Table2[[#Headers],[ProjectID]:[ProjectType]],,,,,Table2[@[ProjectID]:[ProjectType]])


Note: updating records requires specifying the RecordNo of the record to update. You may use the SI.QUERY function to query the same object and find out the RecordNo of the specific item you wish to update. 




Example 3 - Creating a record in a Private object (Cost Code Observed Percent Completed Entry scenario)


=SI.WRITEBACK($K$4,$K$6,$O$4:$P$6,,Table137[[#Headers],[TYPE]:[NOTE]],,,$P$7,P10,Table137[@[TYPE]:[NOTE]])


In this example, the WritebackLocation Setting is used in the 2-column Array: $O$4:$P$6, as the OBSPCTCOMPLETED object is a private object (meaning its records are "private" to a specific entity), and a specific Locationid must be referenced.




Note: Due to a limitation within Sage Intacct, Velixo is unable to provide a specific error message to inform that the WritebackLocation parameter needs to be used.  


Instead, the following error message may be displayed:



Except from the message:  BL01001973 Could not create obspctcompleted record


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article