• jay209
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies
I have an objects like Account and Family__c, In family I have a Lookup field like Main_account__Cand family_account__c and in Account object i have fields like Application_Number__c text field and Priority_Number__c is also a text field which contains Comma separated values. Now I want to Create a Record in Family, If they are 5 Account records and out of five 2 records have same Application_Number__c then i want to create a Family Record. and Main_account__C value will be account1 and the family_account__c will be the matched Account(account2).and criteria will be like if Application_Number__c field value matches with any other Account Record Application_Number__c value then i need to Create a new record in Family__c, like that same for Priority_Number__c also
global class AccountFamilygroupBatch implements Database.Batchable<sObject>
 {
global Database.QueryLocator start(Database.BatchableContext BC)
{
    return Database.getQueryLocator('SELECT id,Name,Application_Number__c,Priority_Number__c FROM Account WHERE Application_Number__c !=Null OR Priority_Number__c !=Null');       
}   
global void execute(Database.BatchableContext BC, List<Account> scope)
{
    List<Family__c> family = New List<Family__c>();
    final String appNo = scope[0].Application_Number__c;
    final String priNo = scope[0].Priority_Number__c;
    for(Account pat : scope)
    {
        if(pat.Application_Number__c == appNo || pat.Priority_Number__c ==priNo)
        {
            Family__c fly = New Family__c();
            fly.Name=pat.Name;
            fly.Main_account__c=pat.id;
            fly.Family_account__c=pat.id;
            family.add(fly);
        }
    }
    Insert family;
    system.debug('-->>Inserted Family: '+family); 
}

global void finish(Database.BatchableContext BC)
{
// will be called in end when batch finish.
}
}
Now Record is creating but like expected. please help me to resolve this.
Thanks.
  • August 29, 2018
  • Like
  • 0
I have an `aura:Iterate` in iterate i have a close icon onclick of that i will get an modal popup and i will give values and click on **submit** then modal will close and i want to make that button disable. below i am posting my code.

**Controller:**

    rejcomment : function(component, event, helper)
    {
        component.set("v.isRejectOpen", false);
        component.find("v.IDFReject", "icn");
        var mydid = component.get("v.forselectedidf");
        alert('Before assigned');
        var btn = event.getSource();
        btn.set("v.disabled",true);
        alert('Assigned');
    },

**Component:**

    <lightning:button iconName="utility:close" aura:id="{!idf.Base_Invention_Disclosure__c}" variant="bare" disabled="false" class="{!v.IDFReject}" onclick="{!c.openrejModel}" value="{!idf.Base_Invention_Disclosure__c}" />

i have tried like this and i am getting following Error.[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/rPsQR.png

Correct me where i am doing wrong.

Thanks

0down votefavoriteI got a requirement to get data from all the tables present in the vf page for example: we have 100 records, i have customized page into a list view with 10 records per page. Now i have a button called Export, by clicking on that button i need to download all 100 records, as a csv file.please help on this guys
Note: Exporting data without using jquery.
how make a field mandatory in visual force page without using "Required=true" for a standard controller
  • January 04, 2017
  • Like
  • 0
Hi Guys..!!

I Have a query, can we integrate Truecaller with Salesforce..??
I have an `aura:Iterate` in iterate i have a close icon onclick of that i will get an modal popup and i will give values and click on **submit** then modal will close and i want to make that button disable. below i am posting my code.

**Controller:**

    rejcomment : function(component, event, helper)
    {
        component.set("v.isRejectOpen", false);
        component.find("v.IDFReject", "icn");
        var mydid = component.get("v.forselectedidf");
        alert('Before assigned');
        var btn = event.getSource();
        btn.set("v.disabled",true);
        alert('Assigned');
    },

**Component:**

    <lightning:button iconName="utility:close" aura:id="{!idf.Base_Invention_Disclosure__c}" variant="bare" disabled="false" class="{!v.IDFReject}" onclick="{!c.openrejModel}" value="{!idf.Base_Invention_Disclosure__c}" />

i have tried like this and i am getting following Error.[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/rPsQR.png

Correct me where i am doing wrong.

Thanks
when i click edit and save a VF Component without even modifying any code its giving me "Error: This Name already exists or has been previously used. Please choose a different name." 

The solution is to delete this component and create same with another name but i dont want to do this as this is referred in many places.
 root cause or any other solution appreciated 
how make a field mandatory in visual force page without using "Required=true" for a standard controller
  • January 04, 2017
  • Like
  • 0