+ Start a Discussion
Tala PinedaTala Pineda 

Is there a way for me to create an object similar to the function of Products?

We want to be able to select multiple items on a custom object. Just like how products work. I can have a database of items where it can be associated to a custom object for me to add items. 

We have a custom object Hardie_Builders_c  this acts as a redemption object for our customers. Our customers earn certain points and once accumulated they can redeem items from us. Each item is assigned a certain point value. Say for example a customer earned 10,000 points and redeemed item 1 (1020 points) and item 2 (230 points). Item and Item 2 must be visible on the Hardie_Builder_c record and must compute total balance left for points. 

There are a total of around less than 50 items they can redeem. I hope anyone can share their ideas. I'm pretty new with development and I appreciate any help. Thank you!
It looks like the data model for this would pretty straight forward.

I believe your Customers are stored as a Contact record and your Hardie_Builders_c object looksup to the contact object (or Customer Obj).
E.g., When I create a New contact named JOHN DOE, then I can attach several Hardie_Builders_c record under his record.

Now, I think you need to have a field named Item_Points__c on Hardie_Builders_c object which would represent points for each items and then have one Roll-up summary field (anmed "Total_Points_Sum__c) on Customer Object which would roll-up sum of all attached (child) record of Hardie_Builders_c object.

E.g., If John Doe has 3 records of Hardie_Builders_c attached under him then Total_Points_Sum__c field on John Doe's record would count he sum.

Now, have another field named "Howmany Points Wants to Redeem?" This would be a simple number field.
Have another field named "Total Redeemed Points." Update this field via workflow. How?
Have a workflow which does the following.
Whenever there is a value in "Howmany Points Wants to Redeem?" field, same value would duplicate in "Total Redeemed Points" field. But however you need to make sure you are always adding it up on it. This is what I meant.
Let's say field "Howmany Points Wants to Redeem?" has value of 100. At this point your workflow would wake up and make "Total Redeemed Points" to 100 correct?! Now, if you go back to the "Howmany Points Wants to Redeem?"  agin after few days and add 150 in it then workflow should wake up again and then should make "Total Redeemed Points" to a 100 + 150 which is 250.

If clear up this point then read the following.

Have another field named "Total Left Point" on Customer record which would be a formula field and the formula would be very simple which is
Total_Left_Points__c = ( Total_Points_Sum__c - Total_Redeemed_Points__c )

This is the big picture we are looking at,

Field Total_Points_Sum__c would always tells you how many total points Customer every has. (It's just total of all the child records, Hardie_Builders_c records points sum).

Field Howmany Points Wants to Redeem? would help you enter the value or number on howmany point does the customer wants to redeem? (e.g., you can write 10 today then 50 tomorrow and then 500 next day etc..)

Field Total Redeemed Points would tell you the total points that customer has redeemed so far. It would be a sum of all 10 + 50 + 500 = 560 based on the example above.

Field otal_Left_Points__c would count the number of points that the customer has left. How? just by simply doint  Total_Points_Sum__c - Total_Redeemed_Points__c.

Hope this helps!