Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features/products standard pricebook #87

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

eehjunggnujhee
Copy link
Contributor

Critical Changes

Changes

Add new product recipe around NPSP membership scenario

Issues Closed

#51

@allisonletts allisonletts added the pkg-membershipschema Related to the OSC Membership Schema and Benefits project label Feb 21, 2022
@eehjunggnujhee eehjunggnujhee self-assigned this Mar 7, 2022
@samanthashain
Copy link
Contributor

@eehjunggnujhee is this ready for review?

@eehjunggnujhee
Copy link
Contributor Author

Hi @samanthashain
It has been waiting for a tester. The recipe is based on MembershipSchemaandBenefits but this recipe stands alone and use standard pricebook.

@programmer2coder
Copy link
Contributor

programmer2coder commented May 18, 2022

Being somewhat familiar with Products and Price Books, I decided to test this. I did it in a NPSP scratch org. The recipe runs without error. However, it only creates 1 product (AKA 1 membership type). In running the recipe with
-o num_records 3 -o num_records_tablename Product2
then it creates 3 random ones out of 3 possible ones in the recipe, so naturally odds are that 2 are duplicates, which is not useful.

  • Does it make more sense for the recipe to create 1 of each of the 3 products (Individual / Household / Corporate) ?
  • And have the UnitPrice be different for each (instead of $250 for all memberships)?
  • And set Active field value to TRUE for both Price Book Entry and Product (otherwise the records won't show up on the choices)

@eehjunggnujhee
Copy link
Contributor Author

eehjunggnujhee commented May 21, 2022

  • Does it make more sense for the recipe to create 1 of each of the 3 products (Individual / Household / Corporate) ?
  • And have the UnitPrice be different for each (instead of $250 for all memberships)?
  • And set Active field value to TRUE for both Price Book Entry and Product (otherwise the records won't show up on the choices)

Hi @programmer2coder
Thanks for testing. Yes your discovery is valid. I struggled around how to design a recipe on static data that were needed to be push to an org just once. I thought about copying and pasting the same recipe two more time with static value to the product type.. For some reasons, I did not like that approach.
So I decided to design a recipe to random pick one product and insert only once.
This leads me to a question to @prescod, Is there a way to loop items and insert only unique record once? I have here 3 product definitions and wish to push only once.

As for activating products, the cci config file has a custom task that will activate those product. Here is the custom task definition that you can find it from cumulusci.yml.

activate_standard_pricebook:
        description: Activate standard price book
        class_path: cumulusci.tasks.apex.anon.AnonymousApexTask
        options:
            apex: >
                pricebook2 book = [SELECT Id FROM pricebook2 WHERE isStandard = true];
                book.isActive = true;
                update book;

Thank you!

@eehjunggnujhee
Copy link
Contributor Author

hi @prescod , @acrosman, @programmer2coder

We will merge this repo after the March 2023. There are noticeable conflicts. Thank you

@acrosman
Copy link
Contributor

acrosman commented Feb 5, 2024

@eehjunggnujhee, well it's after March 2023 :)

This probably needs to be reviewed against the current status of the membership schema. @selfuntitled do you know what, if any, schema changes have happened since this was created.

We also still need to resolve the conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg-membershipschema Related to the OSC Membership Schema and Benefits project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants