Skip to Content
avatar image
Former Member

How can I add custom script to Supplier Registration approval?

I need to add some custom logic to replace the primary contact's User ID when a supplier registration record is approved. I am not able to figure out where exactly to write this script..Class no 607 - Supplier (masterdata.Vendor) or Class no 1606 Supplier (services.ServicesVendor) or Class No 147 Supplier Registration (vendormgmt.vendor_registration)?

When a supplier enters details in the supplier registration form, the only details regarding Contact are first name, last name and email. But when the same record comes up in Esourcing for the buyer's approval, and gets approved, I can see the Primary Contact is created with a system-generated user id. I want to supply my own user id instead of this.. so where should I write the custom script? Please help in identifying correct Class and Target.

TIA

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Mar 25, 2014 at 02:44 PM

    Hi Gayathri

    Generally in supplier registration forms suppliers are asked to accept the terms and conditions and then submit on save. Is this the case with you? what i mean to say is, since registration form is sell-side view of supplier class, is there a field in registration form (custom field) which will only get filled when submitting the registration form and not when buyer create a supplier via workflow , if yes, you might be able to identify between two processes.

    Regards

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 19, 2014 at 03:14 PM

    When the buyer approves a Supplier Registration record, the Create New Supplier screen is displayed with information from the registration page. The primary contact details are also populated in this way. When the buyer clicks Save, the supplier gets created.

    So the script ideally should be a pre-save script on Supplier (class 607). Now the problem is how do we identify whether this New Supplier screen was reached through registration approval flow or Create new supplier flow? I need to add the custom logic for registration approval flow only.. any pointers?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Thanks for the suggestion Arijeet.. but doc.getParentIBean() is null in both cases 😔

      I have implemented this currently in a roundabout way. My requirement is to replace the user id of the primary contact with another value in case the supplier is created through Registration Approval flow. (In case of new supplier/new contact I already have a script in place to replace the user id whenever the Contact record is validated).

      In this case, I am writing a script on Supplier - Validate. If doc.isObjectAccessModeNew() is true, I check the size of the list doc.getCollnContact(). If the size is 1, I am assuming it is a New Supplier created through Registration Approval (since the registration form requires primary contact details to be filled).. the same script will get called if some goes to Suppliers - Create Supplier and add just one contact record and Save.. but can't help it as of now..

      If anyone has any other solutions, please share..