function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Pasan   EeriyagamaPasan Eeriyagama 

Trialforce Org derived new instance does not run triggers?

We noticed when a user registers for a trial from Appexchange it does not run Insert triggers. Seems it's just creating a snapshot of data instead. Is there any way we could run a Apex or similar post script please? (Without user intervention) Appreciate any clue/tip or advise on this.

We have some sample data records in Trialforce which rely on record Ids, and when new records are created for the new instance by SF, they will have set of new Ids. Therefore making the text values containing Id values Invalid (these string values are generated based on some business logic after insert/update/undelete).
Best Answer chosen by Pasan Eeriyagama
Pasan   EeriyagamaPasan Eeriyagama
Thanks @Nagendra.

Figured out a way.

I did solved this using,
1. Custom setting (To have a flag to avoid method being called repeatedly)
2. A Login Flow
3. A @InvocableMethod (called from Login flow)

This seems working fine.

All Answers

NagendraNagendra (Salesforce Developers) 
Hi Pasan,

TrialForce literally clones the data without running all the business logic that may be present. This is done to minimize the amount of time it takes to set up a new trial (and also why there are limits to the trial's data size). What you'll probably want to do is write a default landing page that will populate these text fields with the appropriate ID values when they initially log in for the first time. Unfortunately, there really isn't a better way to approach this problem. It's still possible to do so "automatically", but you'll have to make a conscious effort to do so.

Hope this helps.

Please mark this as solved if the information helps so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.

Thanks,
Nagendra
Pasan   EeriyagamaPasan Eeriyagama
Thanks @Nagendra.

Figured out a way.

I did solved this using,
1. Custom setting (To have a flag to avoid method being called repeatedly)
2. A Login Flow
3. A @InvocableMethod (called from Login flow)

This seems working fine.
This was selected as the best answer