Skip to main content

Process Request Type Link Creation Documentation in Synergy Environment

This documentation describes link building processes in the Synergy environment. Link creation operations are performed using the 'Shared' feature of ServiceApi. In order to perform these operations, we first need an instance of the ServiceApi object. Using this example, we can access 'Shared' from 'ServiceApi' and create a link using the 'CreateLink' function.

To perform these operations, we need to add the following two 'using' statements:

'''csharp using Bimser.Synergy.Entities.WebInterface.Business.DTOs.Requests; using Bimser.Synergy.Entities.WebInterface.Business.Objects.ShareLink;

## Process Request Type Link Creation

Below is a sample piece of code that performs the "Process Request" type link creation:

'''csharp
private string CreateEditAFormLink()
{
var serviceApi = new SynergyHelper(Session). ServiceApi;
CreateLinkRequest createLinkRequest = new CreateLinkRequest();
createLinkRequest.EmbeddedView = chbEmbeddedView.Value;
createLinkRequest.View=HideInfo
new ViewHideInfoObject(_hideLeftMenu, _hideBreadcrumbNavigation,
_hideBreadcrumbItems, _hideAppSearch, _hideAdminTools, _hideProfileMenu,
_hideApprovals, _hideLastVisitedDocuments, _hideAnnouncements, _hideActivities);
createLinkRequest.LinkType = (Bimser.Synergy.Entities.WebInterface.Common.Enums.CreateLinkType)1;
createLinkRequest.Scope = new List```<```string```>``` {
"sysfullaccess",
"idefullaccess",
"dmfullaccess",
"mobilefullaccess",
"appsfullaccess",
"menufullaccess",
"procmanfullaccess",
"sysaccess",
"appsfullaccess",
"web.announcement",
"web.announcement.read",
"webfullaccess",
"webaccess"
};
createLinkRequest.UserId = 1;
createLinkRequest.Status = true;
createLinkRequest.Payload = "{\"ProcessId\":1,\"RequestId\":2}";
createLinkRequest.RequestLimit = 99;
var result = serviceApi.Shared.CreateLink(createLinkRequest);
return result. Result.Result.LinkId;
}

Parameter Descriptions

'UserId'

The expression 'createLinkRequest.UserId = 1;' determines for whom we are creating the link or who should be processed when the link is to be processed. This is based on the value in the 'ID' column in the 'OSUSERS' table in the database.

'Scope'

We give all the authorizations in the periscope section, and if the authorization of the user number 1 is less than the scope granted, the authorizations of the user will be taken as basis.

'EmbeddedView'

If the value of the 'EmbeddedView' parameter is 'true', it ensures that only the form is displayed when the form is accessed with the link and makes other fields inaccessible.

'ViewHideInfo'

If we want to manage accesses separately, we need to use the 'ViewHideInfo' parameter.

'''csharp bool _hideLeftMenu = false; Hide Left Menu bool _hideBreadcrumbNavigation = false; Hide Navigation Menu bool _hideBreadcrumbItems = false; Hide Navigation Elements bool _hideAppSearch = false; Hide App Search bool _hideAdminTools = false; Hide Admin Tools bool _hideProfileMenu = false; Hide Profile Menu bool _hideApprovals = false; Hide Approvals bool _hideLastVisitedDocuments = false; Hide Recently Visited Documents bool _hideAnnouncements = false; Hide Announcements bool _hideActivities = false; Hide Activities


Giving a value here 'true' ensures that the corresponding field is hidden.

### 'Payload'

#### Process Request Type

For a process pending approval of a "Process Request" type, the values of 'ProcessId' and 'RequestId' are given in the 'Payload' section and the information about which process will be opened is specified.

'''csharp
createLinkRequest.Payload = "{\"ProcessId\":1,\"RequestId\":2}";

'RequestLimit'

The 'RequestLimit' parameter specifies the number of times the link can be clicked. For example, 'createLinkRequest.RequestLimit = 99;' means that the link can be clicked up to 99 times.

When the function is successfully executed, it will return the value of the generated link. By using this value, access to the relevant process can be achieved.