Button Click Logic(OnAction Logic)
Introduction
Button Click Logic supports C# language. Please edit the code in the OnAction logic(c#) tab of the button. The code will trigger execution when Button Click (When Onclick logic does not return false).
Overall Variable
| Variable name | Type | Remarks |
|---|---|---|
| TenantId | string | Current TenantId |
| AppCode | string | Current AppCode |
| Env | string | Environment variables of the current form |
| DataId | string | DataId of the current form |
| PageMode | PageMode | Add=0,Edit=1,Preview=2,Inherit=3 |
| EntityCode | string | EntityCode of the current form |
| FormAilas | string | Alias name of the current form |
| Button | MetadataFormButton | Current Button information |
| BaseDoc | Dictionary<string,string> |
Data of current page, excluding Field set as disabled. Incomplete data when PageMode is Preview. |
| Doc | DynamicMetadata | Data of current page, excluding Field set as disabled. Incomplete data when PageMode is Preview. |
| Form | Dictionary<string, object> |
Definition of current form |
| User | CurrentUser | User information of current login user. |
| Service | namespace | Call available API by Service.MethodName() |
Return Object
- Introduction:Return object of Button Click Logic. This object must be returned in the code. The syntax is
return Return; - Object Name:Return
- Detailed field:
| Attribute | Type | Remarks |
|---|---|---|
| MsgTitle | string | Title of dialog box after executing button |
| MsgContent | string | Content of dialog box after executing button |
| DataId | string | Set this property, and the page will automatically jump to the preview page of the document. If both dataId and ReturnUrl are set, dataId will take precedence over ReturnUrl |
| InputData | Dictionary<string, object> |
Customised return value,which needs to be processed by JS defined in frontend. |
| ReturnUrl | string | Page automatically jumps to the url by setting this attribute. |