• thomasGE
  • 0 Points
  • Member since 2010

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 1

I am totally new to Apex programming. Therefore I need some help. Here is the scenario: I want to count user licences per company. One country could have many companies. Object exists. I thought it would be a good idea to have the fields sfdc licence total, sfdc licence used and sfdc licence remaining on the company object (just like in the system overview). Then I want to have a country object related to it and let the same fields be there and have them updated with roll up summary. This should not be a real problem. But:

now I want to count user licences (on the user object there are fields like company name (picklist) and country and user licence. I want to count the number of salesforce licences used. How do I do that now with a trigger or other code? The number of licences per company counted should be written directly in the corresponding field on the company object and then the difference be calculated automatically (total - used = remaining). If remaining is 0 the system should throw an error message. 

Example: company A has 100 salesforce licences and 50 chatter free. Creating a new user the system now recalculates the used licences, eg. 90, the remaining then 10. And still no chatter free used, so remaining 50. 

The object structure should be country object as a collector for all company objects. How can I do it? I know there are workbooks and tutorials but it seems to be a bit more complicated as there is no way to have the user object related to other objects.

Thanks so much for helping me out...

best regards Thomas

Has anyone been able to use the {IF} in Word's mailmerge to conditionally include text based on a value returned from Salesforce?
For example:
{ IF «OPPORTUNITY_NUM_SVCS_DEFINED» <> "1" "Some conditional text." " " }
The example from Microsoft shows:
{ IF {MERGEFIELD Country \* Caps } <> "United Kingdom" "We offer special rates on travel to the British Isles." " " }
Which I have successfully used before.
  • November 05, 2007
  • Like
  • 0