Skip to Content
avatar image
Former Member

Script to add suppliers in project document

Hello Experts ,

We are currently running on SAP Sourcing /CLM 10 . We are using project module with supplier tab .  Currently have a requirement for adding the supplier(s) in supplier tab of project via script ( instead of adding manually , needs to be added via script while saving the project  )  . The code we are trying is below but not working .

While saving the project document no error is appearing but supplier is also not appearing under supplier tab . Can you please guide ?

supplierContactColl = doc.getVendorList();

StandardVendor=doc.getVendorList().create();

StandardVendor.setUniqueName("VEN-0000002");

StandardVendor.setDisplayName("ABC Ltd");

StandardVendor.setContactEmail("seraka@xx.com");

The code is triggered on Project document and saving event .

Here , we wanted to hard code a supplier to be added in supplier tab . The supplier is existing  in CLM . Once we have the above code working , we need to add supplier dynamically on saving event .

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jul 22, 2015 at 08:09 AM

    Hi Sudipta,

    It is not recommended to set the values in POST_SAVE Event, changes will not reflect to the opened document. Moreover this event occurs when all the vaidation is done and doc is saved in the DB.  Try to move your code to Validate event script and check. It should work.

    Hope it helps!

    Best,

    Kushagra A

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Sudipta,

      Please see the below code:

      supplierContactColl = doc.getVendorList();

      StandardVendor=supplierContactColl .create();

      StandardVendor.setUniqueName("VEN-0000002");

      StandardVendor.setDisplayName("ABC Ltd");

      StandardVendor.setContactEmail("seraka@xx.com");

      supplierContactColl .add(StandardVendor);

      Hope it helps!

      Best,

      Kushagra A