I created a ampscript to embedded into cloud page to update the object in Salesforce.
Here is my Cloudpage landingpage:

```
<!doctype html>
<script language="javascript" runat="server">
Platform.Load("Core", "1.1.5");
var CONTROLLER = "https://consent.e-news.content.com/information-controller";
</script>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
  <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400&display=swap" rel="stylesheet">
  <!-- UAT Link --><link href="https://consent.e-news.content.com/information-css" rel="stylesheet">
  <link href="https://www.content.com/Themes/CONNew/Portal/favicon.ico" rel="shortcut icon" />
  <title>content Staff information</title>
</head>
<body>
  <nav class="site-header">
    <div class="container">
      <div class="header-logos row">
        <div class="logo-left col-12 col-sm-6 col-md-6 col-lg-6">
          <img src="https://image.e-news.content.com/lib/fe2f11717164047f7d1078/m/1/7ea18532-6044-4d0a-960e-ddf2cef706b1.png" alt="content" class="logo-vna" />
        </div>
        <div class="logo-right col-12 col-sm-6 col-md-6 col-lg-6">

        </div>
      </div>
    </div>
  </nav>
  <section class="banner jumbotron">
    <div class="banner-header container">
      <h1>STAFF INFORMATION</h1>
    </div>
  </section>

  <div class="container" id="Success">
    <div class="outer container">
      <div class="outer-block">
        <p>
          Update Successfully.
        </p>
      </div>
    </div>
  </div>

  <div class="container" id="Error">
    <div class="outer container">
      <div class="outer-block">
        <p>
          Update Failed.
        </p>
      </div>
    </div>
  </div>

  <div class="container" id="Load">
    <p>
      Welcome to Staff Information Page.
    </p>
    <div class="outer container">  

   <!--
  %%[  
  VAR @ContactID 
  SET @ContactID = RequestParameter("ContactID")
  VAR @ContactRows , @ContactRow
  SET @ContactRows = RetrieveSalesforceObjects(
  "Contact",
  "Id, AccountId",
  "Id", "=", @ContactID)

  VAR @AccountID, @AccountName, @AccountEmail , @AccountPhone , @AccountGender 
  VAR @AccountRows, @AccountRow

  IF RowCount(@ContactRows) >= 1 THEN
   SET @ContactRow = Row(@ContactRows,1)
   SET @AccountID = FIELD(@ContactRow,"AccountId")
  ENDIF

  IF @AccountID == ""  OR Empty(@AccountID) THEN
   Redirect("https://www.content.com/vn/en/home")
  ENDIF

  SET @AccountRows = RetrieveSalesforceObjects(
  "Account",
  "Id, Name, PersonEmail, Phone, Gender__c",
  "Id", "=", @AccountID)

  IF RowCount(@AccountRows) >= 1 THEN 
   SET @AccountRow            = Row(@AccountRows,1)   
   SET @AccountName           = FIELD(@AccountRow, "Name")
   SET @AccountEmail          = FIELD(@AccountRow, "PersonEmail")
   SET @AccountPhone          = FIELD(@AccountRow, "Phone")
   SET @AccountGender         = FIELD(@AccountRow, "Gender__c")

  ENDIF

   VAR @StaffId, @StaffName, @StaffPhone, @StaffGender, @StaffEmail, @StaffDepartment, @StaffCompany, @StaffTitle, @StaffBirthDate
   VAR @StaffRows , @StaffRow 
   VAR @StaffRecordType
   SET @StaffRecordType = "0127F000000KIinQAG"
   SET @StaffRows = RetrieveSalesforceObjects(
   "Relationship__c",
   "Id , Name, Email_VNA__c, Phone__c, Staff_Gender__c, Account__c, Staff_Level_5__c, Staff_Level_6__c, Staff_Title__c, Birthday__c",
   "Account__c", "=" , @AccountID, "RecordTypeId", "=" , @StaffRecordType
   )

   IF RowCount(@StaffRows) >= 1 THEN
   SET @StaffRow             = Row(@StaffRows, 1)
   SET @StaffId              = FIELD(@StaffRow, "Id")
   SET @StaffName            = FIELD(@StaffRow, "Name")
   SET @StaffPhone           = FIELD(@StaffRow, "Phone__c")
   SET @StaffGender          = FIELD(@StaffRow, "Staff_Gender__c")
   SET @StaffEmail           = FIELD(@StaffRow, "Email_VNA__c")
   SET @StaffDepartment      = FIELD(@StaffRow, "Staff_Level_6__c")
   SET @StaffCompany         = FIELD(@StaffRow, "Staff_Level_5__c")
   SET @StaffTitle           = FIELD(@StaffRow, "Staff_Title__c")
   SET @StaffBirthDate       = FIELD(@StaffRow, "Birthday__c")

   ENDIF 

  ]%%

    -->
 <div class="outer-block">
        <h4>
          Staff Information
        </h4>
      <input type="hidden" id="StaffId" name="StaffId" value="%%=v(@StaffId)=%%" />
       <div class="gold-pattern row">
          <div class="inner col-6">
            <h6>
              Name
            </h6>            
          </div>
          <div class="inner col-6">
            <input type="text" class="form-control" id="StaffName" name="StaffName" placeholder="%%=v(@StaffName)=%%" value="%%=v(@StaffName)=%%">
          </div>
        </div>

  <div class="gold-pattern row">
          <div class="inner col-6">
            <h6>
              Company
            </h6>            
          </div>
          <div class="inner col-6">
            <input type="text" class="form-control" id="StaffCompany" name="StaffCompany" placeholder="%%=v(@StaffCompany)=%%" value="%%=v(@StaffCompany)=%%">
          </div>
        </div>

   <div class="gold-pattern row">
          <div class="inner col-6">
            <h6>
              Department
            </h6>            
          </div>
          <div class="inner col-6">
            <input type="text" class="form-control" id="StaffDepartment" name="StaffDepartment" placeholder="%%=v(@StaffDepartment)=%%" value="%%=v(@StaffDepartment)=%%">
          </div>
        </div>

      <div class="gold-pattern row">
          <div class="inner col-6">
            <h6>
              Title
            </h6>            
          </div>
          <div class="inner col-6">
            <input type="text" class="form-control" id="StaffTitle" name="StaffTitle" placeholder="%%=v(@StaffTitle)=%%" value="%%=v(@StaffTitle)=%%">
          </div>
        </div> 

        <div class="gold-pattern row">
          <div class="inner col-6">
            <h6>
              Gender
            </h6>            
          </div>
          <div class="inner col-6">            
              <input type="radio" name="StaffGender" value="M" %%[IF @StaffGender == "M" THEN]%%checked%%[ENDIF]%%>Male  
              <input type="radio" name="StaffGender" value="F" %%[IF @StaffGender == "F" THEN]%%checked%%[ENDIF]%%>Female              
            </div>

          </div>        

        <div class="gold-pattern row">
          <div class="inner col-6">
            <h6>
              Birth date
            </h6>            
          </div>
          <div class="inner col-6">
            <input type="date" class="form-control" id="StaffBirthDate" name="StaffBirthDate" placeholder="%%=v(@StaffBirthDate)=%%" value="%%=v(@StaffBirthDate)=%%">
          </div>
        </div>  

  <div class="gold-pattern row">
          <div class="inner col-6">
            <h6>
              Phone
            </h6>            
          </div>
          <div class="inner col-6">
            <input type="text" class="form-control" id="StaffPhone" name="StaffPhone" placeholder="%%=v(@StaffPhone)=%%" value="%%=v(@StaffPhone)=%%">
          </div>
        </div>

   <div class="gold-pattern row">
          <div class="inner col-6">
            <h6>
              VNA Email Address
            </h6>            
          </div>
          <div class="inner col-6">
            <input type="email" class="form-control" id="StaffEmail" name="StaffEmail" placeholder="%%=v(@StaffEmail)=%%" value="%%=v(@StaffEmail)=%%">
          </div>
        </div>

    <div class="outer-block">
        <div class="row">
          <div class="align-right container">
            <button type="button" class="btn btn-outline-primary" name="UpdateStaff" id="btn-update" onClick="update('UpdateStaff');">Update</button>
          </div>
        </div>
      </div>

  </div> 

   <!-- 
  %%[ 
   VAR @RelationId, @RelationName, @RelationPhone, @RelationGender, @RelationBirthdate, @Relation
   VAR @RelationRows, @RelationRow   
   VAR @RelationRecordType
   SET @RelationRecordType = "0127F000000KIiiQAG"
   VAR @NumberRelation
   SET @RelationRows = RetrieveSalesforceObjects(
   "Relationship__c",
   "Id , Name, Phone__c, Staff_Gender__c, Account__c, Relationship__c, Birthday__c",
   "Account__c", "=" , @AccountID, "RecordTypeId", "=" ,@RelationRecordType
   )
   ]%%
   -->
   %%[IF RowCount(@RelationRows) > 0 THEN ]%% 
      <div class="outer-block">
        <h4>
          Relation Information
        </h4> 
   <!-- %%[ENDIF]%% -->
   <!-- 
   %%[
   IF RowCount(@RelationRows) > 0 THEN
    SET @NumberRelation            = RowCount(@RelationRows)
    FOR @i = 1 to RowCount(@RelationRows) do
     SET @RelationRow           = Row(@RelationRows,@i)
     SET @RelationId            = FIELD(@RelationRow, "Id")
     SET @RelationName          = FIELD(@RelationRow, "Name")
     SET @RelationPhone         = FIELD(@RelationRow, "Phone__c") 
     SET @Relation              = FIELD(@RelationRow, "Relationship__c")
     SET @RelationBirthdate     = FIELD(@RelationRow, "Birthday__c")
  ]%%
  -->
        <input type="hidden" id="RelationId%%=v(@i)=%%" name="RelationId%%=v(@i)=%%" value="%%=v(@RelationId)=%%" />
  <div class="gold-pattern row">
          <div class="inner col-6">
            <h6>
              Name
            </h6>            
          </div>
          <div class="inner col-6">
            <input type="text" class="form-control" id="RelationName%%=v(@i)=%%" name="RelationName%%=v(@i)=%%" placeholder="%%=v(@RelationName)=%%" value="%%=v(@RelationName)=%%">
          </div>
        </div>

   <div class="gold-pattern row">
          <div class="inner col-6">
            <h6>
              Relation
            </h6>            
          </div>
          <div class="inner col-6">
            <input type="text" class="form-control" id="Relation%%=v(@i)=%%" name="Relation%%=v(@i)=%%" placeholder="%%=v(@Relation)=%%" value="%%=v(@Relation)=%%">
          </div>
        </div>     

   <div class="gold-pattern row">
          <div class="inner col-6">
            <h6>
              Birth date
            </h6>            
          </div>
          <div class="inner col-6">
            <input type="date" class="form-control" id="RelationBirthdate%%=v(@i)=%%" name="RelationBirthdate%%=v(@i)=%%" placeholder="%%=v(@RelationBirthdate)=%%" value="%%=v(@RelationBirthdate)=%%">
          </div>
        </div>

  <div class="gold-pattern row">
          <div class="inner col-6">
            <h6>
              Phone
            </h6>            
          </div>
          <div class="inner col-6">
            <input type="text" class="form-control" id="RelationPhone%%=v(@i)=%%" name="RelationPhone%%=v(@i)=%%" placeholder="%%=v(@RelationPhone)=%%" value="%%=v(@RelationPhone)=%%">
          </div>
        </div>

   <div class="outer-block">
        <div class="row">
          <div class="align-right container">
            <button type="button" class="btn btn-outline-primary" name="UpdateRelation" id="btn-update" onClick="update('UpdateRelation%%=v(@i)=%%');">Update</button>
          </div>
        </div>
      </div>
  <!--
  %%[
   NEXT @i
  ENDIF
  ]%% 
  -->

  </div>        

    </div>
  </div>

  <div class="container-fluid footer-band">
    <div class="copyright">
      <p>
        &copy; 2019 content JSC<br />
        content JSC -<br />
        Tel: xxxxx.<br />
        Certificate Of Business Registration - No.: 0100107518, 5th registration dated 08/07/2016
      </p>
    </div>
  </div>
<script>
    var CONTROLLER = "<ctrl:var name=CONTROLLER />";

    $(document).ready(function() {
      $("#Success").hide();
      $("#Error").hide();
      $("#Load").show();
    });

    function update(action) {
      var Action            = action;
      var StaffId           = $('#StaffId').val();
      var StaffName         = $('#AccountID').val();
      var StaffCompany      = $('#AccountName').val();
      var StaffDepartment   = $('#AccountEmail').val();
      var StaffTitle        = $('#AccountPhone').val();
      var StaffGender       = document.querySelector('input[name="StaffGender"]:checked').value;
      var StaffBirthDate    = $('#StaffBirthDate').val();
      var StaffPhone        = $('#StaffPhone').val();
      var StaffEmail        = $('#StaffEmail').val();

      console.log(StaffGender);
      if (action == 'UpdateStaff') {     
        console.log('Action is UPDATE STAFF');
        $.ajax({
          url:      CONTROLLER,
          dataType: 'json',
          type:     'POST',
          data: {
            Action:            Action,
            StaffId:           StaffId,
            StaffName:         StaffName,
            StaffCompany:      StaffCompany,
            StaffDepartment:   StaffDepartment,
            StaffTitle:        StaffTitle,
            StaffGender:       StaffGender,
            StaffBirthDate:    StaffBirthDate,
            StaffPhone:        StaffPhone,
            StaffEmail:        StaffEmail

          },
          error: function(jqXHR, exception) {
            displayError(jqXHR, exception);
          },
          success: function(data) {
            result = eval(data);
            if (result.status == "Success") {
              $("#Error").hide();
              $("#Load").hide();
              $("#Success").show();
            } else {
              $("#Success").hide();
              $("#Load").hide();
              $("#Error").show();
            }
          }
        });
      }else if(action.includes('UpdateRelation')) {
          var i = action.substring(action.length - 1, action.length);
          var  RelationName      = $('#RelationName'+i).val();                 
          var  RelationPhone     = $('#RelationPhone'+i).val();    
          var  Relation          = $('#Relation'+i).val();     
          var  RelationBirthdate = $('#RelationBirthdate'+i).val();
    $.ajax({
          url:      CONTROLLER,
          dataType: 'json',
          type:     'POST',
          data: {
            Action:             Action,
            RelationName:       RelationName,
            RelationPhone:      RelationPhone,
            Relation:           Relation,
            RelationBirthdate:  RelationBirthdate

          },
          error: function(jqXHR, exception) {
            displayError(jqXHR, exception);
          },
          success: function(data) {
            result = eval(data);
            if (result.status == "Success") {
              $("#Error").hide();
              $("#Load").hide();
              $("#Success").show();
            } else {
              $("#Success").hide();
              $("#Load").hide();
              $("#Error").show();
            }
          }
        });

   }     
    }

    function displayError(jqXHR, exception) {
      var message;

      if (jqXHR.status === 0) {
        message = "Not connect.\n Verify Network.";
      } else if (jqXHR.status == 404) {
        message = "Requested page not found.";
      } else if (jqXHR.status == 500) {
        message = "Internal Server Error.";
      } else if (exception === 'parsererror') {
        message = "Requested JSON parse failed.";
      } else if (exception === 'timeout') {
        message = "Timeout error.";
      } else if (exception === 'abort') {
        message = "Ajax request aborted.";
      } else {
        message = "Uncaught Error.\n" + jqXHR.responseText;
      }
      alert("Error: "  + message);
    }
  </script>

  <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
</body>

```

and this is my controller (SSJS)

```
<script language="javascript" runat="server">
Platform.Load("Core", "1.1.5");
var wsproxySOAP       = new Script.Util.WSProxy();

var Action            = Request.GetFormField("Action");

Variable.SetValue('@getAction', Action);
Variable.SetValue('@getContactID', ContactID);
Variable.SetValue('@getContactName', ContactName);
Variable.SetValue('@getSubID', SubID);
Variable.SetValue('@getPrefID', PrefID);
Variable.SetValue('@getEmailAddress', EmailAddress);

if (Action == 'UpdateStaff') {
  var StaffId           = Request.GetFormField("StaffId");
  var StaffName         = Request.GetFormField("StaffName");
  var StaffCompany      = Request.GetFormField("StaffCompany");
  var StaffDepartment   = Request.GetFormField("StaffDepartment");
  var StaffTitle        = Request.GetFormField("StaffTitle");
  var StaffGender       = Request.GetFormField("StaffGender");
  var StaffBirthDate    = Request.GetFormField("StaffBirthDate");
  var StaffPhone        = Request.GetFormField("StaffPhone");
  var StaffEmail        = Request.GetFormField("StaffEmail");

  console.log('StaffName' , StaffName);

  Variable.SetValue('@getStaffId', StaffId);
  Variable.SetValue('@getStaffName', StaffName);
  Variable.SetValue('@getStaffCompany', StaffCompany);
  Variable.SetValue('@getStaffDepartment', StaffDepartment);
  Variable.SetValue('@getStaffTitle', StaffTitle);
  Variable.SetValue('@getStaffGender', StaffGender);
  Variable.SetValue('@getStaffBirthDate', StaffBirthDate);
  Variable.SetValue('@getStaffPhone', StaffPhone);
  Variable.SetValue('@getStaffEmail', StaffEmail);

}

</script>
%%[
SET @Action             = @getAction

IF @Action == 'UpdateStaff' THEN
  SET @StaffId            = @getStaffId
  SET @StaffName          = @getStaffName
  SET @StaffCompany       = @getStaffCompany
  SET @StaffDepartment    = @getStaffDepartment
  SET @StaffTitle         = @getStaffTitle
  SET @StaffGender        = @getStaffGender
  SET @StaffBirthDate     = @getStaffBirthDate
  SET @StaffPhone         = @getStaffPhone
  SET @StaffEmail         = @getStaffEmail  
ENDIF

SET @UpdateStaffInfo = UpdateSingleSalesforceObject(
    "Relationship__c", @StaffId,
    "Name", @StaffName, 
    "Phone__c", @StaffPhone,
    "Staff_Gender__c", @StaffGender,
    "Email_VNA__c", @StaffEmail,
    "Staff_Level_6__c", @StaffDepartment,
    "Staff_Level_5__c", @StaffCompany,
    "Staff_Title__c", @StaffTitle,
    "Birthday__c", FormatDate(@StaffBirthDate, "iso"
)

VAR @Status
IF (@UpdateStaffInfo == 1) THEN
  SET @Status = "Success"
ELSE
  SET @Status = "Failure"
ENDIF
]%%
<script language="javascript" runat="server">
Platform.Load("Core", "1.1.5");

var result;
var status = Variable.GetValue('@Status');

result = {status: status};
Write(Stringify(result));

</script>

```

but when I try to hit the button Update, I get this error message.

[![enter image description here](https://i.stack.imgur.com/F1QH1.png)](https://i.stack.imgur.com/F1QH1.png)

Please can anyone let me know where did I go wrong ? Thanks in advance