I never use an If statement, as the Case Statement does everything If does, and is more flexible for development later.
I would suggest:
IsEmpty (CED1) ; Get(CurrentDate) ;
Supplier= ABC ; CED1 - 60 ;
CED1 - 134
That will check if there is any value in CED1. If not, it sets the RDD1 to today.
If there is a CED1 date and the Supplier is ABC it will set RDD1 to 60 days before that.
Otherwise it will set any other records to 134 days before the CED1 date.
I would suggest you untick the option to 'do not evaluate if all referenced fields are empty', and also in the storage options tick 'Do not store calculation results'.
The calculation you was asking about is as follows:
If(IsEmpty(Self) and supplier="ABC";Get(CurrentDate)+60;Get(CurrentDate)+120)
I see some problems using just the above formula. If you use a calculation It auto-enters the date before the supplier can be enter or if the wrong supplier is selected.
I would use a script trigger onObjectModify on the supplier field, also the supplier field would need to be a drop down list. I'm sure you have a contract / invoice date. I would let the DueDate be changed as long as todaysDate equals the contract Date.
My script would then be:
Set Field [contract:ced1;Get(CurrentDate)+60]
Set Field [contract:ced1;Get(CurrentDate)+120]
Show Custom Dialog [Title "System Message";Message;"Contract can only be modified on date created"]
thanks a lot guys
I have managed to get a pop up window opening to display notifications of due dates using the following script,
New Window [Name: "Notifications";Height: 100; Width: 300]
Can someone please advise me how i can get the new pop up window to display only a limited amount of data from a few fields that are required for viewing.
Design a layout specifically for use with this window. Use Go To Layout immediately after New Window to select that layout for your new window.
To get specific records for your new window, either perform a find after opening the new window or use Go To Related Records to both pull up a found set of matching records and also open the new window in one script step.