You need to sign in to do that
Don't have an account?
Nikunj V
page redirect & insert object problem
hey,
i am trying to insert an object on button click and than need to redirect the page. with this code i am not able to redirect page. and also sometime it is inserting data, sometime not. i dont know why. please help me out:
i am trying to insert an object on button click and than need to redirect the page. with this code i am not able to redirect page. and also sometime it is inserting data, sometime not. i dont know why. please help me out:
public pagereference PunchIn() { Id pageid = controller.getId(); Integer PunchCount = [select count() From Project_Time__c WHERE Active__c = True AND Project__c =:pageid Limit 1]; Project_Time__c obj = new Project_Time__c(); obj.Project__c = pageid; obj.Latitude__c = valuelat; obj.Longitude__c = valuelong; obj.Punch_In_Time__c=System.NOW(); insert obj; Pagereference ref = new Pagereference('/apex/Pool_PH_WaterQuality'); ref.setRedirect(true); return ref; }
Please mark this as solution if this will help you.
Thanks,
Amit Chaudhary
You are assign "jsvalues" as Id for any tag in your VF page, please assign "jsvalues" as Id for any of one Visualforce page Tag.
It will definately solve your problem.
if its resolved your issue,please mark as best answer so it will help to other who will serve same problem.
Thanks!
if its resolved your issue,please mark as best answer so it will help to other who will serve same problem.
Thanks!
if its resolved your issue,please mark as best answer so it will help to other who will serve same problem.
Thanks!