Not able to set value of field workersCompRateID in placement
mukeshniit66 opened this issue · 0 comments
I am using SDK Rest Api for update
Placement entity workersCompRateID not able to update
Step 1
i am using sdk-rest version is 1.2.48
com.bullhorn
sdk-rest
1.2.48
Step 2
Placement placementRecord = bullhornData.findEntity(Placement.class, rateCalculatorVO.getBhPlacementId().intValue());
try
{
WorkersCompensationRate workersCompensationRate= new WorkersCompensationRate();
workersCompensationRate.setId(10);
BigDecimal ratevar = BigDecimal.valueOf(1.00);
workersCompensationRate.setRate(ratevar);
logger.warn(System.getProperty("user.timezone"));
SimpleDateFormat sdf = new SimpleDateFormat("MM-dd-yyyy");
String dateInString = rateCalculatorVO.getStartDate();
Date startDate = sdf.parse(dateInString);
logger.warn("startDate = " + startDate);
Calendar calNewYork = Calendar.getInstance();
calNewYork.setTimeZone(TimeZone.getTimeZone("America/New_York"));
logger.warn("StartDate TimeInMillis = " + calNewYork.getTimeInMillis());
startDate.setHours(calNewYork.getInstance().getTime().getHours());
startDate.setMinutes(calNewYork.getInstance().getTime().getMinutes());
startDate.setSeconds(calNewYork.getInstance().getTime().getSeconds());
logger.warn("StartDate and Time = " + startDate);
DateTime dateBegin = new DateTime(startDate);
logger.warn("dateBegin = " + dateBegin);
workersCompensationRate.setStartDate(dateBegin);
workersCompensationRate.setEndDate(dateBegin);
PrivateLabel privateLabel = new PrivateLabel();
privateLabel.setId(18537);
privateLabel.setName("American Cybersystems (Dev)");
privateLabel.setTitle("American Cybersystems (Dev)");
privateLabel.setType("Base");
privateLabel.setNoLookAndFeel(0);
workersCompensationRate.setPrivateLabel(privateLabel);
WorkersCompensation workersCompensation= new WorkersCompensation();
workersCompensation.setId(10);
workersCompensation.setCode("dummy");
workersCompensation.setDescription("dummy");
workersCompensation.setName("dummy");
workersCompensation.setState("dummy");
workersCompensationRate.setCompensation(workersCompensation);
//Not able to set value of field workersCompRateID in placement
placementRecord.setWorkersCompensationRate(workersCompensationRate);
placementRecord.setComments("dummy1111");
}
catch(Exception e)
{
e.getMessage();
}
finally
{
}
Step3
"I got Response message like this "
detailMessage=associated entity workersCompensationRate with ID 10 not found,
propertyName=workersCompensationRate,
severity=WARNING,
type=ASSOCIATED_ENTITY_NOT_FOUND
UpdateResponse {
changedEntityType=Placement,
changedEntityId=51852,
changeType=UPDATE,
messages=[ {
detailMessage=read only property: dateLastModified,
propertyName=dateLastModified,
severity=WARNING,
type=READ_ONLY_FIELD
}, {
detailMessage=associated entity workersCompensationRate with ID 10 not found,
propertyName=workersCompensationRate,
severity=WARNING,
type=ASSOCIATED_ENTITY_NOT_FOUND
}, {
detailMessage=null,
propertyName=housingAmenities,
severity=WARNING,
type=ATTEMPT_TO_SET_TO_MANY
}, {
detailMessage=null,
propertyName=owners,
severity=WARNING,
type=ATTEMPT_TO_SET_TO_MANY
}, {
detailMessage=null,
propertyName=fileAttachments,
severity=WARNING,
type=ATTEMPT_TO_SET_TO_MANY
}, {
detailMessage=null,
propertyName=notes,
severity=WARNING,
type=ATTEMPT_TO_SET_TO_MANY
}],
errorCode=,
errorMessage=
}
I had also try second set of code
Placement placementRecord = bullhornData.findEntity(Placement.class, rateCalculatorVO.getBhPlacementId().intValue());
try
{
WorkersCompensationRate workersCompensationRate= new WorkersCompensationRate();
workersCompensationRate.setId(10);
BigDecimal ratevar = BigDecimal.valueOf(1.00);
workersCompensationRate.setRate(ratevar);
logger.warn(System.getProperty("user.timezone"));
SimpleDateFormat sdf = new SimpleDateFormat("MM-dd-yyyy");
String dateInString = rateCalculatorVO.getStartDate();
Date startDate = sdf.parse(dateInString);
logger.warn("startDate = " + startDate);
Calendar calNewYork = Calendar.getInstance();
calNewYork.setTimeZone(TimeZone.getTimeZone("America/New_York"));
logger.warn("StartDate TimeInMillis = " + calNewYork.getTimeInMillis());
startDate.setHours(calNewYork.getInstance().getTime().getHours());
startDate.setMinutes(calNewYork.getInstance().getTime().getMinutes());
startDate.setSeconds(calNewYork.getInstance().getTime().getSeconds());
logger.warn("StartDate and Time = " + startDate);
DateTime dateBegin = new DateTime(startDate);
logger.warn("dateBegin = " + dateBegin);
workersCompensationRate.setStartDate(dateBegin);
workersCompensationRate.setEndDate(dateBegin);
workersCompensationRate.setPrivateLabel(privateLabel);
workersCompensationRate.setCompensation(workersCompensation);
//Not able to set value of field workersCompRateID in placement
placementRecord.setWorkersCompensationRate(workersCompensationRate);
placementRecord.setComments("dummy1111");
}
catch(Exception e)
{
e.getMessage();
}
finally
{
}
"I got Response message like this "
detailMessage=associated entity workersCompensationRate with ID 10 not found,
propertyName=workersCompensationRate,
severity=WARNING,
type=ASSOCIATED_ENTITY_NOT_FOUND
I**t is required to set all associated object values to ? for update the workersCompRateID
//Not able to set value of field workersCompRateID in placement
placementRecord.setWorkersCompensationRate(workersCompensationRate);**
it very urgent and my production build stuck
please guild me and share me some code for update some value in workersCompRateID in placement entity with the help of sdk-rest version is 1.2.48.