cancel
Showing results for 
Search instead for 
Did you mean: 

Error ID is required

Former Member
0 Kudos

Hello,

I am trying to write a script to create a new UDO of type "SRF Form" (name of the document type) from within an RFX. I get an error stating "ID: This field is required and must have a valid value." I assumed that the create method would automatically assign the id of the UDO based on the numbering table assigned in the document setup. I tried to print the ID by getDocumentId() and got a null in the log. I cannot find any setter for the id. The weird thing is, after running the script, if I try to manually create the UDO, the numbers are skipped indicating that the numbering table has incremented. Can anyone please help me figure out what I am doing wrong?

Thanks,

MP

This is my code:

logMsg = Logger.createLogMessage(session);

try{

udoHome =IBeanHomeLocator.lookup(session, UserDefinedBizDoc1IBeanHomeIfc.sHOME_NAME);

udoBean = udoHome.create("SRF Form");

udoBean.setDisplayName("Test Auto"+doc.getDisplayName());

udoBean.setInternalCatObjRef(doc.getIntCategory());

udoBean.setCurrency(doc.getCurrency());

logMsg.setLogMessage("*****MP get the id **"+udoBean.getDocumentId());

Logger.info(logMsg);

udoHome.save(udoBean);

}

catch (Exception e){

throw doc.createApplicationException(null,e.getMessage());

}

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

The ID (UNIQUE_DOC_NAME) is assigned to document during Save (Validation /pre Save time). getDocumentID() method returns the UNIQUE_DOC_NAME value. From the exception it seems to could be due to a different ID field. Please check.

thanks,Baski

Former Member
0 Kudos

Thank you for responding Baski,

I manually created a new UDO of type "SRF Form"(my custom UDO document type). I hit save without entering any value, the only 2 fields where this error was thrown was Display Name and the Internal Category, I have assigned both of these through the script. The currency is defaulted, I am anyway assigning it in the script. The Document Type and Company are defaulted and displayed as labels and not editable fields, so I do not think I need to take care of these.

Do you have any suggestions on how I can debug this?

Thanks,

MP

Former Member
0 Kudos

Hi,

Not sure what the real issue could be..

Try doing a copy from an existing object and see Home.createFromAntother("Manuall_created_odoc_id) and see if you get an additinal insights..

Please post the full exception trace when you get a chance

Thanks, Baski

Former Member
0 Kudos

Hi Baski,

I added getAssociatedAttribute() to the error logging and got the error message for INT_CAT. I feel silly, but the int_cat in the originating RFX was null.

Thank you so much for the help.

Thanks,

MP

Answers (0)