-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
20Questions
-
44Replies
Error on Edit override using flow
The debug of the flow does not conclude to any errors.
However, when I go via the original object itself I do receive error.
"Update Fee
The flow couldn't find the "Get_Maintenance_Fee" resource."
The lightning component code:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,lightning:actionOverride" access="global" > <aura:handler name="init" value="{!this}" action="{!c.init}" /> <lightning:flow aura:id="flowId" /> </aura:component>
controller:
({ init : function (component) { // Find the component whose aura:id is "flowId" var flow = component.find("flowId"); // In that component, start your flow. Reference the flow's Unique Name. flow.startFlow("Update_Fee"); } })
-
- Akis Athanasiadis
- March 06, 2020
- Like
- 0
- Continue reading or reply
Lightning component customization
How can I customize the layout of the lightning component?
For example, i want to have 2 columns and set specific fields insise these columns.
-
- Akis Athanasiadis
- January 29, 2020
- Like
- 0
- Continue reading or reply
Lightning component redirect to record
The flow creates a record and I want at the end of the flow to be redicted inside the record which was just created.
In the flow I store the new record's id as {!recordId}
The controller is:
({ init : function (component) { // Find the component whose aura:id is "flowId" var flow = component.find("flowId"); // In that component, start your flow. Reference the flow's Unique Name. flow.startFlow("Internal_Requests"); }, handleStatusChange : function (component, event) { if(event.getParam("status") === "FINISHED") { var navEvt = $A.get("e.force:navigateToSObject"); navEvt.setParams({ "recordId": "??????????", "slideDevName": "related" }); navEvt.fire(); } }, })
What do i set at the record Id though to be redicted in the new record?
All the threads I have found, provide specific Id which of course does not apply to our needs.
-
- Akis Athanasiadis
- January 23, 2020
- Like
- 0
- Continue reading or reply
Delete apex
I have found several articles but they are 8-9 years old and what is described is not helpful.
-
- Akis Athanasiadis
- November 19, 2019
- Like
- 0
- Continue reading or reply
Update field from the field of the record it is related with
I have the contract standard object which has several record types.
in case i have the record type vendor purchases the user will need to insert another contract code. So contract standard obejct has a look up field to itself.
I would like in case i have the record type vendor-purchases, when i insert the contract code it is related with, to automatically insert the Account id.
This is what i've dove done but i get error " A non foreign key field cannot be referenced in a path expression: Maintenance_Contract__c at line 8 column 27"
trigger Vendor on Contract (before insert,before update) { for (Contract c : Trigger.new) { if (c.RecordTypeId=='0120Q0000004gQO') { c.AccountId=c.Maintenance_Contract__c.AccountID; } } }
An example of the layout
-
- Akis Athanasiadis
- June 05, 2019
- Like
- 0
- Continue reading or reply
VF page on Communities
When i assign the VF page to the new button of case, the community users cannot see the new button.
I have checked in VF page creation the box "Available for Lightning Experience, Lightning Communities, and the mobile app"
-
- Akis Athanasiadis
- May 14, 2019
- Like
- 0
- Continue reading or reply
Records not created by apex
I have created a trigger which is supposed to create multiple records.
trigger CreateMultipleContacts on Contract (after insert, after update) { List<Contract_Renewal__c> contractFinalListToInsert = New List<Contract_Renewal__c>(); if(Trigger.isInsert || Trigger.isUpdate){ for(Contract c : Trigger.New) { if(c.Renew__c == true) { Integer fetchingAlreadyExistedRecords = [SELECT count() FROM Contract_Renewal__c WHERE Contract__c=:c.Id and Not_Renewed__c=:false and Multi_Year__c=:true]; if(fetchingAlreadyExistedRecords!=null) { // We are only creating a records when there at least one Contract record exists. for(Integer i=0; i<fetchingAlreadyExistedRecords; i++) { Contract_Renewal__c con = new Contract_Renewal__c(); con.Contract__c = c.Id; contractFinalListToInsert.add(con); } } } try{ if(!contractFinalListToInsert.IsEmpty()){ INSERT contractFinalListToInsert; } } catch(Exception e){ System.debug('The thrown exception for CreatingAutoRecords is:: ' + e.getMessage()); } } } }I have the Contracts object and the Contract Renewals which is related to Contracts(Contracts master object)
When i check the box renew in contracts, records of contract renewal which are its children are created. However, when i do that no records are created. I check the contract renewals object just in case records arecreated without being assigned to the contracts. any ideas of what might be missing here?
when i
-
- Akis Athanasiadis
- May 09, 2019
- Like
- 0
- Continue reading or reply
Create multiple Records
Contracts are also related (sipmle lookup) with Contract_Renewals__c.
In contracts I have a checkbox named Renew__c.
What i want is if the Renew__c=True then to create new records of Contract Renewals.
If i have 5 contract renewals, then 5 should be created.
Any help please?
-
- Akis Athanasiadis
- May 08, 2019
- Like
- 0
- Continue reading or reply
delete child record
I cannot use the master detail relationship though due to operational reasons.
I have the Maintenance_Fees__c object which automatically creates a Contract_Renewal__c record. In the Contract_Renewal__c I have created a lookup field towards the Maintenance_Fees__c.
So what I need is whenever a maintenance fee is deleted, if there is a contract renewal record which is connected to this maintenance fee, then this record should also be deleted.
-
- Akis Athanasiadis
- March 18, 2019
- Like
- 0
- Continue reading or reply
Error on Contract Visualforce
<apex:page standardController="Contract" title="New Contract" > <apex:sectionHeader subtitle="New Contract"/> <apex:form > <apex:pageBlock mode="edit"> <apex:pageMessages /> <apex:pageBlockButtons location="top"> <apex:commandButton value="Save" action="{!save}"/> <apex:commandButton value="Cancel" action="{!cancel}"/> </apex:pageBlockButtons> <apex:pageBlockSection title="Information" columns="2"> <apex:pageblocksection columns="1"> <!--<apex:inputField value="{!currentRecord.id}" required="false" />--> <apex:inputField value="{!Contract.Account}" required="true" /> <apex:inputField value="{!Contract.End_Customer__c}" required="false" /> <apex:inputField value="{!Contract.Automatic_Renewal__c}" required="false" /> <apex:inputField value="{!Contract.Annual_Adjustment_Percentage__c}" required="false" /> <apex:inputField value="{!Contract.Vendor__c}" required="false" /> <apex:inputField value="{!Contract.Vat__c}" required="true" /> </apex:pageblocksection> <apex:pageblocksection columns="1"> <apex:inputField value="{!Contract.Account_Executive__c}" required="true" /> <apex:inputField value="{!Contract.Renewal_Type__c}" required="true" /> <apex:inputField value="{!Contract.Payment_Terms__c}" required="true" /> <apex:inputField value="{!Contract.Invoice_Period__c}" required="true" /> <apex:inputField value="{!Contract.StartDate}" required="false" /> </apex:pageblocksection> </apex:pageBlockSection> <apex:pageBlockButtons location="bottom"> <apex:commandButton value="Save" action="{!save}"/> <apex:commandButton value="Cancel" action="{!cancel}"/> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page>
I have assigned the VF page to the new button.
When I try to create a new contract I receive the following error message.
When I comment the account field, the process is moving on.
Any ideas on how to resolve this?
-
- Akis Athanasiadis
- February 05, 2019
- Like
- 0
- Continue reading or reply
Custom Button and Return URL on Object with Record Type
This object has also a record type.
I have created a custom button which reads the record types and proceeds to the next page having both Product Assignment and Contracts lookup fields already filled in. The issue is when I save the record that I go to the home page instead of returning to the maintenance fee record that was just created.
The code that I used is this:
https://cs109.salesforce.com/setup/ui/recordtypeselect.jsp?ent=01I0Q0000008y23&retURL=%2F{!Contract.Id}&save_new_url=%2Fa0i%2Fe%3FCF00N0Q000000dqIP%3D{!Asset_Product_Association__c.Contract__c}%26CF00N0Q000000dqIP_lkid%3D{!Contract.Id}%26saveURL%3D%252F{!Contract.Id}%26retURL&CF00N0Q000000dqIU={!Asset_Product_Association__c.Product__c}&CF00N0Q000000dqIP={!Contract.Id}&saveURL=%2F{!Contract.Id}&saveURL={!Contract.Id}
Any Ideas?
-
- Akis Athanasiadis
- January 18, 2019
- Like
- 0
- Continue reading or reply
View related lists depending on picklist
There is a pick list field in Internal Assets which conditionally creates a related list.
The picklist values are the following:
When the desktop option is selected, a record is created in the related list.
However, I don't want to see all the related lists below:
I would like to see only the related list which is related to the picklist item that is selected.
I believe that might happen using visualforce page. However, I am not sure how to set the conditional code (if exists) for that.
Any ideas?
-
- Akis Athanasiadis
- August 08, 2018
- Like
- 0
- Continue reading or reply
Create record after process approval
I have an approval process and I need when the process is approved to create automatically a new record.
I have checked several threads abou similar issues and everyone is telling this can be done with PB.
I had already done this but it doesn't fire automatically.
I have a checkbox named renewed in the renewals object where the process gets approved. This field is checked automatically when the process is approved. The new record doensn't get created. It gets created only if I edit+save the renewals records.
Any ideas on how to do that automatically?
-
- Akis Athanasiadis
- July 20, 2018
- Like
- 0
- Continue reading or reply
Update Custom Field in Users Object
I am trying to create a trigger which will be checking a checkbox automatically when another process is done.
In specific, I have a custom object Vacation Requests which follows an approval process. If the request is approved, a checkbox "Approved" is being checked.
Then I am creating a trigger which needs to check if the current date is = to the start date of the vacation. if yes, then the checkbox should be selected.
However this doesn't happen.
Any ideas?
trigger Vacation on Vacation_Requests__c (before insert) { User u = new User(); for (Vacation_Requests__c vr:Trigger.new) { if (vr.Approved__c==true && vr.Start_Date__c==System.Today()) u.On_Vacation__c=true; } }
-
- Akis Athanasiadis
- June 19, 2018
- Like
- 0
- Continue reading or reply
Remove Salesforce Logo from login community login page
I have tried to .communityLogo { visibility:hidden} in branding section but the image is not hidden.
Any ideas?
-
- Akis Athanasiadis
- September 07, 2017
- Like
- 0
- Continue reading or reply
schedule email
I need to send every day to the employees an email(reminder) to fill in yesterday's events in calendar.
I have used this code but it didn't work.
global class sendEmailToUSer implements Schedulable {
global void execute(SchedulableContext sc) {
list<User> lstUser = [Select ID from User where isActive = true and Name='Athanasiadis, Akis'];
for(User iterator : lstUser) {
EmailTemplate objTemp = [SELECT Id FROM EmailTemplate where DeveloperName = 'Case status for Contacts' limit 1];
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setTemplateId(objTemp.Id);
mail.setTargetObjectId(iterator.Id);
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}
}
}
I received the following error:
Scheduler: failed to execute scheduled job: jobId: 7077E00000oGr5L, class: common.apex.async.AsyncApexJobObject, reason: List has no rows for assignment to SObject
I firstly wanted to check it on myself in order to make sure if this works.
Any help?
-
- Akis Athanasiadis
- August 10, 2017
- Like
- 0
- Continue reading or reply
Export excel report to specific local path
Ex...let's say I have a scheduled report for monday. is there any way to have it exported and stored in excel in a specific local folder ?
-
- Akis Athanasiadis
- July 20, 2017
- Like
- 0
- Continue reading or reply
Export Scheduled Report in excel
I have already the report created.
I have used the following code:
global class Exporter implements System.Schedulable {
global void execute(SchedulableContext sc) {
ApexPages.PageReference report = new ApexPages.PageReference('/00O58000003m3Sa?csv=1');
Messaging.EmailFileAttachment attachment = new Messaging.EmailFileAttachment();
attachment.setFileName('report.xls');
attachment.setBody(report.getContent());
attachment.setContentType('text/csv');
Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage();
message.setFileAttachments(new Messaging.EmailFileAttachment[] { attachment } );
message.setSubject('Report');
message.setPlainTextBody('The report is attached.');
message.setToAddresses( new String[] { 'mplampla.com' } );
Messaging.sendEmail( new Messaging.SingleEmailMessage[] { message } );
}
}
although I don't see how i give this a schedule.
I guess that this reads the schedule that exists in the report and so the report is sent thourgh this code as an attachment in an email?
Can I also store the executable attachment directly to a path?
-
- Akis Athanasiadis
- July 20, 2017
- Like
- 0
- Continue reading or reply
Bad Filter Id
I found through the "create new view" in calendar the ID:
https://cs84.salesforce.com/ui/list/FilterEditPage?ftype=z&retURL=%2F007%3Ffcf%3D00B58000004YXWq%26rolodexIndex%3D-1%26page%3D1
and I created the page by using this code:
<apex:page >
<apex:enhancedList listId="3D00B58000004YXW" height="600" customizable="false" rowsPerPage="25"/>
</apex:page>
Nevertheless, I receive a "bad filter id" message when I try to access the new tab
-
- Akis Athanasiadis
- June 26, 2017
- Like
- 0
- Continue reading or reply
Auto delete records
Hello.
I have a question.I need to create an auto delete process throuch process builder.
I have a custom object "revenues" and a custom object "purchases".Every time i add,create or delete a revenue a record from purchases must be created/updated/deleted.As for now I have accomplished the creation and update process but I cannot find a way to auto delete a purchase record when the relative revenue record is deleted.Can you give me some help with this?
-
- Akis Athanasiadis
- September 21, 2016
- Like
- 0
- Continue reading or reply
Error on Edit override using flow
The debug of the flow does not conclude to any errors.
However, when I go via the original object itself I do receive error.
"Update Fee
The flow couldn't find the "Get_Maintenance_Fee" resource."
The lightning component code:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,lightning:actionOverride" access="global" > <aura:handler name="init" value="{!this}" action="{!c.init}" /> <lightning:flow aura:id="flowId" /> </aura:component>
controller:
({ init : function (component) { // Find the component whose aura:id is "flowId" var flow = component.find("flowId"); // In that component, start your flow. Reference the flow's Unique Name. flow.startFlow("Update_Fee"); } })
- Akis Athanasiadis
- March 06, 2020
- Like
- 0
- Continue reading or reply
Lightning component customization
How can I customize the layout of the lightning component?
For example, i want to have 2 columns and set specific fields insise these columns.
- Akis Athanasiadis
- January 29, 2020
- Like
- 0
- Continue reading or reply
Lightning component redirect to record
The flow creates a record and I want at the end of the flow to be redicted inside the record which was just created.
In the flow I store the new record's id as {!recordId}
The controller is:
({ init : function (component) { // Find the component whose aura:id is "flowId" var flow = component.find("flowId"); // In that component, start your flow. Reference the flow's Unique Name. flow.startFlow("Internal_Requests"); }, handleStatusChange : function (component, event) { if(event.getParam("status") === "FINISHED") { var navEvt = $A.get("e.force:navigateToSObject"); navEvt.setParams({ "recordId": "??????????", "slideDevName": "related" }); navEvt.fire(); } }, })
What do i set at the record Id though to be redicted in the new record?
All the threads I have found, provide specific Id which of course does not apply to our needs.
- Akis Athanasiadis
- January 23, 2020
- Like
- 0
- Continue reading or reply
Delete apex
I have found several articles but they are 8-9 years old and what is described is not helpful.
- Akis Athanasiadis
- November 19, 2019
- Like
- 0
- Continue reading or reply
Update field from the field of the record it is related with
I have the contract standard object which has several record types.
in case i have the record type vendor purchases the user will need to insert another contract code. So contract standard obejct has a look up field to itself.
I would like in case i have the record type vendor-purchases, when i insert the contract code it is related with, to automatically insert the Account id.
This is what i've dove done but i get error " A non foreign key field cannot be referenced in a path expression: Maintenance_Contract__c at line 8 column 27"
trigger Vendor on Contract (before insert,before update) { for (Contract c : Trigger.new) { if (c.RecordTypeId=='0120Q0000004gQO') { c.AccountId=c.Maintenance_Contract__c.AccountID; } } }
An example of the layout
- Akis Athanasiadis
- June 05, 2019
- Like
- 0
- Continue reading or reply