Print this page

Some fields on license record are not populated when creating trial orgs using trialforce or signup request

Knowledge Article Number 000220654
Description When a trial org is created using trialforce or signup request, a license is created in the LMO, however, partners may notice that the following fields are blank on the license record: 

Org Status, Org Expiration Date, Instance

If they modify the license & save (without changing anything) several minutes after the license is created, those fields are populated with value.

When a package is installed in a subscriber org, a license is created in the LMO and above fields are populated with value.

Why such difference? 
Resolution This is working as designed, as when using trialforce or signup request, we are creating a new org from scratch, so when the license is created in the LMO, the org info is not yet available.

However when installing package into an existing org, org info is available so when the license is created, those fields are populated. 

These fields are actually formula fields:

Org Status = sfLma__Org_Status_Formula__c (text field) 
Org Expiration Date = sfLma__Org_Trial_Expiration__c (text) 
Instance = sfLma__Org_Instance__c (text) 

You can add those field to license page layout to review.

There are two options to get these fields populated automatically:

 1. Use a time-based workflow rule to update every license record one hour after it is created. 
- create a checkbox field(or any field you like) on license object and default to not checked 
- create a workflow rule on license object and add one hour after record creation as time trigger 
- add field update to update the checkbox created in step 1 
- activate the workflow rule 

Partners can use data loader or even use some simple code in developer console to update all existing licenses to populate those fields, for new licenses, the workflow rule will populate them. 

2. use scheduled apex class to run every 15-30 minutes to update licenses which have these fields as blank, a developer will need to write some code to do this 
- create a formula checkbox field (
Updatedok__c) on license object = not(isblank( sfLma__Org_Instance__c ))
- create schedulable apex class, the key is to get list of license records which need updating:
  List<sfLma__License__c> tobeupdatedlic = [Select id,Updatedok__c from sfLma__License__c where Updatedok__c = false limit xxx];
    if ( tobeupdatedlic.size()>0) {
               upsert tobeupdatedlic;
- schedule the class to run every 15 or 30 minutes


promote demote