Question Nezla · Feb 26, 2018

Hi Guys,

I'm looking to Remove file from a location to another similar to CUT & Past function, I'm using this :

 s file=##class(%File).%New()
 d file.CopyFile(File,ArchivePath)
 d file.Delete(File)

and the copying is happening but not the Deleting, and help pls?

Thanks

16
0 2708
Question Nezla · Jan 15, 2018

Hi Guys,

I'm using the below code to Post JSON request to a REST API, but I'm getting "Failed to parse JSON request content." Error,

Set Body ##class ).

My code is generating this JSON request:

{
        "AustralianBusinessNumberId":"AustralianBusinessNumberId",
        "CountryC":"CountryC",
        "DetailsOrganisationalNameT":"DetailsOrganisationalNameT",
        "ElectronicMailAddressT":"ElectronicMailAddressT",
        "Line1T":"Line1T",
        "Line2T":"Line2T",
        "LocalityNameT":"LocalityNameT",
        "OrganisationDetailsOrganisationBranchC":"OrganisationDetailsOrganisationBranchC",                                                                              "PayAsYouGoWithholdingTaxWithheldA":0.1,
        "Payee":[ {
                        "AllowanceTypeTypeC":"AllowanceTypeTypeC",
                        "BirthDate":"2014-01-11",
                        "CommunityDevelopmentEmploymentProjectA":0.1,
                        "CountryC":"CountryC",
                        "DeductionTypeC":0.1,
                        "DeductionTypeTypeC":"DeductionTypeTypeC",
                        "ElectronicMailAddressT":"ElectronicMailAddressT",
                        "EmployerContributionsSuperannuationGuaranteeA":0.1,
                        "EmployerReportableA":0.1,
                        "EmploymentEndD":"2014-01-11",
                        "EmploymentPayrollNumberId":"EmploymentPayrollNumberId",
                        "EmploymentStartD":"2014-01-11",
                        "ExemptForeignEmploymentIncomeA":0.1,
                        "ExemptIncomeFringeBenefitsReportableA":0.1,
                        "FamilyNameT":"FamilyNameT",
                        "GivenNameT":"GivenNameT",
                        "INBGrossA":0.1,
                        "INBTaxWithheldA":0.1,
                        "IndividualNonBusinessEmploymentAllowancesA":0.1,
                        "LabourHireTaxWithheldA":0.1,
                        "Line1T":"Line1T",
                        "Line2T":"Line2T",
                        "LocalityNameT":"LocalityNameT",
                        "LumpSumAA":0.1,
                        "LumpSumAC":0.1,
                        "LumpSumBA":0.1,
                        "LumpSumDA":0.1,
                        "LumpSumEA":0.1,
                        "OrdinaryTimeEarningsA":0.1,
                        "OtherAllowanceTypeDe":"OtherAllowanceTypeDe",
                        "OtherGivenNameT":"OtherGivenNameT",
                        "PostcodeT":"PostcodeT",
                        "StateOrTerritoryC":"StateOrTerritoryC",
                        "TaxFileNumberId":"TaxFileNumberId",
                        "TaxableIncomeFringeBenefitsReportableA":0.1,
                        "TelephoneMinimalN":"TelephoneMinimalN",
                        "TerminationPaymentSummary":[ {
                                        "EmploymentTerminationPaymentTypeC":"EmploymentTerminationPaymentTypeC",
                                        "PaymentRecordPaymentEffectiveD":"2014-01-11",
                                        "SuperannuationEmploymentTerminationTaxableComponentTotalA":0.1,
                                        "SuperannuationTaxFreeComponentA":0.1,
                                        "TaxWithheldA":0.1
                                }
                        ],
                        "WorkingHolidayGrossA":0.1,
                        "WorkingHolidayTaxWithheldA":0.1
                }
        ],
        "PaymentRecordTransactionD":"PaymentRecordTransactionD",
        "PersonUnstructuredNameFullNameT":"PersonUnstructuredNameFullNameT",
        "PostcodeT":"PostcodeT",
        "TelephoneMinimalN":"TelephoneMinimalN",
        "TotalGrossPaymentsWithholdingA":0.1
}
7
0 6358
Question Nezla · Jan 15, 2018

Hi Guys,

I'm using Ensemble 2014 and have a code that Posts HttpRequest to a REST API and working fine, but don't know how to add Header to my request!?

I tried  Set Request.SetHeader("Source","Civicview") but it's bringing a Syntax error, any help pls?

 Set Request##class

thanks

3
0 1622
Question Nezla · Jan 15, 2018

Hi Guys,

I've a working that sent Http request to a REST API and is working fine,

 Set Body ##class

but now I'm looking to basically add an array or data inside the body so that it looks like this:

{
  "ElectronicMailAddressT": "string",
  "TelephoneMinimalN": "string",
  "Emp": [
    {
       "EmploymentPayrollNumberId": "string",
      "TaxFileNumberId": "string",
      "FamilyName": "string",
      "GivenName": "string",
        "PaymentSummary": [
        {
          "Tax": 0.1,
          "SuperTax": 0.1,
            }
      ]
    }
  ]
}
2
0 863
Question Nezla · Jan 1, 2018

Hi Guys,

Basically I'm looking for a sample what I can send data in aJSON format to a a webservice using an http request pls?

I've found some documentation on %Net.HttpRequest but a sample on how to connect to a Webservice and send data to it would be really helpful?

Our clients are running Cache & Ensemble 2014 

Thanks

21
0 6320