• n1009
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies

Below is my code and , and having this"UNTERMINATED STRING LITERAL" error.I write this code in a custom button.

{!REQUIRESCRIPT("/soap/ajax/14.0/connection.js")}

alert('Inside...');

var checkbox = 'False';

var prescriptionResult = sforce.connection.query("Select Id,Prescription__c.Status__c,Prescription__c.Quantity__c, Prescription__c.Balance_Prescription_Quantity__c From Prescription__c WHERE Id ='{!Prescription__c.Id}'");

var Prescriptionappt = prescriptionResult.getArray("records");

var stockRecords = sforce.connection.query("select Id,Stock__c.Quantity_received__c from Stock__c where Stock__c.Drug__c ='{!Drug__c.Id}'"); 

var appt = stockRecords.getArray("records");

var DrugRecords = sforce.connection.query("select Id,Drug__c.Stock_on_hand__c from Drug__c Where Id='{!Prescription__c.DrugId__c}'");

var appt1=DrugRecords.getArray("records");

var updateRecords = [];

if ((Prescriptionappt[0].Status__c != "Partially collected") || (Prescriptionappt[0].Balance_Prescription_Quantity__c == null)|| (Prescriptionappt[0].Balance_Prescription_Quantity__c == 0) ||(parseFloat(appt1[0].Stock_on_hand__c))<(-Prescriptionappt[0].Balance_Prescription_Quantity__c)){
alert(' '+'cant done this functionality');
}

else {
for (var a=0; a<Prescriptionappt.length; a++) {

if(parseFloat(appt1[0].Stock_on_hand__c) > 0){

if(parseFloat(appt1[0].Stock_on_hand__c) >=
(Prescriptionappt[0].Balance_Prescription_Quantity__c)){

if(Prescriptionappt[0].Status__c == "Partially collected"){
Prescriptionappt[0].Status__c = 'Collected';


checkbox = 'True';
}
}

}
}
}
try{
alert('Inside 1');
result = sforce.connection.create(newRecord);
alert('inside 2');
var savePrescriptionResult = sforce.connection.update(Prescriptionappt);
alert('inside 3)
var saveStockResult = sforce.connection.update(appt);
alert('Inside 4');
if(result[0].success == 'true'){
alert('An New Opportunity with Name was Created Successfully.');
}
if (!savePrescriptionResult[0].getBoolean("success")) {
alert("Error updating Status, please contact your Administrator: " + savePrescriptionResult[0]);
}
if (!saveStockResult[0].getBoolean("success")) {
alert("Error updating Status, please contact your Administrator: " + saveStockResult[0]);
}
// Refresh the page
window.location.reload();
}
catch (err) {
alert('Comes in catch'+err.description);
}

 

 

  • August 21, 2013
  • Like
  • 0

I have a weird problem in my vf page...

 

<apex:outputField value="{!CustomObject__My_Note__c}" />

my_note__c is formula field in which i used something lyk Text(Value__c)...

Value__c is a number field.

I have used this code in a custom button which after click give me all fields in pdf format.

what my problem is that if i added value__c is 0.5..it give me value lyk .5 in pdf format.

 

i hope my problem is understood...any 1 know how to solve this..

thanx in advance

  • December 14, 2012
  • Like
  • 0

my problem is bit diffrent...i want to create two functionality ....

 

1.A picklist and a add button.when I clicked on add button  another picklist would be genrated with values.

2.consider there were 3 values at first picklist ...abc,por,xyz and default value shown in first picklist is abc so when add button clicked another picklist genrated with two values ,pqr and xyz..Also first picklist shown same values as it shown earlier...

 

need help...

thanks

 

  • November 27, 2012
  • Like
  • 0

I'm making a page in which i'm uploading a file to Amazon and i'm using:

 

<form id="formId" action=""
        method="post" enctype="multipart/form-data">

 

this method.

 

now i want to check the response of post request..but not getting how?

plz help...

thanks in advance

 

 

  • November 06, 2012
  • Like
  • 0

trying using sample native apps, getting this error on every app:

 

 

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.salesforce.androidsdk.sample.CloudTunesApp" on path: /data/app/com.salesforce.androidsdk.sample-1.apk

 

Any idea, what causing it ?

I have a weird problem in my vf page...

 

<apex:outputField value="{!CustomObject__My_Note__c}" />

my_note__c is formula field in which i used something lyk Text(Value__c)...

Value__c is a number field.

I have used this code in a custom button which after click give me all fields in pdf format.

what my problem is that if i added value__c is 0.5..it give me value lyk .5 in pdf format.

 

i hope my problem is understood...any 1 know how to solve this..

thanx in advance

  • December 14, 2012
  • Like
  • 0

I'm making a page in which i'm uploading a file to Amazon and i'm using:

 

<form id="formId" action=""
        method="post" enctype="multipart/form-data">

 

this method.

 

now i want to check the response of post request..but not getting how?

plz help...

thanks in advance

 

 

  • November 06, 2012
  • Like
  • 0

Hi,

 

Please have a look at this code:-

 

 <apex:panelGrid id="selectAdd">                                   
                                       
            <apex:selectList id="fld1" value="{!selectedVal}" multiselect="false" size="1" >                                            

              <apex:selectOptions id="selectAddOption" value="{!addressOptions}"/>      
                     <apex:actionSupport event="onselect" action="{!pickListProcess} rerender="errorPanel,     

                          addressPanel" status="SearchStatus immediate="true"/>                                                     
            

            </apex:selectList>                    
  </apex:panelGrid>  

 

 I am trying to obtain the value of selected picklist option (selectedVal ) in controller method - pickListProcess. But i always get it as null... anyother way to achieve this?

 

Thanks in anticipation...