Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to set value of field workersCompRateID in placement #269

Open
mukeshniit66 opened this issue Dec 13, 2019 · 0 comments
Open

Not able to set value of field workersCompRateID in placement #269

mukeshniit66 opened this issue Dec 13, 2019 · 0 comments

Comments

@mukeshniit66
Copy link

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

image

"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 had gone to bullhorn docs
image

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant