Adding Code with C#

Steps
*There are three checkboxés: Call at Loading Page, Active and AutoPosback(Update All Controls). Check Call at Loading Page if the code will run
at the loading of the form. It is usually used if other if other controls are visible or not in loading, or loading the initial values of Grid, Textboxes, Dropdowns
or DatePicker. Checking the Active means this code will be used. AutoPosbak(Update All Controls) — it will update controls once the whole code within are processed. These controls are are listed in the Reload Dropdown/Grid/Table.

  • Click the Edit Code button : In the code environment, there are commented codes that give hints to programmers on what objects can be used.

DomainObject

DomainObject pertains to the entities(tables). Below are sample code to create domainObject, get domainObject…

In creating domainObject, this method should be called together with App name and entity name.

  • var project = bpmAppService.BPMSServices.DomainObjectService.CreateDomainObject();

To get the domainObject of the entity, use the below code:

  • var pCostSummary = bpmAppService.BPMSServices.DomainObjectService.GetDomainObject(Id);
    The Id is the id of the entity.

To save domainObject: bpmAppService.BPMSServices.DomainObjectService.SaveDomainObject(domainObjectname);

To update domainObject:
bpmAppService.BPMSServices.DomainObjectService.UpdateDomainObject(domainObjectname);

To commit all save and update:
bpmAppService.UnitOfWork.CommitTransaction();
bpmAppService.UnitOfWork.CommitTransaction(false);
Better to add false as a parameter so as not to clear the current session.

FormObject

FormObject are used to represent or hold entities, strings, date, boolean, etc. in the form. They can be also called within the code.

Steps to add a formObject

  • In the Form Entity tab, add a new Field.
  • Provide Name and Title, and DataType.
  • Check Complex Type and Is a List if it will hold a list of data.

Click this link for more detailed information: