You are on page 1of 2

//ONLY REST API WORKS. SOAP API IS USED FOR TESTING.

NEED TO REMOVE HARD CODING


def nowString = "My String";
nowString = now().toString();
println("nowString=" + nowString);
def newrecId = nowString.substring(2,4)+ nowString.substring(5,7) +
nowString.substring(8,10);
newrecId += nowString.substring(11,13) + nowString.substring(14,16) +
nowString.substring(17,19);
def businessUnitId = 300000063467255;
def contractTypeId = 300000059117997;
def contractNumber = "ANILRKS001";
def partyId = 300000050899113;
def description = "AnilRama";
def externalSourceKey = 'Contract Request'
def externalKey = Id.toString();
def webServiceFlag = false;
def templateId = "";
def buyorsell = "B";
def enteredAmount = "100000";
def businessUnitName = BusinessUnit_c;
def startDate = new Date()
def endDate = null
def deleteSuccess = 'Y'
def ter ="";
def fun ="";
def newcontractHeader ="";

newcontractHeader=
[
"OrgId": 300000063467255,
"ContractTypeId": 300000067105238,
"ContractNumber": "RKS_203",
"LegalEntityName": "Purelab LLC",
"LegalEntityId": 300000062890535,
"CurrencyCode": "AED",
"StartDate": "2023-12-08",
"EndDate": "2024-12-07",
"PartyId": 300000050899113,
"PartyName": "ARABIAN COMPANY L.L.C"
/*OrgId : businessUnitId,
CurrencyCode : "AED",
ContractTypeId : contractTypeId,
ContractNumber : contractNumber,
Cognomen : "Contract Request : ANILRAMA001",
PrimaryPartyId : partyId,
StartDate : startDate,
Description : description,
ContractOwnerId : partyId,
ExternalSource: externalSourceKey,
ExternalKey: contractNumber,
WebServiceFlag : false,
AuthoringPartyCode :"EXTERNAL",*/
]
println ("New Contract Header: " +newcontractHeader)

//def resp = adf.webServices.ContractRequest_c.createContract(newcontractHeader);


//def resp = adf.webServices.Contracts_Creation.createContract(newcontractHeader);
// println ("resp = " + resp);
//def newContractId = resp[0].Value[0].Id;
//setAttribute("ContractId_c", newContractId);
def resp = adf.webServices.ContractWS.POST(newcontractHeader);
println(" end of contract generation")
def msg='A Contract has been created. Please select Save This Contract Request'
throw new oracle.jbo.ValidationException(msg)

You might also like