while creating activity from campaign form one start date and end date is there.it sis by default taking current date.
i want to restrict the activty creation with the campaign end date.if the activity creation date is more than campaign end date ,it should not allow to cerate a new activity.I am not able to find the relation between camapaign form with smmactivity. suggest how to relate this tables.how can i restrict this creation of activity beyond the campaign end date.
You would need to modify it to achieve this I believe, but there are good reasons why activities can be created against a campaign even when it is over - dissemination, statistical review, ROI etc. The campaign dates are for other purposes, it does not restrict you working on the campaign - this would mean you cannot work on it also until it has started, which is not correct, you need to get everything ready for the start of the campaign.
I think there is no direct relation between the smmActivities and smmCampaignTable.
there is another table which you need to use - smmActivityParentLinkTable
The smmActivityParentLinkTable has a field named ParentType - which will indicate from where the activity has been created.
In this case the field value would be campaign - for more look into Associations tab in activities.
Based on these you need to find out the end date of the campaign.
Once that is done the validation can be done at different places - the best places could be overriding validate Field, validate write methods of smmActivities table. also look into initValue method of the smmActivities where start and end dates will be assigned as system date…