cancel
Showing results for 
Search instead for 
Did you mean: 

Supplier Reminder creation through explicit script ends in Application Exception:At least one of the items below is invalid. Mouse over the highlighted area for more details.

Former Member
0 Kudos

Hi All,

I am trying to create a supplier reminder object (661) using an explicit script.

I am setting all the required values but I always get an error

"At least one of the items below is invalid. Mouse over the highlighted area for more details."

I tried catching the exception and used e.getAssociatedAttribute() to get the attribute resulting in the error - REMINDERS_T (this is nothing but the subordinate collection of the reminder in the supplier object, and not useful)

The code is as follows:



// Get the vendor/supplier object

   IBeanHomeIfc vendorHome = IBeanHomeLocator.lookup(session,VendorIBeanHomeIfc.sHOME_NAME);

   VendorIBeanIfc vendor = ((VendorIBeanHomeIfc) vendorHome).findByExternalId(vendor_id);

   VendorIBeanHomeIfc vendor_home = (VendorIBeanHomeIfc) vendor.getIBeanHomeIfc();

   vendor_home.upgradeToEdit(vendor);



// Get the collection of reminders

   SubordinateCollectionIfc activities = vendor.getCollnReminder();



// Create a new reminder collection member

   VenReminderIBeanIfc newAct = (VenReminderIBeanIfc) activities.create();



// Set the relevant attributes

   newAct.setDisplayName(disp_name);

   newAct.setEffectiveDate(TypeFactory.createSysDate(new Date()));

   newAct.setExpirationDate(TypeFactory.createSysDate(new Date()));

   newAct.setDueDate(TypeFactory.createSysDate(new Date()));

   newAct.setTypeObjRef(act_type);

   newAct.setReminderInstructions(rem_instr);

   newAct.setReminderComment(rem_comm);

   newAct.setOwnerObjRef(vendor.getBuyerContactObjRef());

   SendReminderToEnumType owner = new SendReminderToEnumType(SendReminderToEnumType.OWNER);

   newAct.setSendReminderTo(owner);

   newAct.setPublishToCalendar(true);



// Add the created reminder to the collection and save the vendor

   activities.add(newAct);

   vendor_home.save(vendor);      // Exception occurs at this line

   vendor_home.downgradeToView(vendor);

Accepted Solutions (1)

Accepted Solutions (1)

former_member89217
Contributor
0 Kudos

Without trying this specifically, My next step would be to check the status of each "Set".

Most likely one of set methods is failing. This would cause the activities.add() to add an incomplete collection member and the failure is caught on save.

put some conditional code on each set on newAct and let us know what you find.

Regards,

Gary

Former Member
0 Kudos

Hi Gary,

Thank you for your response.

I did as you advised.

After setting all the values, I used their respective getter methods to ensure that the correct values were being set.

And the values are being set fine.

I also plugged in the same logic in a field validation event's script to check if the values were somehow set incorrectly.

But, the reminder was created and saved without any problems through that script.

It did not generate an Application exception like in the case of the explicitly called script.

The issue doesn't seem to be with the code.

Any thoughts?

former_member89217
Contributor
0 Kudos

Interesting..  Since it worked correctly as a Field Validation script. (That was a good call by the way...) I have to agree it does not sound like a code problem.  You may have found an issue specific to explicitly called scripts.  If you could package up the script and some screen shots on how you set it up I'll test it here and see what I can determine.

Regards,

Gary

Former Member
0 Kudos

Hi,

Thanks again for your reply.

I am attaching the code. Have made a note at the lines which you would need to change to use the code on your system.

Steps to set up are:

  1. Just create an explicitly called script in setup.
  2. Paste the modified code to suit your system.
  3. Create a task to execute the script.
  4. Schedule the task.

I am able to consistently replicate the issue.

Let me know what you find.

Any help here will be greatly appreciated!

Thanks!

Padma

Former Member
0 Kudos

All,

just for information - this was accepted as a bug by SAP and will be resolved in SP7.

Bram

Answers (0)