0

This update is not happening:

sforce.connection.update([quot]);

I want show alert message for one profile when date is not equal to today . but update has to happen every time.

Thanks in advance

{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
    var connection = sforce.connection;
    var qid="{!Quote__c.Id}";
    var qdate="{!Quote__c.RFQ_Date__c}"
    var quot= new sforce.SObject("Quote__c");
    //quot.isEdited__c=false;
        quot.isPreviewd__c=true;
        quot.Generated__c=false;
        var today = new Date();
        var dd = today.getDate();
        var mm = today.getMonth()+1; //January is 0!
        var yyyy = today.getFullYear();
        if(dd<10) {
        dd='0'+dd
        } 
        if(mm<10) {
        mm='0'+mm
        } 
        today = dd+'/'+mm+'/'+yyyy;
        if(qdate!=today){
     if ( '{!$User.ProfileId}'=='00e90000000emPJ'){
        alert('Please Review and Check RFQ Date');
       }
       }
        sforce.connection.update([quot]);
        parent.location.href =parent.location.href;
        window.open("/apex/QuotePreview?id={!Quote__c.Id}","_blank");
Jagular
  • 3,356
  • 2
  • 36
  • 68
Teja
  • 1,422
  • 4
  • 27
  • 58

0 Answers0