• Supriyo Ghosh 9
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 3
    Replies
Hi,
I am one onclick javascript button in a custom object.

{!requireScript("/soap/ajax/26.0/connection.js")}
var deno = new sforce.SObject("Denomination__c");

deno.id = "{!Denomination__c.Id}";
var cDate="{!Denomination__c.CreatedDate}";
var name= "{!Denomination__c.Name}";
var isTransfered= "{!Denomination__c.Transfer__c}";
var isApproved = "{!Denomination__c.Approve__c}";
var message = confirm('Are you sure you want to continue? Click OK to continue.');
if(message)
{
if((isTransfered == 'true' || isTransfered == 1) && isApproved =='Yes')
{
alert('Denomination is already Authorized.')
}
else
{
//Assign the values

deno.Transfer__c= true;
//alert(deno.Transfer__c);
deno.Approve__c= "Yes";
//alert(deno.Approve__c);
//Random No Generation with Created date
var randNo=Math.floor((Math.random() * 100000) + 1);
var abmSeqNo= name+'-'+randNo;
randNo+'/'+cDate+'/'+name;
name+'/'+randNo;

if(abmSeqNo){
deno.ABM_Sequence_No__c= name.replace('E','A');
}
var r=sforce.connection.update([deno]);
window.location.reload(); //to reload the window and show the updated values
}
}

So can anyone guide me how to convert it with Lightning components and controller class.

Thanks in Advance
Hi ,
I am having a formula field.I want to remove some condition but I am unable to do that.
IF(ISPICKVAL(Vertical__c,'LI'), 
IF(NOT(ISPICKVAL(ProductDetail__r.Pricing_Category__c,'ULIP')), 
((NULLVALUE(Base_Premium__c,0)+NULLVALUE(Rider_Premium__c,0))+ 
IF((Inception_Branch__c != '641'), 
IF((Principle_Code__c = 'MLI'), 
IF(Year_of_Policy__c=1, 
(NULLVALUE(Base_Premium__c,0)*0.045 )+(Rider_Premium__c*0.1800), 
(NULLVALUE(Base_Premium__c,0)*0.0225 )+(Rider_Premium__c*0.18)), 
IF(AND(ProductDetail__r.Scheme_Code__c!='BPP1',ProductDetail__r.Scheme_Code__c != 'BPP2'), 
NULLVALUE(Base_Premium__c,0)*0.045, 
NULLVALUE(Base_Premium__c,0)*0.1800)+(Rider_Premium__c*0.1800)), 
IF((Principle_Code__c='BSLI'), 
IF(AND(ProductDetail__r.Scheme_Code__c!='BPP1',ProductDetail__r.Scheme_Code__c!='BPP2'), 
NULLVALUE(Base_Premium__c,0)*0.045, 
NULLVALUE(Base_Premium__c,0)*0),0))),NULLVALUE(Base_Premium__c,0)), 

IF(ISPICKVAL(Vertical__c,'GI'), 
IF(AND(ISPICKVAL(ProductDetail__r.Pricing_Category__c ,'Motor'),ProductDetail__r.CommercialValue_Flag__c= False), 
(NULLVALUE(Own_Damage_Premium__c,0)+NULLVALUE(Third_Party_Premium__c,0) ) * (1.1800), 

IF(AND(ISPICKVAL(ProductDetail__r.Pricing_Category__c ,'Motor'),ProductDetail__r.CommercialValue_Flag__c= True ), 
(NULLVALUE(Own_Damage_Premium__c,0)+NULLVALUE(Third_Party_Premium__c,0) ) + NULLVALUE(Own_Damage_Premium__c,0) *0.18 + NULLVALUE(Third_Party_Premium__c,0) * 0.12 , 

IF(ISPICKVAL(ProductDetail__r.Pricing_Category__c,'Non-Motor'), 
(NULLVALUE(Base_Premium__c,0)+NULLVALUE(Terrorism_Premium__c,0)) * ( 1.1800) , 
NULLVALUE(Base_Premium__c,0)))), 

IF(ISPICKVAL(Vertical__c,'MF'), 
NULLVALUE(MF_Amount__c,0), 

IF(or(ISPICKVAL(Vertical__c,'HI'),ISPICKVAL(Vertical__c,'HC')), 
NULLVALUE(Base_Premium__c,0)*(1.1800),0))))

In the above mentioned formula I want to remove below mentioned portion.

IF(AND(ProductDetail__r.Scheme_Code__c!='BPP1',ProductDetail__r.Scheme_Code__c != 'BPP2'), 
NULLVALUE(Base_Premium__c,0)*0.045, 
NULLVALUE(Base_Premium__c,0)*0.1800)+(Rider_Premium__c*0.1800)), 
IF((Principle_Code__c='BSLI'), 
IF(AND(ProductDetail__r.Scheme_Code__c!='BPP1',ProductDetail__r.Scheme_Code__c!='BPP2'), 
NULLVALUE(Base_Premium__c,0)*0.045, 
NULLVALUE(Base_Premium__c,0)*0),0))),

But I am getting error.Please help.
Hi,
public PageReference pageChange ()
    { 
        string vertical = ApexPages.currentPage().getParameters().get('vert');string PrinCode = ApexPages.currentPage().getParameters().get('PriCd');string ArnNo = ApexPages.currentPage().getParameters().get('Arn');
        string isrollover = ApexPages.currentPage().getParameters().get('Rollover');

I want to change String to boolean,but when I am giving it as Boolean isrollover = ......

It is showing error.Please help.
Hi,

I am using one trigger which will calculate a date range from my Policy object to Opportunity Object.
I am having a field named Proposal Date in Opportunity and Maturity date in policy object.
So I want to put a logic like if proposal date is 12/3/2019 so the Maturity date should be 19/3/2019 to 30/3/2019.If this range will true then it will okay otherwise it will through a error.
I have written something like 
 if(io1.Proposal_Date__c<po.Maturity_Date__c-7)
but this is not working.Please help.
Hi,

I am using Salesforce Mobile app.In salesforce mobile app when I am searching my lead in lookup only Lead name is appearing.I want to see some more filed in Mobile lookup search like name,mobile no,Address.Please help.
Hi,

I want to updateto date field based on another object value.If my Case object having a picklist field value ABCD then in policy object i wnat to update two date fields.I will match Policy no from my case object so that it will update that exact policy start date and end date. Please help
Hi,

I am using Salesforce Mobile app.In salesforce mobile app when I am searching my lead in lookup only Lead name is appearing.I want to see some more filed in Mobile lookup search like name,mobile no,Address.Please help.
Hi,

I want to updateto date field based on another object value.If my Case object having a picklist field value ABCD then in policy object i wnat to update two date fields.I will match Policy no from my case object so that it will update that exact policy start date and end date. Please help