Signed By/On

The Signed By/On component acts as a virtual signature and dating tool for instances.

Component Code

The first section of the code for the component contains the standard parameter set along with the variables needed for the component to function. Following the variables are the methods used by the component which are listed below.

OnParametersSetAsync()

This method is called when the component initializes and when there’s an update to the parent component. Its purpose is to assign values to variables.

SignOnClickHandler ()

This method is called when the Sign button is selected. It’s purpose is to ensure the field is modifiable and if so record the current time, who signed, and call ChangeXML().

UnSignOnClickHandler ()

This method is called when the Unsign button is selected. It’s purpose is to ensure the field is modifiable and if so clear the existing signature and call ChangeXML().

ChangeXML()

This method is used to update the XML of the instance to reflect the value of the SignedBy and SignedOn variables. When called the required XML is generated, the element name is equal to the XMLName variable, and the values are populated from the SignedOn and SignedBy variable values.

Lastly, a call is made to the ChangeField method on myInstance and the new XML is passed.

Here is an example of the XML structure that’s generated to be saved.

<SignedByOnField>
    Dylan Sprague On 2023-01-12 20:17:03 UTC
    <SignedBy>Dylan Sprague</SignedBy>
    <SignedOn>2023-01-12 20:17:03</SignedOn>
</SignedByOnField>
Updated on January 12, 2023

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support

Leave a Comment