cancel
Showing results for 
Search instead for 
Did you mean: 

SDK Bom.dbUpdate() error message

Former Member
0 Kudos

Hello Experts,

I am trying to update the status of a BOM with the following code.

But get an error in the logs that says "Record updated by another user (Message 10006)"

My code is as follows:


public String statusUpdate(String bom, String revision, String site, String newStatus,String bomType) {
		// TODO Auto-generated method stub
		
		DateGlobalizationServiceInterface dateService
		= (DateGlobalizationServiceInterface) GlobalizationService.getInvariantService(KnownGlobalizationServices.DATE);
		DateTimeInterface nowTimeStamp = dateService.createDateTime();
	
		Data msgData = new Data();
		msgData.put("SITE", site);
		msgData.put("BOM", bom);
		msgData.put("REVISION",revision);
		msgData.put("STATUS_BO",newStatus);
		msgData.put("MODIFIED_DATE_TIME",nowTimeStamp);
		msgData.put("BOM_TYPE", bomType);
				
		BOMBOInterface bomBean = (BOMBOInterface) ServiceLocator.getService("BOMBO");

		try{
					
		bomBean.dbUpdate(msgData);
	
				
		}catch (BasicBOBeanException e){
			e.printStackTrace();
			Utils.logAppServerMsg(Utils.getStackTrace(), 1);
			return Utils.getStackTrace();
		}
        	return "ok";
	}

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

To perform "update" of object you need to first read it and make sure to use correct modified date time of object that you read.

Thanks,

Bakhtiyar

Former Member
0 Kudos

Thanks Bakhtiya,

Working fine now.

- Amrik

Answers (0)