You need to sign in to do that
Don't have an account?
nwing
"File only saved locally, not to server" warning, but no errors. Save Apex To Server
The only error I am getting on the below is that it says "File only saved locally, not to server" in the Warnings section, and of course it is not showing up in the ui.
I am sure this is something simple, but I have not found it yet. Any help would be greatly appreciated.
Thanks,
Code:
trigger SiteLeaseEndDate on Site_Lease_Contract__c (after update) { private Site_Lease_Contract__c[] newSiteLeaseEndDate = Trigger.new; Double Months = newSiteLeaseEndDate[0].Lease_Term_In_Months__c; Double y = Months; Integer x = y.intvalue(); newSiteLeaseEndDate[0].End_Date_2__c = newSiteLeaseEndDate[0].Start_Date__c.addMonths(x); }
However, you may want to make the following changes to your code anyway:
Syntax issues:
- Remove "private" in line two. "newSiteLeaseEndDate" is a local variable, scoped to the trigger body, so it can't be accessed by any other class anyway. (The "private" keyword may be illegal here, in which case this might be the root cause of your warning message.)
Logical issues:
- Your trigger will only process 1 out of n records in Trigger.new[]. If you trigger fires on a batch of more than one Site_Lease_Contract__c (say, on a mass update via the API) only the first Site_Lease_Contract__c.End_Date_2__c field will be set.
- Unless Site_Lease_Contract__c is a required field, you may want to check that Lease_Term_In_Months__c is not null before calling its intValue() method.
Style issues:
You don't need the variables "y" or "x". You could write it in one line, but you keep the readability with two:
Thank you very much for your help. I went through everything, and changed the code as below as well as tried the save to server option, but nothing seemed to change. I was able to save just the first and last line of the trigger to the server system, but once I put the rest of it in there no further updates get loaded....
I am trying to get over the hump here as far as experience in this environment goes, so I am not sure where to look next, but anything you have helps.
thanks,
No errors, just warnings... on this particular code anyway. (how do you paste an image in this?) I do not have an available server to load it onto.
Do I need to run a test on a trigger? It will upload the trigger definition, but not the code inside once that is added.
I am walking through apex step by step to see if I can dig this issue up, but no luck so far.
(It is highly recommended NOT to create Force.com projects against production. If your project is created against a production organization, all code coverage requirements for deploying to production apply every time you save a file.)
I'm dealing since last week with the same problem.
I'm not happy with this one.
Neither its possible to remove unused and invalid old classes which also causes the problem on the live environment of salesforce.
Hope you allready found a solution and can help me out with this one because its a pain in the ass.
No help, no support.
Regards,
Valentino Rijhen
the thing to check is......
make sure you select both class and trigger at the same time when you 'save to server'.
Old post but I just encountered this exact issue. Bizarre issue was I had one project working fine, the other not.
A quick look at the Eclipse Project Properties->Builders uncovered a difference.
The broken one was missing the definition for the "Force.com Online Builder" - but how to add it in?
Rather than battle with the Eclipse IDE GUI I decided to look at the Eclipse Project files(i.e the .project files inside each workspace project directory)
Working .project file:
<?xml version="1.0" encoding="UTF-8"?><projectDescription>
<name>working@projectname</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.salesforce.ide.builder.online</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.salesforce.ide.builder.default</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.salesforce.ide.nature.default</nature>
<nature>com.salesforce.ide.nature.online</nature>
</natures>
</projectDescription>
File Saved Locally Only Issue .project file:
<?xml version="1.0" encoding="UTF-8"?><projectDescription>
<name>broken@projectname</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.salesforce.ide.builder.default</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.salesforce.ide.nature.default</nature>
</natures>
</projectDescription>
Spot the difference? :-)
A quick copy'n'paste effort later and a restart of Eclipse.... voila files now save server side.
Hope this helps anyone in the future.
nuked planet
The problem I had with this is that there was already a trigger with the same execution trigger (before update) so it would only let me save it if it was empty. Solution was to make all in one trigger.
Just try the following solution.
Righ click on the object > Force.com > Work Online.
Worked fine for me.
anyway; I'm able to change any apex class, trigger and VF which are already present in production, but I need to create new Classes and Triggers.
I can create new trigger and class locally but unable to upload it to server. Please refer following image
Please suggest me solution for this.
Regards'
Taresh Pandey
Step 1: Select the desired class that needs to be deployed on server. Right Click on the desired Class, go inside Force.com
Step2: Click on ‘Save to Server’. Only for the first time it will ask to synchronise with server, select ‘No’. After that it will ask to save the selected component(‘s) to the server, select ‘Yes’.
The selected code will be deployed over the server.